From b3eba93e8113e1fc09dac07c00159e26af2aebd9 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 17 Nov 2024 21:02:06 +0000 Subject: [PATCH] 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", ]