diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 979e134d..f2683926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,11 @@ on: type: string # renovate: datasource=pypi depName=ruff versioning=pep440 default: "0.4.5" + mypy-check-files: + required: false + description: extra files to check with mypy + type: string + default: "" secrets: PYPI_API_TOKEN: required: true @@ -94,6 +99,8 @@ jobs: - name: Install root run: poetry run pip install -e . --no-deps - run: poetry run mypy + - if: ${{ inputs.mypy-check-files }} + run: poetry run mypy ${{ inputs.mypy-check-files }} check_version: name: Tag version bump diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd805e00..d820073a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,3 +19,4 @@ jobs: secrets: inherit with: lint: true + mypy-check-files: tests diff --git a/ampel/base/AmpelUnit.py b/ampel/base/AmpelUnit.py index c6b96954..d1c32edd 100644 --- a/ampel/base/AmpelUnit.py +++ b/ampel/base/AmpelUnit.py @@ -233,6 +233,7 @@ def dict( exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + warnings: bool = True, ) -> dict[str, Any]: if hasattr(self, "__slots__"): diff --git a/pyproject.toml b/pyproject.toml index fadfbe41..fc5c7740 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ampel-interface" -version = "0.10.1" +version = "0.10.1.post0" description = "Base classes for the Ampel analysis platform" authors = ["Valery Brinnel"] maintainers = ["Jakob van Santen "] diff --git a/tests/test_AmpelUnit.py b/tests/test_AmpelUnit.py index 5492ee0c..04d01d08 100644 --- a/tests/test_AmpelUnit.py +++ b/tests/test_AmpelUnit.py @@ -29,7 +29,8 @@ def __init__(self, **kwargs): class Derived1(PrivateMixin, U, M): ... - class Derived2(PrivateMixin, M, U): ... + # ignore: Definition of "dict" in base class "BaseModel" is incompatible with definition in base class "AmpelUnit" + class Derived2(PrivateMixin, M, U): ... # type: ignore[misc] kwargs = {"unit_param": 1, "basemodel_param": 2} defaults = {"unit_param_with_default": 3, "basemodel_param_with_default": 2} diff --git a/tests/test_AmpelVault.py b/tests/test_AmpelVault.py index 75beaf1a..9d294458 100644 --- a/tests/test_AmpelVault.py +++ b/tests/test_AmpelVault.py @@ -48,7 +48,7 @@ def test_secret_resolution() -> None: def test_value_set(): - secret = NamedSecret(label="foo") + secret = NamedSecret[int](label="foo") with pytest.raises(ValueError, match="Secret not yet resolved"): secret.get() secret.set(1)