Skip to content

Commit 151ed23

Browse files
authored
fix: freshly formatted toml files (#2190)
* fix: freshly formatted toml files * chore: update pre-commit hooks to their latest
1 parent 8d1511e commit 151ed23

2 files changed

Lines changed: 73 additions & 73 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ repos:
3838
exclude: notebooks/
3939

4040
- repo: https://github.com/codespell-project/codespell
41-
rev: v2.4.1
41+
rev: v2.4.2
4242
hooks:
4343
- id: codespell
4444
stages: [pre-commit, commit-msg]
4545
args: [--ignore-words-list, "Teh,aas,ans,dout", --check-filenames, --skip, "*.ipynb"]
4646

4747
# Format yaml files
4848
- repo: https://github.com/google/yamlfmt
49-
rev: v0.20.0
49+
rev: v0.21.0
5050
hooks:
5151
- id: yamlfmt
5252
args: [-formatter, retain_line_breaks=true]
5353

5454
- repo: https://github.com/tombi-toml/tombi-pre-commit
55-
rev: v0.10.6
55+
rev: v0.11.5
5656
hooks:
5757
- id: tombi-format

pyproject.toml

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,17 @@ dependencies = [
2727
"tqdm",
2828
]
2929

30-
[tool.setuptools.dynamic]
31-
version = { attr = "numpyro.version.__version__" }
32-
33-
[project.optional-dependencies]
34-
cpu = ["jax[cpu]>=0.7.0"]
35-
cuda12 = ["jax[cuda12]>=0.7.0"]
36-
cuda13 = ["jax[cuda13]>=0.7.0"]
37-
tpu = ["jax[tpu]>=0.7.0"]
38-
3930
[project.urls]
4031
Changelog = "https://github.com/pyro-ppl/numpyro/blob/main/CHANGELOG.md"
4132
Discussion = "https://github.com/pyro-ppl/numpyro/discussions"
4233
Homepage = "https://github.com/pyro-ppl/numpyro"
4334
Issues = "https://github.com/pyro-ppl/numpyro/issues"
4435

45-
[build-system]
46-
requires = ["setuptools>=61", "wheel"]
47-
build-backend = "setuptools.build_meta"
36+
[project.optional-dependencies]
37+
cpu = ["jax[cpu]>=0.7.0"]
38+
cuda12 = ["jax[cuda12]>=0.7.0"]
39+
cuda13 = ["jax[cuda13]>=0.7.0"]
40+
tpu = ["jax[tpu]>=0.7.0"]
4841

4942
[dependency-groups]
5043
dev = [
@@ -95,12 +88,52 @@ test = [
9588
"ty>=0.0.4",
9689
]
9790

98-
# NOTE: this can be simplified using src-layout
99-
[tool.setuptools.packages.find]
100-
include = ["numpyro*"]
91+
[build-system]
92+
requires = ["setuptools>=61", "wheel"]
93+
build-backend = "setuptools.build_meta"
10194

102-
[tool.setuptools]
103-
include-package-data = true
95+
[tool.mypy]
96+
ignore_errors = true
97+
ignore_missing_imports = true
98+
99+
[[tool.mypy.overrides]]
100+
module = [
101+
"examples.datasets",
102+
"numpyro.contrib.control_flow.*", # types missing
103+
"numpyro.contrib.funsor.*", # types missing
104+
"numpyro.contrib.hsgp.*",
105+
"numpyro.contrib.stochastic_support.*",
106+
"numpyro.diagnostics.*",
107+
"numpyro.handlers.*",
108+
"numpyro.infer.elbo.*",
109+
"numpyro.optim.*",
110+
"numpyro.primitives.*",
111+
"numpyro.patch.*",
112+
"numpyro.util.*",
113+
"numpyro.distributions.constraints",
114+
"numpyro.distributions.distribution",
115+
"numpyro.distributions.transforms",
116+
]
117+
ignore_errors = false
118+
119+
[tool.pytest.ini_options]
120+
addopts = ["-v", "--color=yes"]
121+
doctest_optionflags = [
122+
"ELLIPSIS",
123+
"NORMALIZE_WHITESPACE",
124+
"IGNORE_EXCEPTION_DETAIL",
125+
]
126+
filterwarnings = [
127+
"error",
128+
"ignore:.*Attempting to hash a tracer:FutureWarning",
129+
"ignore:numpy.ufunc size changed,:RuntimeWarning",
130+
"ignore:Using a non-tuple sequence:FutureWarning",
131+
"ignore:jax.tree_structure is deprecated:FutureWarning",
132+
"ignore:numpy.linalg support is experimental:UserWarning",
133+
"ignore:scipy.linalg support is experimental:UserWarning",
134+
"once:No GPU:UserWarning",
135+
"once::DeprecationWarning",
136+
]
104137

105138
[tool.ruff]
106139
# Exclude a variety of commonly ignored directories.
@@ -159,19 +192,6 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
159192
[tool.ruff.lint.pycodestyle]
160193
max-line-length = 120
161194

162-
[tool.ruff.format]
163-
# Like Black, use double quotes for strings.
164-
quote-style = "double"
165-
166-
# Like Black, indent with spaces, rather than tabs.
167-
indent-style = "space"
168-
169-
# Like Black, respect magic trailing commas.
170-
skip-magic-trailing-comma = false
171-
172-
# Like Black, automatically detect the appropriate line ending.
173-
line-ending = "auto"
174-
175195
[tool.ruff.lint.per-file-ignores]
176196
"!numpyro/{diagnostics.py,handlers.py,optim.py,patch.py,primitives.py,infer/elbo.py,distributions/distribution.py}" = [
177197
"ANN",
@@ -198,48 +218,28 @@ section-order = [
198218
[tool.ruff.lint.isort.sections]
199219
known-jax = ["flax", "jax", "optax", "tensorflow_probability"]
200220

201-
[tool.pytest.ini_options]
202-
addopts = ["-v", "--color=yes"]
203-
filterwarnings = [
204-
"error",
205-
"ignore:.*Attempting to hash a tracer:FutureWarning",
206-
"ignore:numpy.ufunc size changed,:RuntimeWarning",
207-
"ignore:Using a non-tuple sequence:FutureWarning",
208-
"ignore:jax.tree_structure is deprecated:FutureWarning",
209-
"ignore:numpy.linalg support is experimental:UserWarning",
210-
"ignore:scipy.linalg support is experimental:UserWarning",
211-
"once:No GPU:UserWarning",
212-
"once::DeprecationWarning",
213-
]
214-
doctest_optionflags = [
215-
"ELLIPSIS",
216-
"NORMALIZE_WHITESPACE",
217-
"IGNORE_EXCEPTION_DETAIL",
218-
]
221+
[tool.ruff.format]
222+
# Like Black, use double quotes for strings.
223+
quote-style = "double"
219224

220-
[tool.mypy]
221-
ignore_errors = true
222-
ignore_missing_imports = true
225+
# Like Black, indent with spaces, rather than tabs.
226+
indent-style = "space"
223227

224-
[[tool.mypy.overrides]]
225-
module = [
226-
"examples.datasets",
227-
"numpyro.contrib.control_flow.*", # types missing
228-
"numpyro.contrib.funsor.*", # types missing
229-
"numpyro.contrib.hsgp.*",
230-
"numpyro.contrib.stochastic_support.*",
231-
"numpyro.diagnostics.*",
232-
"numpyro.handlers.*",
233-
"numpyro.infer.elbo.*",
234-
"numpyro.optim.*",
235-
"numpyro.primitives.*",
236-
"numpyro.patch.*",
237-
"numpyro.util.*",
238-
"numpyro.distributions.constraints",
239-
"numpyro.distributions.distribution",
240-
"numpyro.distributions.transforms",
241-
]
242-
ignore_errors = false
228+
# Like Black, respect magic trailing commas.
229+
skip-magic-trailing-comma = false
230+
231+
# Like Black, automatically detect the appropriate line ending.
232+
line-ending = "auto"
233+
234+
[tool.setuptools]
235+
include-package-data = true
236+
237+
[tool.setuptools.dynamic]
238+
version = { attr = "numpyro.version.__version__" }
239+
240+
# NOTE: this can be simplified using src-layout
241+
[tool.setuptools.packages.find]
242+
include = ["numpyro*"]
243243

244244
[tool.uv.sources]
245245
funsor = { git = "https://github.com/pyro-ppl/funsor.git" }

0 commit comments

Comments
 (0)