diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75bc338b..6b153cb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ jobs: package: - "hooks/openfeature-hooks-opentelemetry" - "providers/openfeature-provider-flagd" + - "providers/openfeature-provider-ofrep" steps: - uses: actions/checkout@v4 @@ -49,8 +50,7 @@ jobs: working-directory: ${{ matrix.package }} - name: Type checking - # TODO: migrate other packages to use their own 'mypy' setup - if: matrix.python-version == '3.11' && matrix.package == 'providers/openfeature-provider-flagd' + if: matrix.python-version == '3.11' working-directory: ${{ matrix.package }} run: hatch run mypy:run diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f8a6a85..9b08fdba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,19 +14,3 @@ repos: - id: check-yaml - id: trailing-whitespace - id: check-merge-conflict - - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 - hooks: - - id: mypy - args: [--python-version=3.8] - additional_dependencies: - - openfeature-sdk>=0.4.0 - - opentelemetry-api - - types-protobuf - - types-PyYAML - - types-requests - - mmh3 - - semver - - panzi-json-logic - exclude: providers/openfeature-provider-flagd|tests diff --git a/hooks/openfeature-hooks-opentelemetry/pyproject.toml b/hooks/openfeature-hooks-opentelemetry/pyproject.toml index 0c585f3c..b826dfeb 100644 --- a/hooks/openfeature-hooks-opentelemetry/pyproject.toml +++ b/hooks/openfeature-hooks-opentelemetry/pyproject.toml @@ -50,6 +50,14 @@ cov = [ "cov-report", ] +[tool.hatch.envs.mypy] +dependencies = [ + "mypy[faster-cache]>=1.13.0", +] + +[tool.hatch.envs.mypy.scripts] +run = "mypy" + [tool.hatch.build.targets.sdist] exclude = [ ".gitignore", @@ -57,3 +65,16 @@ exclude = [ [tool.hatch.build.targets.wheel] packages = ["src/openfeature"] + +[tool.mypy] +mypy_path = "src" +files = "src" + +python_version = "3.8" # should be identical to the minimum supported version +namespace_packages = true +explicit_package_bases = true +local_partial_types = true +pretty = true + +strict = true +disallow_any_generics = false diff --git a/providers/openfeature-provider-ofrep/pyproject.toml b/providers/openfeature-provider-ofrep/pyproject.toml index 693ec7bf..30a174da 100644 --- a/providers/openfeature-provider-ofrep/pyproject.toml +++ b/providers/openfeature-provider-ofrep/pyproject.toml @@ -27,26 +27,36 @@ Homepage = "https://github.com/open-feature/python-sdk-contrib" [tool.hatch] -[tool.hatch.envs.default] +[tool.hatch.envs.hatch-test] dependencies = [ "coverage[toml]>=6.5", "pytest", "requests-mock", - "types-requests", ] -[tool.hatch.envs.default.scripts] -test = "pytest {args:tests}" -test-cov = "coverage run -m pytest {args:tests}" +[tool.hatch.envs.hatch-test.scripts] +run = "pytest {args:tests}" +run-cov = "coverage run -m pytest {args:tests}" +cov-combine = "coverage combine" cov-report = [ "coverage xml", "coverage html", + "coverage report", ] cov = [ "test-cov", "cov-report", ] +[tool.hatch.envs.mypy] +dependencies = [ + "mypy[faster-cache]>=1.13.0", + "types-requests", +] + +[tool.hatch.envs.mypy.scripts] +run = "mypy" + [tool.hatch.build.targets.sdist] exclude = [ ".gitignore", @@ -60,3 +70,16 @@ packages = ["src/openfeature"] omit = [ "tests/**", ] + +[tool.mypy] +mypy_path = "src" +files = "src" + +python_version = "3.8" # should be identical to the minimum supported version +namespace_packages = true +explicit_package_bases = true +local_partial_types = true +pretty = true + +strict = true +disallow_any_generics = false