From fa395eaa835b2726f517eddb7aedf294807904e4 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 12:18:34 +0000 Subject: [PATCH 01/29] Drop support for AiiDA v1 and Python 3.7 --- .github/workflows/ci.yml | 30 +++++++++++------------------- pyproject.toml | 7 +++---- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 203fd28..1d5b7fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,8 @@ jobs: timeout-minutes: 30 strategy: matrix: - python-version: ['3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11', '3.12'] editable_install_option: ['-e', ''] - include: - #Test for aiida-core 1.X (since aiida-core 2.X does not support python 3.7) - - python-version: '3.7' - editable_install_option: '-e' fail-fast: false services: @@ -37,9 +33,9 @@ jobs: - 5672:5672 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -47,7 +43,6 @@ jobs: run: | pip install --upgrade pip pip install ${{ matrix.editable_install_option }} .[testing] - reentry scan -r aiida || true - name: Run test suite env: @@ -61,16 +56,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.11 - name: Install python dependencies run: | pip install --upgrade pip pip install -e .[docs] - reentry scan -r aiida || true - name: Build docs run: cd docs && make @@ -78,17 +72,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install python dependencies run: | pip install --upgrade pip pip install -e .[pre_commit] - reentry scan -r aiida || true - name: Run pre-commit run: | - pre-commit install pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) diff --git a/pyproject.toml b/pyproject.toml index 69369c2..2564a76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ "Environment :: Plugins", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -38,10 +37,10 @@ keywords = [ "cache", ] urls = {Homepage = "https://aiida-testing.readthedocs.io/"} -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ - "aiida-core>=1.0.0,<3.0.0", - "pytest>=3.6", + "aiida-core>=2.0.0,<3.0.0", + "pytest>=7.0", "voluptuous~=0.12", ] From 72bfacaf254988e18dcebb37782ae928190f3ff1 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 14:07:33 +0000 Subject: [PATCH 02/29] Use uv --- .ci/install_aiida_github.sh | 6 ------ .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 16 deletions(-) delete mode 100755 .ci/install_aiida_github.sh diff --git a/.ci/install_aiida_github.sh b/.ci/install_aiida_github.sh deleted file mode 100755 index 397bbe4..0000000 --- a/.ci/install_aiida_github.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -git clone https://github.com/aiidateam/aiida_core ../aiida_core -cd ../aiida_core -git checkout $AIIDA_DEVELOP_GIT_HASH -pip install -e .[docs,pre_commit,testing] -cd ${TRAVIS_BUILD_DIR} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d5b7fd..be9934b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: ci on: [push, pull_request] +env: + UV_VER: "0.5.2" jobs: @@ -39,6 +41,13 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Set up uv + uses: astral-sh/setup-uv@v3 + with: + version: ${UV_VER} + - name: Install package + run: uv pip install --system ${{ matrix.editable_install_option }} .[testing] + - name: Install python dependencies run: | pip install --upgrade pip @@ -61,10 +70,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.11 - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install -e .[docs] + + - name: Set up uv + uses: astral-sh/setup-uv@v3 + with: + version: ${UV_VER} + - name: Install package + run: uv pip install --system -e .[docs] + - name: Build docs run: cd docs && make @@ -73,14 +86,19 @@ jobs: timeout-minutes: 15 steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.11 - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install -e .[pre_commit] + + - name: Set up uv + uses: astral-sh/setup-uv@v3 + with: + version: ${UV_VER} + + - name: Install package + run: uv pip install --system -e .[dev] + - name: Run pre-commit - run: | - pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + uses: pre-commit/action@v3.0.1 From 607d4a9747f02ad3b5a9bc43d067feeaecae7003 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 14:10:12 +0000 Subject: [PATCH 03/29] Run editable install only for one version --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be9934b..abdd662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,12 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - editable_install_option: ['-e', ''] + editable_install_option: [''] + include: + # Test editable install + - python-version: '3.8' + editable_install_option: '-e' + fail-fast: false services: From de1002dfc5797576608b5274233e2c88f40be490 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 14:15:50 +0000 Subject: [PATCH 04/29] Update developer guide --- docs/source/developer_guide/index.rst | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/source/developer_guide/index.rst b/docs/source/developer_guide/index.rst index 4f70c2e..c7314a4 100644 --- a/docs/source/developer_guide/index.rst +++ b/docs/source/developer_guide/index.rst @@ -34,8 +34,7 @@ Enable enable automatic checks of code sanity and coding style:: pre-commit install After this, the `yapf `_ formatter, -the `pylint `_ linter, the -`prospector `_ code analyzer, and +the `pylint `_ linter, and the `mypy `_ static type checker will run at every commit. @@ -71,17 +70,3 @@ Of course, you can also build the documentation locally:: pip install -e .[docs] cd docs make - -PyPI release -++++++++++++ - -The process for creating a distribution and uploading it to PyPI is:: - - pip install twine - python setup.py sdist - twine upload dist/* - -This can only be done by people who are registered as ``aiida-testing`` -maintainers on PyPI. After this, you (and everyone else) should be able to:: - - pip install aiida-testing From 6e533cbc992ff93a920bc7adaf214a3fa1ab8056 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 17:47:11 +0000 Subject: [PATCH 05/29] env.UV_VER --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abdd662..7c6e80d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@v3 with: - version: ${UV_VER} + version: ${{ env.UV_VER }} - name: Install package run: uv pip install --system ${{ matrix.editable_install_option }} .[testing] @@ -79,7 +79,7 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@v3 with: - version: ${UV_VER} + version: ${{ env.UV_VER }} - name: Install package run: uv pip install --system -e .[docs] @@ -100,7 +100,7 @@ jobs: - name: Set up uv uses: astral-sh/setup-uv@v3 with: - version: ${UV_VER} + version: ${{ env.UV_VER }} - name: Install package run: uv pip install --system -e .[dev] From ea840a587d2b902448d89cfe95da59998ca14add Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 20:15:07 +0000 Subject: [PATCH 06/29] Ignore metadata inputs --- .aiida-testing-config.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.aiida-testing-config.yml b/.aiida-testing-config.yml index 0370b81..8510deb 100644 --- a/.aiida-testing-config.yml +++ b/.aiida-testing-config.yml @@ -4,9 +4,10 @@ mock_code: archive_cache: ignore: calcjob_attributes: - #These attributes have to be ignored to be able to run the export cache tests - #while reusing the same test archive, migrating it to the needed version, - #since they are only present in newer versions - #The test archives have version 0.8 - - environment_variables_double_quotes #This option was introduced in aiida-core 2.0 - - submit_script_filename #This option was introduced in aiida-core 1.2.1 (archive version 0.9) + # These attributes have to be ignored to be able to run the export cache tests + # while reusing the same test archive, migrating it to the needed version, + # since they are only present in newer versions + # The test archives have version 0.8 + - environment_variables_double_quotes # This option was introduced in aiida-core 2.0 + - submit_script_filename # This option was introduced in aiida-core 1.2.1 (archive version 0.9) + - metadata_inputs # Added in aiida-core 2.3.0 From e1ac99379d52d8dc3bac37fcde2decdead6e5433 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 20:35:49 +0000 Subject: [PATCH 07/29] Downgrade python versions in CI --- .github/workflows/ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c6e80d..bdb1410 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,11 +53,6 @@ jobs: - name: Install package run: uv pip install --system ${{ matrix.editable_install_option }} .[testing] - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install ${{ matrix.editable_install_option }} .[testing] - - name: Run test suite env: # show timings of tests @@ -74,7 +69,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.7 - name: Set up uv uses: astral-sh/setup-uv@v3 @@ -95,7 +90,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.10 - name: Set up uv uses: astral-sh/setup-uv@v3 From b33d7a92bd1c6a341756182ab3d95b2aa1a3d00f Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 20:41:07 +0000 Subject: [PATCH 08/29] Bring back py3.7 --- .github/workflows/ci.yml | 5 +++-- pyproject.toml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdb1410..2a9db17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: ci on: [push, pull_request] env: UV_VER: "0.5.2" + FORCE_COLOR: 1 jobs: @@ -69,7 +70,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: '3.7' - name: Set up uv uses: astral-sh/setup-uv@v3 @@ -90,7 +91,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10 + python-version: '3.10' - name: Set up uv uses: astral-sh/setup-uv@v3 diff --git a/pyproject.toml b/pyproject.toml index 2564a76..9cbe480 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Environment :: Plugins", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -37,7 +38,7 @@ keywords = [ "cache", ] urls = {Homepage = "https://aiida-testing.readthedocs.io/"} -requires-python = ">=3.8" +requires-python = ">=3.7" dependencies = [ "aiida-core>=2.0.0,<3.0.0", "pytest>=7.0", From 2e49092b5302021aee06e7dd862a232e3f5b25c2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 20:52:17 +0000 Subject: [PATCH 09/29] recursive extras, setuptools dependency --- pyproject.toml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9cbe480..b0c6412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ keywords = [ ] urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" +# Note the dependency on setuptools due to pkg_resources dependencies = [ "aiida-core>=2.0.0,<3.0.0", "pytest>=7.0", @@ -61,14 +62,7 @@ pre_commit = [ "types-PyYAML", ] dev = [ - "sphinx", - "sphinx-rtd-theme", - "pgtest~=1.3.1", - "aiida-diff", - "pytest-datadir", - "pre-commit", - "pylint~=2.12.2", - "mypy==0.930", + 'aiida-testing[testing,pre_commit,docs]', ] [project.scripts] From b3eba93e8113e1fc09dac07c00159e26af2aebd9 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:02:06 +0000 Subject: [PATCH 10/29] Upgrade mypy, docs with py38 --- .github/workflows/ci.yml | 2 +- aiida_testing/_config.py | 2 +- aiida_testing/archive_cache/_utils.py | 10 ++++++---- pyproject.toml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a9db17..c62ef5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.7' + python-version: '3.8' - name: Set up uv uses: astral-sh/setup-uv@v3 diff --git a/aiida_testing/_config.py b/aiida_testing/_config.py index f3d63a1..d54b11d 100644 --- a/aiida_testing/_config.py +++ b/aiida_testing/_config.py @@ -48,7 +48,7 @@ def validate(self): return self.schema(self._dict) @classmethod - def from_file(cls): + def from_file(cls) -> 'Config': """ Parses the configuration file ``.aiida-testing-config.yml``. diff --git a/aiida_testing/archive_cache/_utils.py b/aiida_testing/archive_cache/_utils.py index 78c6c3b..fc55367 100644 --- a/aiida_testing/archive_cache/_utils.py +++ b/aiida_testing/archive_cache/_utils.py @@ -115,9 +115,11 @@ def import_with_migrate( raise except ImportError: - from aiida.tools.importexport import export as create_archive #type: ignore[import,no-redef] - from aiida.tools.importexport import import_data as import_archive #type: ignore[no-redef] - import_archive = partial(import_archive, extras_mode_existing='ncu', extras_mode_new='import') + from aiida.tools.importexport import export as create_archive # type: ignore[import-not-found,no-redef] + from aiida.tools.importexport import import_data as import_archive # type: ignore[no-redef] + import_archive = partial( + import_archive, extras_mode_existing='ncu', extras_mode_new='import' + ) # type: ignore[call-arg] def import_with_migrate( archive_path: ty.Union[str, pathlib.Path], @@ -133,7 +135,7 @@ def import_with_migrate( from aiida.tools.importexport import EXPORT_VERSION, IncompatibleArchiveVersionError # these are only availbale after aiida >= 1.5.0, maybe rely on verdi import instead from aiida.tools.importexport import detect_archive_type - from aiida.tools.importexport.archive.migrators import get_migrator #type: ignore[import] + from aiida.tools.importexport.archive.migrators import get_migrator # type: ignore[import-not-found] try: import_archive(archive_path, *args, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index b0c6412..7ea96d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ testing = [ pre_commit = [ "pre-commit", "pylint~=2.12.2", - "mypy==0.930", + "mypy==1.13", "types-setuptools==65.7.0.3", "types-PyYAML", ] From 2a15acb0b50eabfd4834ef9003fd6f90353fd949 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:09:26 +0000 Subject: [PATCH 11/29] Pin aiida-core <2.4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7ea96d3..2a4d5b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=2.0.0,<3.0.0", + "aiida-core>=2.0.0,<2.4", "pytest>=7.0", "voluptuous~=0.12", ] From a238f23f19a85209804824301b15554d524969f0 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:21:51 +0000 Subject: [PATCH 12/29] Fix doc build --- docs/source/conf.py | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 70e8e5b..543f74d 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Sphinx configuration for aiida-testing # # This file is execfile()d with the current directory set to its @@ -37,7 +35,6 @@ with contextlib.suppress(ImportError): import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # -- General configuration ------------------------------------------------ @@ -56,7 +53,7 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), - 'aiida': ('http://aiida-core.readthedocs.io/en/v1.6.8/', None), + 'aiida': ('https://aiida.readthedocs.io/projects/aiida-core/en/stable/', None), 'pytest': ('https://docs.pytest.org/en/latest/', None) } @@ -66,24 +63,18 @@ # The suffix of source filenames. source_suffix = '.rst' -# The encoding of source files. -#source_encoding = 'utf-8-sig' - # The master toctree document. -#~ master_doc = 'index' master_doc = 'index' # General information about the project. -project = u'aiida-testing' +project = 'aiida-testing' copyright_first_year = "2019" copyright_owners = "The AiiDA Team" current_year = str(time.localtime().tm_year) -copyright_year_string = current_year if current_year == copyright_first_year else "{}-{}".format( - copyright_first_year, current_year -) +copyright_year_string = current_year if current_year == copyright_first_year else f"{copyright_first_year}-{current_year}" # pylint: disable=redefined-builtin -copyright = u'{}, {}. All rights reserved'.format(copyright_year_string, copyright_owners) +copyright = f'{copyright_year_string}, {copyright_owners}. All rights reserved' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -146,9 +137,7 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = { - 'display_version': True, -} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #~ html_theme_path = ["."] @@ -221,9 +210,6 @@ #html_file_suffix = None # Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' html_search_language = 'en' # A dictionary with options for the search language support, empty by default. @@ -292,11 +278,6 @@ def run_apidoc(_): apidoc_dir = os.path.join(source_dir, 'apidoc') package_dir = os.path.join(source_dir, os.pardir, os.pardir, 'aiida_testing') - # In #1139, they suggest the route below, but this ended up - # calling sphinx-build, not sphinx-apidoc - #from sphinx.apidoc import main - #main([None, '-e', '-o', apidoc_dir, package_dir, '--force']) - import subprocess cmd_path = 'sphinx-apidoc' if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv From f246f044a02af19094bbaed8ae87c28d262c3659 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:40:07 +0000 Subject: [PATCH 13/29] Update pylint --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2a4d5b8..77ad2be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,9 +41,10 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=2.0.0,<2.4", + "aiida-core>=2.0.0,<3", "pytest>=7.0", "voluptuous~=0.12", + "setuptools", ] [project.optional-dependencies] @@ -56,7 +57,7 @@ testing = [ ] pre_commit = [ "pre-commit", - "pylint~=2.12.2", + "pylint~=3.3.1", "mypy==1.13", "types-setuptools==65.7.0.3", "types-PyYAML", From 121d62cd3402ab0bb8ec191c3037078142db9b64 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:40:49 +0000 Subject: [PATCH 14/29] Run precommit with py3.11 --- .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 c62ef5e..8509884 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Set up uv uses: astral-sh/setup-uv@v3 From 4a547d5625445f8d96c2e55d27ca95f496ebdcb5 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:46:06 +0000 Subject: [PATCH 15/29] Try running pre-commit with py3.12 --- .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 8509884..24aaa91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Set up uv uses: astral-sh/setup-uv@v3 From 28597ac3517dbe20092adaf9d257f06923764aac Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:46:12 +0000 Subject: [PATCH 16/29] Fix new pylint violations --- aiida_testing/_config.py | 2 +- aiida_testing/mock_code/_fixtures.py | 2 +- aiida_testing/mock_code/_hasher.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aiida_testing/_config.py b/aiida_testing/_config.py index d54b11d..50f1564 100644 --- a/aiida_testing/_config.py +++ b/aiida_testing/_config.py @@ -58,7 +58,7 @@ def from_file(cls) -> 'Config': cwd = pathlib.Path().cwd() config: ty.Dict[str, str] for dir_path in [cwd, *cwd.parents]: - config_file_path = (dir_path / CONFIG_FILE_NAME) + config_file_path = dir_path / CONFIG_FILE_NAME if config_file_path.exists(): with open(config_file_path, encoding='utf8') as config_file: config = yaml.load(config_file, Loader=yaml.SafeLoader) diff --git a/aiida_testing/mock_code/_fixtures.py b/aiida_testing/mock_code/_fixtures.py index c5da6d4..8e5fe4e 100644 --- a/aiida_testing/mock_code/_fixtures.py +++ b/aiida_testing/mock_code/_fixtures.py @@ -121,7 +121,7 @@ def mock_code_factory( aiida_localhost, testing_config, testing_config_action, mock_regenerate_test_data, mock_fail_on_missing, mock_disable_mpi, monkeypatch, request: pytest.FixtureRequest, tmp_path: pathlib.Path -): # pylint: disable=too-many-arguments,redefined-outer-name,unused-argument,too-many-statements +): # pylint: disable=all """ Fixture to create a mock AiiDA Code. diff --git a/aiida_testing/mock_code/_hasher.py b/aiida_testing/mock_code/_hasher.py index fa7893e..b20e528 100644 --- a/aiida_testing/mock_code/_hasher.py +++ b/aiida_testing/mock_code/_hasher.py @@ -44,7 +44,7 @@ def __call__(self, cwd: Path) -> str: return md5sum.hexdigest() - def modify_content(self, path: Path, content: bytes) -> ty.Optional[bytes]: # pylint: disable=no-self-use,unused-argument + def modify_content(self, path: Path, content: bytes) -> ty.Optional[bytes]: # pylint: disable=unused-argument """A sub-class hook to modify the contents of the file, before hashing. If None is returned, the file is ignored, when generating the hash. From fc63c25906b61c37f3160933676fcc930d8fbdfe Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:48:32 +0000 Subject: [PATCH 17/29] Run doc build with py3.12 --- .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 24aaa91..a002be5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.12' - name: Set up uv uses: astral-sh/setup-uv@v3 From 06f431ccfe118344ea6d3e674edcd386e8df64ad Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 22:15:17 +0000 Subject: [PATCH 18/29] Pylint fix --- tests/archive_cache/test_archive_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/archive_cache/test_archive_cache.py b/tests/archive_cache/test_archive_cache.py index a1ce7a7..dc0da31 100644 --- a/tests/archive_cache/test_archive_cache.py +++ b/tests/archive_cache/test_archive_cache.py @@ -153,7 +153,7 @@ def test_mock_hash_codes(mock_code_factory, clear_database, liberal_hash): def test_enable_archive_cache( archive_path, aiida_local_code_factory, generate_diff_inputs, enable_archive_cache, clear_database, check_diff_workchain -): +): # pylint: disable=too-many-positional-arguments """ Basic test of the enable_archive_cache fixture """ @@ -171,7 +171,7 @@ def test_enable_archive_cache( def test_enable_archive_cache_non_existent( aiida_local_code_factory, generate_diff_inputs, enable_archive_cache, clear_database, tmp_path_factory, check_diff_workchain -): +): # pylint: disable=too-many-positional-arguments """ Test of the enable_archive_cache fixture that creation of the archive and overwriting of the archive works correctly From e56a8e1fea5c8793d0c96de2f0936b2934b8bcbe Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 22:19:24 +0000 Subject: [PATCH 19/29] Remove load_documentation_profile, not needed by aiida 2.0 --- docs/source/conf.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 543f74d..c00572c 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,12 +14,7 @@ import time import contextlib -from aiida.manage.configuration import load_documentation_profile - import aiida_testing - -load_documentation_profile() - # -- AiiDA-related setup -------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, From 3972248a3c95e9186e3f36ea06e24c783af523b0 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 22:50:45 +0000 Subject: [PATCH 20/29] Bump minimum python version to 3.8 --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 77ad2be..f493d54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,10 +22,11 @@ classifiers = [ "Environment :: Plugins", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Physics", "Framework :: AiiDA", "Framework :: Pytest", @@ -38,7 +39,7 @@ keywords = [ "cache", ] urls = {Homepage = "https://aiida-testing.readthedocs.io/"} -requires-python = ">=3.7" +requires-python = ">=3.8" # Note the dependency on setuptools due to pkg_resources dependencies = [ "aiida-core>=2.0.0,<3", From 3bc2218301bb0b94494e3b7a2d0babab99627696 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:13:31 +0000 Subject: [PATCH 21/29] Temporarily pin aiida version <2.6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f493d54..e339698 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.8" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=2.0.0,<3", + "aiida-core>=2.0.0,<2.6", "pytest>=7.0", "voluptuous~=0.12", "setuptools", From 2294fb0ae1ea3c50ed484e71e8da612528180286 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:25:28 +0000 Subject: [PATCH 22/29] Don't install editably --- .github/workflows/ci.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a002be5..5f27b53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: CI on: [push, pull_request] env: @@ -12,13 +12,7 @@ jobs: timeout-minutes: 30 strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] - editable_install_option: [''] - include: - # Test editable install - - python-version: '3.8' - editable_install_option: '-e' - + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] fail-fast: false services: @@ -52,7 +46,7 @@ jobs: with: version: ${{ env.UV_VER }} - name: Install package - run: uv pip install --system ${{ matrix.editable_install_option }} .[testing] + run: uv pip install --system .[testing] - name: Run test suite env: From af63363d2e6da0f76f2d63ef1f04793f8ab2787e Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:40:22 +0000 Subject: [PATCH 23/29] Undeprecate stuff --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e339698..640a724 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Environment :: Plugins", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -39,10 +40,10 @@ keywords = [ "cache", ] urls = {Homepage = "https://aiida-testing.readthedocs.io/"} -requires-python = ">=3.8" +requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=2.0.0,<2.6", + "aiida-core>=1.0.0,<2.6", "pytest>=7.0", "voluptuous~=0.12", "setuptools", From 39f6ce7d313f4021c8bee7806116eee2d94e763e Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:42:32 +0000 Subject: [PATCH 24/29] Test with python 3.7 --- .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 5f27b53..efbce37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 30 strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] fail-fast: false services: From 3584ff6cdd9d28eae686cade09dff2bce78a5bcd Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:48:01 +0000 Subject: [PATCH 25/29] Just pre-commit --- .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 efbce37..5c387bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: version: ${{ env.UV_VER }} - name: Install package - run: uv pip install --system -e .[dev] + run: uv pip install --system -e .[pre_commit] - name: Run pre-commit uses: pre-commit/action@v3.0.1 From 4c1e2b3e071c18b597167b0b461b650f2b5ccf14 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:49:42 +0000 Subject: [PATCH 26/29] Reentry scan --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c387bb..1f9ffe5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,9 @@ jobs: with: version: ${{ env.UV_VER }} - name: Install package - run: uv pip install --system .[testing] + run: | + uv pip install --system -e .[testing] + reentry scan -r aiida || true - name: Run test suite env: From f1a30d6029dce5c6ec0a6a3132405bf5f793b264 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:53:24 +0000 Subject: [PATCH 27/29] Try 2.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 640a724..86182fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=1.0.0,<2.6", + "aiida-core>=1.0.0,<2.1", "pytest>=7.0", "voluptuous~=0.12", "setuptools", From 7d00ebb8a29a2d60652eec403a11e38204dbb427 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:56:43 +0000 Subject: [PATCH 28/29] Try 2.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 86182fa..d0f0cdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=1.0.0,<2.1", + "aiida-core>=1.0.0,<2.2", "pytest>=7.0", "voluptuous~=0.12", "setuptools", From a0fff707052f1a3e71b567af169f5f3bfe0f2410 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 23:59:34 +0000 Subject: [PATCH 29/29] Try 2.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d0f0cdd..dc1dd04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"} requires-python = ">=3.7" # Note the dependency on setuptools due to pkg_resources dependencies = [ - "aiida-core>=1.0.0,<2.2", + "aiida-core>=1.0.0,<2.3", "pytest>=7.0", "voluptuous~=0.12", "setuptools",