diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef379fb..6c0e6c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,8 +55,23 @@ jobs: env: # show timings of tests PYTEST_ADDOPTS: --durations=0 - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | py.test --cov aiida_gaussian --cov-append . - coveralls --service=github + + # note that for a matrix test that will send multiple reports to coveralls, + # the parallel version should be used to avoid errors. + - name: Send coverage to Coveralls (parallel) + uses: coverallsapp/github-action@v2 + with: + parallel: true + flag-name: run ${{ join(matrix.*, ' - ') }} + + coveralls-finish: + needs: tests + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e0f45..5622870 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: black language_version: python3 - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.1.0 hooks: - id: flake8 args: [--count, --show-source, --statistics] diff --git a/aiida_gaussian/calculations/gaussian.py b/aiida_gaussian/calculations/gaussian.py index 490f378..2067894 100644 --- a/aiida_gaussian/calculations/gaussian.py +++ b/aiida_gaussian/calculations/gaussian.py @@ -218,4 +218,7 @@ def _render_input_string_from_params(cls, parameters, pmg_structure): parameters.setdefault("spin_multiplicity", parameters.pop("multiplicity", None)) parameters["title"] = "input generated by the aiida-gaussian plugin" gaussian_input = GaussianInput(pmg_structure, **parameters) - return gaussian_input.to_string(cart_coords=True) + try: + return gaussian_input.to_string(cart_coords=True) + except AttributeError: + return gaussian_input.to_str(cart_coords=True) diff --git a/pyproject.toml b/pyproject.toml index 10754f7..d73f48c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ testing = [ "pgtest~=1.3.2", "wheel~=0.31", "coverage", - "pytest~=6.1", + "pytest~=7.0", "pytest-cov", "pytest-regressions~=2.2", "coveralls", diff --git a/tests/parsers/test_base.py b/tests/parsers/test_base.py index d09cb2a..6a2f67f 100644 --- a/tests/parsers/test_base.py +++ b/tests/parsers/test_base.py @@ -1,4 +1,12 @@ -"""Tests for the :class:`aiida_gaussian.parsers.gaussian.GaussianBaseParser` class.""" +""" +Tests for the :class:`aiida_gaussian.parsers.gaussian.GaussianBaseParser` class. + +Note on updated parsers (e.g. in Pymatgen) and data_regression: +If newer versions of parsers add extra fields, just update the reference data with + pytest --force-regen +Although this will cause tests to fails with folder versions of the parser, but in +general it should not be a problem. +""" # pylint: disable=redefined-outer-name diff --git a/tests/parsers/test_base/test_nan_inf.yml b/tests/parsers/test_base/test_nan_inf.yml index 4210ff9..14f6bf1 100644 --- a/tests/parsers/test_base/test_nan_inf.yml +++ b/tests/parsers/test_base/test_nan_inf.yml @@ -18,8 +18,10 @@ metadata: - 1127102.5 functional: M062X legacy_package_version: 16revisionC.02 + memory_available: 300000000000 methods: - DFT + num_cpu: 44 package: Gaussian package_version: 2016+C.02 platform: ES64L