From 1bddecb6369094ec2233737d86340cf7359bfd6a Mon Sep 17 00:00:00 2001 From: Meesum Qazalbash Date: Sun, 17 May 2026 11:50:03 +0500 Subject: [PATCH 1/2] fix: freshly formatted toml files --- pyproject.toml | 140 ++++++++++++++++++++++++------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e098f99a4..fb537756e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,24 +27,17 @@ dependencies = [ "tqdm", ] -[tool.setuptools.dynamic] -version = { attr = "numpyro.version.__version__" } - -[project.optional-dependencies] -cpu = ["jax[cpu]>=0.7.0"] -cuda12 = ["jax[cuda12]>=0.7.0"] -cuda13 = ["jax[cuda13]>=0.7.0"] -tpu = ["jax[tpu]>=0.7.0"] - [project.urls] Changelog = "https://github.com/pyro-ppl/numpyro/blob/main/CHANGELOG.md" Discussion = "https://github.com/pyro-ppl/numpyro/discussions" Homepage = "https://github.com/pyro-ppl/numpyro" Issues = "https://github.com/pyro-ppl/numpyro/issues" -[build-system] -requires = ["setuptools>=61", "wheel"] -build-backend = "setuptools.build_meta" +[project.optional-dependencies] +cpu = ["jax[cpu]>=0.7.0"] +cuda12 = ["jax[cuda12]>=0.7.0"] +cuda13 = ["jax[cuda13]>=0.7.0"] +tpu = ["jax[tpu]>=0.7.0"] [dependency-groups] dev = [ @@ -95,12 +88,52 @@ test = [ "ty>=0.0.4", ] -# NOTE: this can be simplified using src-layout -[tool.setuptools.packages.find] -include = ["numpyro*"] +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" -[tool.setuptools] -include-package-data = true +[tool.mypy] +ignore_errors = true +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = [ + "examples.datasets", + "numpyro.contrib.control_flow.*", # types missing + "numpyro.contrib.funsor.*", # types missing + "numpyro.contrib.hsgp.*", + "numpyro.contrib.stochastic_support.*", + "numpyro.diagnostics.*", + "numpyro.handlers.*", + "numpyro.infer.elbo.*", + "numpyro.optim.*", + "numpyro.primitives.*", + "numpyro.patch.*", + "numpyro.util.*", + "numpyro.distributions.constraints", + "numpyro.distributions.distribution", + "numpyro.distributions.transforms", +] +ignore_errors = false + +[tool.pytest.ini_options] +addopts = ["-v", "--color=yes"] +doctest_optionflags = [ + "ELLIPSIS", + "NORMALIZE_WHITESPACE", + "IGNORE_EXCEPTION_DETAIL", +] +filterwarnings = [ + "error", + "ignore:.*Attempting to hash a tracer:FutureWarning", + "ignore:numpy.ufunc size changed,:RuntimeWarning", + "ignore:Using a non-tuple sequence:FutureWarning", + "ignore:jax.tree_structure is deprecated:FutureWarning", + "ignore:numpy.linalg support is experimental:UserWarning", + "ignore:scipy.linalg support is experimental:UserWarning", + "once:No GPU:UserWarning", + "once::DeprecationWarning", +] [tool.ruff] # Exclude a variety of commonly ignored directories. @@ -159,19 +192,6 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.ruff.lint.pycodestyle] max-line-length = 120 -[tool.ruff.format] -# Like Black, use double quotes for strings. -quote-style = "double" - -# Like Black, indent with spaces, rather than tabs. -indent-style = "space" - -# Like Black, respect magic trailing commas. -skip-magic-trailing-comma = false - -# Like Black, automatically detect the appropriate line ending. -line-ending = "auto" - [tool.ruff.lint.per-file-ignores] "!numpyro/{diagnostics.py,handlers.py,optim.py,patch.py,primitives.py,infer/elbo.py,distributions/distribution.py}" = [ "ANN", @@ -198,48 +218,28 @@ section-order = [ [tool.ruff.lint.isort.sections] known-jax = ["flax", "jax", "optax", "tensorflow_probability"] -[tool.pytest.ini_options] -addopts = ["-v", "--color=yes"] -filterwarnings = [ - "error", - "ignore:.*Attempting to hash a tracer:FutureWarning", - "ignore:numpy.ufunc size changed,:RuntimeWarning", - "ignore:Using a non-tuple sequence:FutureWarning", - "ignore:jax.tree_structure is deprecated:FutureWarning", - "ignore:numpy.linalg support is experimental:UserWarning", - "ignore:scipy.linalg support is experimental:UserWarning", - "once:No GPU:UserWarning", - "once::DeprecationWarning", -] -doctest_optionflags = [ - "ELLIPSIS", - "NORMALIZE_WHITESPACE", - "IGNORE_EXCEPTION_DETAIL", -] +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" -[tool.mypy] -ignore_errors = true -ignore_missing_imports = true +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" -[[tool.mypy.overrides]] -module = [ - "examples.datasets", - "numpyro.contrib.control_flow.*", # types missing - "numpyro.contrib.funsor.*", # types missing - "numpyro.contrib.hsgp.*", - "numpyro.contrib.stochastic_support.*", - "numpyro.diagnostics.*", - "numpyro.handlers.*", - "numpyro.infer.elbo.*", - "numpyro.optim.*", - "numpyro.primitives.*", - "numpyro.patch.*", - "numpyro.util.*", - "numpyro.distributions.constraints", - "numpyro.distributions.distribution", - "numpyro.distributions.transforms", -] -ignore_errors = false +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = { attr = "numpyro.version.__version__" } + +# NOTE: this can be simplified using src-layout +[tool.setuptools.packages.find] +include = ["numpyro*"] [tool.uv.sources] funsor = { git = "https://github.com/pyro-ppl/funsor.git" } From 93d69cde669181364054482b0f45f506fd05afe9 Mon Sep 17 00:00:00 2001 From: Meesum Qazalbash Date: Sun, 17 May 2026 11:50:49 +0500 Subject: [PATCH 2/2] chore: update pre-commit hooks to their latest --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a7a0a171..aa42d2c8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: exclude: notebooks/ - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell stages: [pre-commit, commit-msg] @@ -46,12 +46,12 @@ repos: # Format yaml files - repo: https://github.com/google/yamlfmt - rev: v0.20.0 + rev: v0.21.0 hooks: - id: yamlfmt args: [-formatter, retain_line_breaks=true] - repo: https://github.com/tombi-toml/tombi-pre-commit - rev: v0.10.6 + rev: v0.11.5 hooks: - id: tombi-format