diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index bc4c65ab2a..fa207b6d77 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 @@ -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 diff --git a/external/fparser b/external/fparser index d93d18de65..fd6da0db04 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit d93d18de6526a09b5bb301d55d3ba6f52a55e6b9 +Subproject commit fd6da0db0481f2813728cdf7541b62ed84211d89 diff --git a/pyproject.toml b/pyproject.toml index 7d2ee07ede..70930bc389 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ classifiers = [ ] dependencies = [ "pyparsing", - "fparser==0.2.2", + # "fparser==0.2.3", "configparser", "sympy", "Jinja2", diff --git a/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py b/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py index 89b4ddf0cd..dc19ac3079 100644 --- a/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py +++ b/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py @@ -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" @@ -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" diff --git a/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py b/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py index 9483fa4e17..6011df9f55 100644 --- a/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py +++ b/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py @@ -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 @@ -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) diff --git a/src/psyclone/tests/psyir/nodes/codeblock_test.py b/src/psyclone/tests/psyir/nodes/codeblock_test.py index 39fb4640aa..30eb62f643 100644 --- a/src/psyclone/tests/psyir/nodes/codeblock_test.py +++ b/src/psyclone/tests/psyir/nodes/codeblock_test.py @@ -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)