Skip to content

Commit bb0f244

Browse files
committed
build: refactor build infrastruture
Signed-off-by: nstarman <[email protected]>
1 parent 41755a1 commit bb0f244

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3724
-149
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ repos:
2020
- id: debug-statements
2121
- id: check-yaml
2222
- id: check-added-large-files
23-
exclude: notebooks/*
23+
exclude: notebooks/
2424

2525
- repo: https://github.com/codespell-project/codespell
2626
rev: v2.3.0
2727
hooks:
2828
- id: codespell
29-
stages: [commit, commit-msg]
29+
stages: [pre-commit, commit-msg]
3030
args:
3131
[--ignore-words-list, "Teh,aas", --check-filenames, --skip, "*.ipynb"]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9

numpyro/version.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 102 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,101 @@
1+
[project]
2+
name = "numpyro"
3+
version = "0.15.3"
4+
description = "Pyro PPL on NumPy"
5+
readme = "README.md"
6+
requires-python = ">=3.9"
7+
authors = [
8+
{ name = "Uber AI Labs", email = "[email protected]" },
9+
]
10+
keywords = ["probabilistic", "machine learning", "bayesian", "statistics"]
11+
license.file = "LICENSE.md"
12+
classifiers=[
13+
"Intended Audience :: Developers",
14+
"Intended Audience :: Education",
15+
"Intended Audience :: Science/Research",
16+
"License :: OSI Approved :: Apache Software License",
17+
"Operating System :: POSIX :: Linux",
18+
"Operating System :: MacOS :: MacOS X",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
]
23+
dependencies = [
24+
"jax>=0.4.25",
25+
"jaxlib>=0.4.25",
26+
"multipledispatch>=1.0.0",
27+
"numpy>=2.0.2",
28+
"tqdm>=4.66.5",
29+
]
30+
31+
[project.optional-dependencies]
32+
doc = [
33+
"ipython", # sphinx needs this to render codes
34+
"nbsphinx>=0.8.9",
35+
"readthedocs-sphinx-search>=0.3.2",
36+
"sphinx>=5",
37+
"sphinx_rtd_theme",
38+
"sphinx-gallery",
39+
]
40+
test = [
41+
"importlib-metadata<5.0",
42+
"ruff>=0.1.8",
43+
"pytest>=4.1",
44+
"pyro-api>=0.1.1",
45+
"scikit-learn",
46+
"scipy>=1.9",
47+
]
48+
dev = [
49+
"dm-haiku",
50+
"flax",
51+
"funsor>=0.4.1",
52+
"graphviz",
53+
"jaxns==2.4.8",
54+
"matplotlib",
55+
"optax>=0.0.6",
56+
"pylab-sdk", # jaxns dependency
57+
"pyyaml", # flax dependency
58+
"requests", # pylab dependency
59+
"tensorflow_probability>=0.18.0",
60+
]
61+
examples = [
62+
"arviz",
63+
"jupyter",
64+
"matplotlib",
65+
"pandas",
66+
"seaborn",
67+
"scikit-learn",
68+
"wordcloud",
69+
]
70+
cpu = ["numpyro", "jax[cpu]"]
71+
# gpu = ["numpyro", "jax[tpu]"]
72+
# cuda = ["numpyro", "jax[cuda]"]
73+
74+
[project.urls]
75+
Documentation = "https://num.pyro.ai/en/stable/"
76+
Repository = "https://github.com/pyro-ppl/numpyro"
77+
78+
[build-system]
79+
requires = ["hatchling"]
80+
build-backend = "hatchling.build"
81+
82+
[tool.hatch.build]
83+
include = ["src/numpyro/version.py"]
84+
85+
[tool.hatch.build.targets.sdist.hooks.custom]
86+
hooks = ["write_version_file"]
87+
88+
[tool.hatch.hooks.write_version_file]
89+
path = "your_package/version.py"
90+
template = '''
91+
# Auto-generated version file
92+
__version__ = "{version}"
93+
'''
94+
195
[tool.ruff]
296
# Exclude a variety of commonly ignored directories.
397
exclude = [
4-
".bzr",
5-
".direnv",
6-
".eggs",
7-
".git",
8-
".git-rewrite",
9-
".hg",
10-
".ipynb_checkpoints",
11-
".mypy_cache",
12-
".nox",
13-
".pants.d",
14-
".pyenv",
15-
".pytest_cache",
16-
".pytype",
17-
".ruff_cache",
18-
".svn",
19-
".tox",
20-
".venv",
21-
".vscode",
98+
".*",
2299
"__pypackages__",
23100
"_build",
24101
"buck-out",
@@ -63,8 +140,8 @@ skip-magic-trailing-comma = false
63140
line-ending = "auto"
64141

65142
[tool.ruff.lint.extend-per-file-ignores]
66-
"numpyro/contrib/tfp/distributions.py" = ["F811"]
67-
"numpyro/distributions/kl.py" = ["F811"]
143+
"src/numpyro/contrib/tfp/distributions.py" = ["F811"]
144+
"src/numpyro/distributions/kl.py" = ["F811"]
68145

69146
[tool.ruff.lint.isort]
70147
combine-as-imports = true
@@ -102,3 +179,8 @@ doctest_optionflags = [
102179
"NORMALIZE_WHITESPACE",
103180
"IGNORE_EXCEPTION_DETAIL",
104181
]
182+
183+
[tool.uv]
184+
dev-dependencies = [
185+
"pre-commit>=4.0.1",
186+
]

setup.py

Lines changed: 0 additions & 103 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)