From bacdf3ee21027a1910b3d40f31ca7c3dea94fdb5 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Fri, 6 Dec 2024 16:59:07 +0000 Subject: [PATCH 1/8] CI: Switch from aiida-testing to aiida-test-cache aiida-testing pytest plugin has been renamed to aiida-test-cache and published on PyPI we can drop the dependency on Git repo. The released version should be fully backwards compatible, see release notes: https://github.com/aiidateam/aiida-test-cache/releases/tag/v0.0.1 --- .github/workflows/ci.yml | 3 +-- tests/conftest.py | 20 +++++++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 918fe254..300a0f43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,12 +168,11 @@ jobs: - name: Install python dependencies run: | pip install --upgrade wheel setuptools - pip install git+https://github.com/aiidateam/aiida-testing.git@main + pip install aiida-test-cache~=0.0.1 pip install --no-deps git+https://github.com/aiidateam/aiida-common-workflows.git@master pip install .[testing,graphs] pip install ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }} pip install ${{ matrix.bokeh-version }} ${{ matrix.mpl-version }} - reentry scan || true - name: Run pytest run: | diff --git a/tests/conftest.py b/tests/conftest.py index 2ffa45de..2c5e7424 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,14 +12,14 @@ CONFTEST_LOCATION = Path(__file__).parent.resolve() -# aiida_testing.mock_codes in development, not yet a stable dependency +# aiida-test-cache package is in development, not yet a stable dependency # therefore we try to import it and if it fails we skip tests with it RUN_REGRESSION_TESTS = True try: - import aiida_testing + import aiida_test_cache except ImportError: - print('AiiDA-testing not in path. Running without regression tests for Workchains and CalcJobs.') + print('aiida-test-cache package not installed. Running without regression tests for Workchains and CalcJobs.') RUN_REGRESSION_TESTS = False pytest_plugins = ['aiida.manage.tests.pytest_fixtures', 'masci_tools.testing.bokeh'] @@ -36,30 +36,24 @@ def pytest_configure(config): We make them all lowercaps as convention """ config.addinivalue_line('markers', - 'regression_test: test using the aiida-testing plugin for workflow regression tests') + 'regression_test: test using the aiida-test-cache plugin for workflow regression tests') def pytest_collection_modifyitems(session, config, items): """After test collection modify collection. - Skip regression test if aiida-tesing is not there + Skip regression tests if aiida-test-cache is not there """ import aiida skip_regression = pytest.mark.skip( - reason='Workflow regression test is skipped, because aiida-testing is not available') - # aiida_version_skip = pytest.mark.skipif( - # aiida.get_version().startswith('2.'), - # reason='Workflow regression test is skipped, because aiida-testing is not compatible with AiiDA 2.0') + reason='Workflow regression test is skipped, because aiida-test-cache is not available') regression_items = [item for item in items if 'regression_test' in item.keywords] if not RUN_REGRESSION_TESTS: for item in regression_items: item.add_marker(skip_regression) - # for item in regression_items: - # item.add_marker(aiida_version_skip) - @pytest.fixture(scope='function') def fixture_sandbox(): @@ -767,7 +761,7 @@ def load_cache(absolute_archive_path): # pylint: disable=redefined-outer-name def _load_cache(archive_path): #TODO: private import not good - from aiida_testing.archive_cache._utils import load_node_archive # pylint: disable=import-error + from aiida_test_cache.archive_cache._utils import load_node_archive # pylint: disable=import-error full_archive_path = absolute_archive_path(archive_path, overwrite=False) # check and load export export_exists = os.path.isfile(full_archive_path) From 24da182f63dd7f74677e55a343c02772034eba50 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:12:38 +0100 Subject: [PATCH 2/8] test with aiida 2.6 --- .github/workflows/ci.yml | 10 ++++------ pyproject.toml | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 300a0f43..63e93c66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: allowed-to-fail: [false] include: - python-version: "3.11" - aiida: {version: 'aiida-core==2.3.0', name: '2.3.0'} + aiida: {version: 'aiida-core==2.6.3', name: '2.6'} masci-tools: {version: 'masci-tools', name: 'stable'} bokeh-version: 'bokeh==3.0.3' mpl-version: 'matplotlib==3.6.3' @@ -167,12 +167,10 @@ jobs: - name: Install python dependencies run: | - pip install --upgrade wheel setuptools - pip install aiida-test-cache~=0.0.1 pip install --no-deps git+https://github.com/aiidateam/aiida-common-workflows.git@master - pip install .[testing,graphs] - pip install ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }} - pip install ${{ matrix.bokeh-version }} ${{ matrix.mpl-version }} + pip install -e .[testing,graphs] \ + ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }} \ + ${{ matrix.bokeh-version }} ${{ matrix.mpl-version }} - name: Run pytest run: | diff --git a/pyproject.toml b/pyproject.toml index 62a01a6f..0e4d7020 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,10 +51,11 @@ docs = [ testing = [ "pytest>=2.9", "pytest-timeout", - "pytest-cov~=3.0", #For reading configuration from pyproject.toml + "pytest-cov~=3.0", "pytest-mpl>=0.12", "pgtest", - "pytest-regressions>=1.0" + "pytest-regressions>=1.0", + "aiida-test-cache @ git+https://github.com/aiidateam/aiida-testing.git@backport-2.6-support", ] pre-commit = [ "pre-commit>=2.6.0", From 03556a629f36a191317414bdba6c01bdd90d5e2e Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:21:12 +0100 Subject: [PATCH 3/8] Add FORCE_COLOR, simplify caches --- .github/workflows/ci.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63e93c66..208a11da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: aiida-fleur on: [push, pull_request] +env: + FORCE_COLOR: 1 + jobs: docs: @@ -27,20 +30,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.8 - - - name: Cache python dependencies - id: cache-pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: pip-docs-${{ hashFiles('**/pyproject.toml') }} - restore-keys: | - pip-docs- + cache: pip - name: Install python dependencies run: | pip install -e .[docs] - reentry scan || true - name: Build documentation env: @@ -57,19 +51,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Cache python dependencies - id: cache-pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }} - restore-keys: | - pip-pre-commit- - - name: Set up Python 3.8 uses: actions/setup-python@v5 with: python-version: 3.8 + cache: pip - name: Install python dependencies run: | From 73b13020f3c4c7075545998581a3c849838f4eae Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:26:57 +0100 Subject: [PATCH 4/8] Back to 0.0.1 version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e4d7020..bb728bdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ testing = [ "pytest-mpl>=0.12", "pgtest", "pytest-regressions>=1.0", - "aiida-test-cache @ git+https://github.com/aiidateam/aiida-testing.git@backport-2.6-support", + "aiida-test-cache==0.0.1", ] pre-commit = [ "pre-commit>=2.6.0", From c44d663756f7424a2662e38433fe8a0d2f964351 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:27:55 +0100 Subject: [PATCH 5/8] Bump sphinx --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bb728bdd..d858e67e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ graphs = [ "masci-tools[bokeh-plots]" ] docs = [ - "sphinx~=4.0", + "sphinx~=5.0", "sphinx_rtd_theme", "sphinx-click", "myst-parser~=0.15.2" From 665cc6223ce67e7e721a0d8aea5c2842646ea023 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:34:50 +0100 Subject: [PATCH 6/8] Bump myst-parser --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d858e67e..ffaa7655 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ docs = [ "sphinx~=5.0", "sphinx_rtd_theme", "sphinx-click", - "myst-parser~=0.15.2" + "myst-parser==0.18.1" ] testing = [ "pytest>=2.9", From b90a4d36298765b5ca63174b919a52143b485948 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:39:21 +0100 Subject: [PATCH 7/8] revert aiida-core version change --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 208a11da..ad115522 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: allowed-to-fail: [false] include: - python-version: "3.11" - aiida: {version: 'aiida-core==2.6.3', name: '2.6'} + aiida: {version: 'aiida-core==2.3.0', name: '2.3.0'} masci-tools: {version: 'masci-tools', name: 'stable'} bokeh-version: 'bokeh==3.0.3' mpl-version: 'matplotlib==3.6.3' From cd1a47f7aac8b430f750ee56571b051a9746d0f2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 19 May 2025 20:44:58 +0100 Subject: [PATCH 8/8] Bump python version for pre-commit --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad115522..fe349ceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,10 +51,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 cache: pip - name: Install python dependencies