Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ repos:
entry: mypy --install-types --non-interactive
files: ^numpyro/

- id: ty
name: ty check
language: python
entry: ty
args: [check, --config-file, ty.toml]
pass_filenames: false
always_run: true
additional_dependencies: [ty]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand All @@ -30,9 +38,9 @@ repos:
exclude: notebooks/

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
stages: [pre-commit, commit-msg]
args:
[--ignore-words-list, "Teh,aas,ans,dout", --check-filenames, --skip, "*.ipynb"]
args: [--ignore-words-list, "Teh,aas,ans,dout", --check-filenames, --skip, "*.ipynb"]

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ lint: FORCE
ruff format . --check
python scripts/update_headers.py --check
mypy --install-types --non-interactive numpyro
ty check -vvv --config-file ty.toml --exit-zero

license: FORCE
python scripts/update_headers.py
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,5 @@ module = [
"numpyro.primitives.*",
"numpyro.patch.*",
"numpyro.util.*",
"numpyro.distributions.transforms",
]
ignore_errors = false
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"pyro-api>=0.1.1",
"scikit-learn",
"scipy>=1.9",
"ty>=0.0.4",
],
"dev": [
"dm-haiku>=0.0.14; python_version >= '3.10'",
Expand Down
22 changes: 22 additions & 0 deletions ty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[environment]
python-version = "3.12"

[rules]
unresolved-import = "ignore"

[src]
include = ["numpyro"]
exclude = [
"numpyro.contrib.control_flow.*",
"numpyro.contrib.funsor.*",
"numpyro.contrib.hsgp.*",
"numpyro.contrib.stochastic_support.*",
"numpyro.diagnostics.*",
"numpyro.handlers.*",
"numpyro.infer.elbo.*",
"numpyro.optim.*",
"numpyro.primitives.*",
"numpyro.patch.*",
"numpyro.util.*",
]
respect-ignore-files = true