build: setup mypy for each package independently (#116)
setup mypy for each package independently Signed-off-by: gruebel <anton.gruebel@gmail.com>
This commit is contained in:
parent
5adc68af00
commit
61e42e7bcf
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue