diff --git a/.github/workflows/ci_check_pyproject_dependencies.yml b/.github/workflows/ci_check_pyproject_dependencies.yml index cd0de4d6..df702ec5 100644 --- a/.github/workflows/ci_check_pyproject_dependencies.yml +++ b/.github/workflows/ci_check_pyproject_dependencies.yml @@ -228,7 +228,7 @@ jobs: - name: Create PR if: env.UPDATE_DEPS == 'true' id: cpr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} committer: "${{ inputs.git_username }} <${{ inputs.git_email }}>" diff --git a/.github/workflows/ci_update_dependencies.yml b/.github/workflows/ci_update_dependencies.yml index c0a60190..42979346 100644 --- a/.github/workflows/ci_update_dependencies.yml +++ b/.github/workflows/ci_update_dependencies.yml @@ -153,7 +153,7 @@ jobs: - name: Create PR id: cpr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} committer: "${{ inputs.git_username }} <${{ inputs.git_email }}>" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a71806bf..520916b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: # Black is a code style and formatter # It works on files in-place - repo: https://github.com/ambv/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black @@ -42,7 +42,7 @@ repos: # More information can be found in its documentation: # https://docs.astral.sh/ruff/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.13 + rev: v0.1.15 hooks: - id: ruff # Fix what can be fixed in-place and exit with non-zero status if files were @@ -57,7 +57,7 @@ repos: # More information can be found in its documentation: # https://bandit.readthedocs.io/en/latest/ - repo: https://github.com/PyCQA/bandit - rev: 1.7.6 + rev: 1.7.7 hooks: - id: bandit args: ["-r"] @@ -74,7 +74,7 @@ repos: - id: mypy - repo: https://github.com/SINTEF/ci-cd - rev: v2.7.1 + rev: v2.7.2 hooks: - id: docs-api-reference args: diff --git a/ci_cd/__init__.py b/ci_cd/__init__.py index 2cd8c85d..f14045f9 100644 --- a/ci_cd/__init__.py +++ b/ci_cd/__init__.py @@ -1,4 +1,5 @@ """CI/CD Tools. Tiny package to run invoke tasks as a standalone program.""" + from __future__ import annotations import logging diff --git a/ci_cd/exceptions.py b/ci_cd/exceptions.py index ae1ac9f0..fd7face5 100644 --- a/ci_cd/exceptions.py +++ b/ci_cd/exceptions.py @@ -1,4 +1,5 @@ """CI/CD-specific exceptions.""" + from __future__ import annotations diff --git a/ci_cd/main.py b/ci_cd/main.py index ea224be9..15707f05 100644 --- a/ci_cd/main.py +++ b/ci_cd/main.py @@ -3,6 +3,7 @@ See [invoke documentation](https://docs.pyinvoke.org/en/stable/concepts/library.html) for more information. """ + from __future__ import annotations from invoke import Collection, Program diff --git a/ci_cd/tasks/__init__.py b/ci_cd/tasks/__init__.py index 53b22d52..5a95fe11 100644 --- a/ci_cd/tasks/__init__.py +++ b/ci_cd/tasks/__init__.py @@ -3,6 +3,7 @@ Repository management tasks powered by `invoke`. More information on `invoke` can be found at [pyinvoke.org](http://www.pyinvoke.org/). """ + from __future__ import annotations from .api_reference_docs import create_api_reference_docs diff --git a/ci_cd/tasks/api_reference_docs.py b/ci_cd/tasks/api_reference_docs.py index 6d96a10e..d8aaea84 100644 --- a/ci_cd/tasks/api_reference_docs.py +++ b/ci_cd/tasks/api_reference_docs.py @@ -3,6 +3,7 @@ Create Python API reference in the documentation. This is specifically to be used with the MkDocs and mkdocstrings framework. """ + from __future__ import annotations import logging diff --git a/ci_cd/tasks/docs_index.py b/ci_cd/tasks/docs_index.py index 5f2a208c..c62de195 100644 --- a/ci_cd/tasks/docs_index.py +++ b/ci_cd/tasks/docs_index.py @@ -2,6 +2,7 @@ Create the documentation index (home) page from `README.md`. """ + from __future__ import annotations import re diff --git a/ci_cd/tasks/setver.py b/ci_cd/tasks/setver.py index 642a7373..03f663b1 100644 --- a/ci_cd/tasks/setver.py +++ b/ci_cd/tasks/setver.py @@ -2,6 +2,7 @@ Set the specified version. """ + from __future__ import annotations import logging diff --git a/ci_cd/tasks/update_deps.py b/ci_cd/tasks/update_deps.py index c30ad4f2..7d5459b4 100644 --- a/ci_cd/tasks/update_deps.py +++ b/ci_cd/tasks/update_deps.py @@ -2,6 +2,7 @@ Update dependencies in a `pyproject.toml` file. """ + from __future__ import annotations import logging diff --git a/ci_cd/utils/__init__.py b/ci_cd/utils/__init__.py index ea2fd125..06afdef8 100644 --- a/ci_cd/utils/__init__.py +++ b/ci_cd/utils/__init__.py @@ -1,4 +1,5 @@ """Utilities for CI/CD.""" + from __future__ import annotations from .console_printing import Emoji, error_msg, info_msg, warning_msg diff --git a/ci_cd/utils/console_printing.py b/ci_cd/utils/console_printing.py index f2e97f8c..0e992e1e 100644 --- a/ci_cd/utils/console_printing.py +++ b/ci_cd/utils/console_printing.py @@ -1,4 +1,5 @@ """Relevant tools for printing to the console.""" + from __future__ import annotations import platform diff --git a/ci_cd/utils/file_io.py b/ci_cd/utils/file_io.py index 3b083ae3..0bfc55cd 100644 --- a/ci_cd/utils/file_io.py +++ b/ci_cd/utils/file_io.py @@ -1,4 +1,5 @@ """Utilities for handling IO operations.""" + from __future__ import annotations import re diff --git a/ci_cd/utils/versions.py b/ci_cd/utils/versions.py index f9ac7d87..07bd21e5 100644 --- a/ci_cd/utils/versions.py +++ b/ci_cd/utils/versions.py @@ -1,4 +1,5 @@ """Handle versions.""" + from __future__ import annotations import logging diff --git a/tests/conftest.py b/tests/conftest.py index 0013ea1c..ee988afc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Test fixtures.""" + from __future__ import annotations import pytest diff --git a/tests/tasks/test_api_reference_docs.py b/tests/tasks/test_api_reference_docs.py index bcd3193b..a0fb5466 100644 --- a/tests/tasks/test_api_reference_docs.py +++ b/tests/tasks/test_api_reference_docs.py @@ -1,4 +1,5 @@ """Test `ci_cd.tasks.api_reference_docs`.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/tests/tasks/test_update_deps.py b/tests/tasks/test_update_deps.py index d4c36862..be38eab3 100644 --- a/tests/tasks/test_update_deps.py +++ b/tests/tasks/test_update_deps.py @@ -1,4 +1,5 @@ """Test `ci_cd.tasks.update_deps()`.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/tests/utils/test_versions.py b/tests/utils/test_versions.py index 201642bb..5cd3529a 100644 --- a/tests/utils/test_versions.py +++ b/tests/utils/test_versions.py @@ -1,4 +1,5 @@ """Tests for utils/versions.py""" + from __future__ import annotations from typing import TYPE_CHECKING @@ -140,8 +141,10 @@ def test_semanticversion_invalid() -> None: ] for input_, exc_msg in invalid_inputs: with pytest.raises(ValueError, match=exc_msg): - SemanticVersion(**input_) if isinstance(input_, dict) else SemanticVersion( - input_ + ( + SemanticVersion(**input_) + if isinstance(input_, dict) + else SemanticVersion(input_) ) @@ -826,13 +829,13 @@ def _parametrize_ignore_version() -> ( f"semver-{test_case[3]['version-update']}-latest={test_case[1]}" ] = test_case elif test_case[2]: - res[ - ",".join(f"{_['operator']}{_['version']}" for _ in test_case[2]) - ] = test_case + res[",".join(f"{_['operator']}{_['version']}" for _ in test_case[2])] = ( + test_case + ) elif test_case[3]: - res[ - f"semver-{test_case[3]['version-update']}-latest={test_case[1]}" - ] = test_case + res[f"semver-{test_case[3]['version-update']}-latest={test_case[1]}"] = ( + test_case + ) else: res["no rules"] = test_case assert len(res) == len(test_cases)