Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,27 @@ jobs:
GITHUB_PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# This is required to get the commit history for merge commits for
# the ci-skip check below.
fetch-depth: '0'
- name: Check for [skip ci] in commit message
uses: mstachniuk/ci-skip@v1
with:
# This setting causes the tests to 'fail' if [skip ci] is specified
fail-fast: true
commit-filter: '[skip ci]'
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- run: sudo apt-get install -y graphviz doxygen
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
- run: |
# Uncomment the below to use the submodule version of fparser rather
# than the latest release from pypi.
pip install external/fparser
pip install .[doc]
# Now we can check for warnings and broken links
- run: cd doc; make html SPHINXOPTS="-W --keep-going"
- run: cd doc; make linkcheck
Expand Down Expand Up @@ -102,10 +117,10 @@ jobs:
python -m pip install --upgrade pip
# Some of the examples use Jupyter.
pip install jupyter
# We need to install sphinx to get correct doc testing
# Uncomment the below to use the submodule version of fparser rather
# than the latest release from pypi.
# pip install external/fparser
pip install external/fparser
# We need to install sphinx to get correct doc testing
pip install .[doc]
pip install .[test,treesitter]
- name: Lint with flake8
Expand Down
2 changes: 1 addition & 1 deletion external/fparser
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ classifiers = [
]
dependencies = [
"pyparsing",
"fparser==0.2.2",
# "fparser==0.2.3",
"configparser",
"sympy",
"Jinja2",
Expand Down
4 changes: 2 additions & 2 deletions src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def test_generate_lfric_adjoint_no_routines_error(fortran_reader):

MULTI_ROUTINE_CODE = (
f"module test_mod\n"
f" implicit none\n"
f" use kernel_mod\n"
f" use argument_mod\n"
f" implicit none\n"
f"{METADATA}"
f" public test_code\n"
f" interface test_code\n"
Expand Down Expand Up @@ -187,9 +187,9 @@ def test_generate_lfric_adjoint_multi_routine_logging(fortran_reader, caplog):

SINGLE_ROUTINE_CODE = (
"module test_mod\n"
" implicit none\n"
" use kernel_mod\n"
" use argument_mod\n"
" implicit none\n"
" type, extends(kernel_type) :: test_type\n"
" type(arg_type), dimension(2) :: meta_args = (/ &\n"
" arg_type(gh_field, gh_real, gh_inc, w0), &\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ def test_import_in_where_clause(fortran_reader):
'''
code = '''
program where_test
implicit none
use some_module, only: a, b, c, d
implicit none
where(a(:) + b > 1)
b = c + d
Expand All @@ -927,8 +927,8 @@ def test_import_in_where_clause(fortran_reader):

code2 = '''
program where_test
implicit none
use some_module, only: c, d
implicit none
integer, dimension(100) :: a, b
where(a(:) + b > 1)
Expand Down
6 changes: 3 additions & 3 deletions src/psyclone/tests/psyir/nodes/codeblock_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ def test_codeblock_get_fortran_lines():
frontends)
'''
code = "\nsubroutine mytest\nend subroutine"
tree = Fparser2Reader().generate_parse_tree_from_source(code)
tree = Fparser2Reader(free_form=True).generate_parse_tree_from_source(code)
block = Fparser2CodeBlock(tree.children, CodeBlock.Structure.STATEMENT)
assert isinstance(block.get_fortran_lines(), list)
assert "subroutine mytest" in block.get_fortran_lines()
assert "end subroutine" in block.get_fortran_lines()
assert "SUBROUTINE mytest" in block.get_fortran_lines()
assert "END SUBROUTINE" in block.get_fortran_lines()

tree = FortranTreeSitterReader().generate_parse_tree_from_source(code)
block = TreeSitterCodeBlock(tree, CodeBlock.Structure.STATEMENT)
Expand Down
Loading