Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable typehints in pre-commit and add typehints to readxml #1934

Merged
merged 27 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ repos:
- id: flake8
args: ["--count", "--statistics"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
files: src
matthewfeickert marked this conversation as resolved.
Show resolved Hide resolved
args: []
matthewfeickert marked this conversation as resolved.
Show resolved Hide resolved

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.4.0
hooks:
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,55 @@ pyupgrade = 1

[tool.nbqa.addopts]
pyupgrade = ["--py37-plus"]

[tool.mypy]
files = "src"
python_version = "3.10"
warn_unused_configs = true
strict = true
show_error_codes = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true

[[tool.mypy.overrides]]
module = [
'matplotlib.*',
'jax.*',
'click.*',
'click_completion.*',
'numpy.*',
'scipy.*',
'jsonpatch.*',
'uproot.*',
'yaml.*',
'jsonschema.*',
'tqdm.*',
]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = [
'pyhf',
'pyhf.tensor.*',
'pyhf.optimize.*',
'pyhf.contrib.*',
'pyhf.infer.*',
'pyhf.interpolators.*',
'pyhf.cli.*',
'pyhf.modifiers.*',
'pyhf.exceptions.*',
'pyhf.parameters.*',
'pyhf.schema.*',
'pyhf.writexml',
'pyhf.workspace',
'pyhf.patchset',
'pyhf.compat',
'pyhf.events',
'pyhf.utils',
'pyhf.mixins',
'pyhf.constraints',
'pyhf.pdf',
'pyhf.simplemodels',
'pyhf.probability',
]
ignore_errors = true
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ install_requires =
jsonpatch>=1.15
pyyaml>=5.1 # for parsing CLI equal-delimited options
importlib_resources>=1.3.0; python_version < "3.9" # for resources in schema
typing_extensions; python_version == "3.7" # for TypedDict, Literal
matthewfeickert marked this conversation as resolved.
Show resolved Hide resolved

[options.packages.find]
where = src
Expand Down
Loading