Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ 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]
args: [--ignore-words-list, "Teh,aas,ans,dout", --check-filenames, --skip, "*.ipynb"]

# 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
140 changes: 70 additions & 70 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand All @@ -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" }
Loading