Skip to content

Commit b67e4a8

Browse files
Standardised pyproject + pre-commit
1 parent f26eee5 commit b67e4a8

File tree

2 files changed

+63
-49
lines changed

2 files changed

+63
-49
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@
1717
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1818
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919

20+
2021
repos:
22+
- repo: local
23+
hooks:
24+
- id: sort_pyproject
25+
name: sort_pyproject
26+
entry: toml-sort -i --sort-table-keys --sort-inline-tables
27+
language: python
28+
files: ^pyproject\.toml$
29+
additional_dependencies: ["toml-sort==0.23.1"]
2130
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.7.3
31+
rev: v0.13.0
2332
hooks:
24-
- id: ruff-format # formatter
25-
types_or: [ python, pyi, jupyter ]
26-
- id: ruff # linter
27-
types_or: [ python, pyi, jupyter ]
28-
args: [ --fix ]
33+
- id: ruff-format # formatter
34+
types_or: [python, pyi, jupyter, toml]
35+
- id: ruff # linter
36+
types_or: [python, pyi, jupyter, toml]
37+
args: [--fix]
2938
- repo: https://github.com/RobertCraigie/pyright-python
3039
rev: v1.1.391
3140
hooks:
@@ -40,4 +49,5 @@ repos:
4049
files: ^test/types/
4150
additional_dependencies:
4251
[beartype, numpy<2]
43-
args: ["--ignore-missing-imports", "--follow-imports=skip"]
52+
args: ["--ignore-missing-imports", "--follow-imports=skip"]
53+

pyproject.toml

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1+
[build-system]
2+
build-backend = "hatchling.build"
3+
requires = ["hatchling"]
4+
15
[project]
2-
name = "jaxtyping"
3-
version = "0.3.3"
4-
description = "Type annotations and runtime checking for shape and dtype of JAX/NumPy/PyTorch/etc. arrays."
5-
readme = "README.md"
6-
requires-python =">=3.10"
7-
license = {file = "LICENSE"}
86
authors = [
9-
{name = "Patrick Kidger", email = "contact@kidger.site"},
7+
{email = "contact@kidger.site", name = "Patrick Kidger"}
108
]
11-
keywords = ["jax", "neural-networks", "deep-learning", "equinox", "typing"]
129
classifiers = [
13-
"Development Status :: 3 - Alpha",
14-
"Intended Audience :: Developers",
15-
"Intended Audience :: Financial and Insurance Industry",
16-
"Intended Audience :: Information Technology",
17-
"Intended Audience :: Science/Research",
18-
"License :: OSI Approved :: MIT License",
19-
"Natural Language :: English",
20-
"Programming Language :: Python :: 3",
21-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
22-
"Topic :: Scientific/Engineering :: Information Analysis",
23-
"Topic :: Scientific/Engineering :: Mathematics",
10+
"Development Status :: 3 - Alpha",
11+
"Intended Audience :: Developers",
12+
"Intended Audience :: Financial and Insurance Industry",
13+
"Intended Audience :: Information Technology",
14+
"Intended Audience :: Science/Research",
15+
"License :: OSI Approved :: MIT License",
16+
"Natural Language :: English",
17+
"Programming Language :: Python :: 3",
18+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
19+
"Topic :: Scientific/Engineering :: Information Analysis",
20+
"Topic :: Scientific/Engineering :: Mathematics"
2421
]
25-
urls = {repository = "https://github.com/google/jaxtyping" }
2622
dependencies = ["wadler_lindig>=0.1.3"]
23+
description = "Type annotations and runtime checking for shape and dtype of JAX/NumPy/PyTorch/etc. arrays."
2724
entry-points = {pytest11 = {jaxtyping = "jaxtyping._pytest_plugin"}}
25+
keywords = ["jax", "neural-networks", "deep-learning", "equinox", "typing"]
26+
license = {file = "LICENSE"}
27+
name = "jaxtyping"
28+
readme = "README.md"
29+
requires-python = ">=3.10"
30+
urls = {repository = "https://github.com/google/jaxtyping"}
31+
version = "0.3.3"
2832

2933
[project.optional-dependencies]
3034
dev = [
31-
"pre-commit>=4.3.0",
35+
"pre-commit>=4.3.0"
3236
]
3337
docs = [
3438
"hippogriffe==0.2.1",
@@ -39,39 +43,39 @@ docs = [
3943
"mkdocs-material==9.6.7",
4044
"mkdocstrings==0.28.3",
4145
"mkdocstrings-python==1.16.8",
42-
"pymdown-extensions==10.14.3",
46+
"pymdown-extensions==10.14.3"
4347
]
4448
tests = [
45-
"beartype>=0.21.0",
46-
"cloudpickle>=3.1.1",
47-
"equinox>=0.13.1",
48-
"ipython>=8.37.0",
49-
"jax>=0.5.3",
50-
"mlx[cpu]>=0.29.1",
51-
"numpy<2",
52-
"pytest>=8.4.2",
53-
"pytest-asyncio>=1.2.0",
54-
"tensorflow>=2.18.1",
55-
"typeguard==2.13.3",
49+
"beartype>=0.21.0",
50+
"cloudpickle>=3.1.1",
51+
"equinox>=0.13.1",
52+
"ipython>=8.37.0",
53+
"jax>=0.5.3",
54+
"mlx[cpu]>=0.29.1",
55+
"numpy<2",
56+
"pytest>=8.4.2",
57+
"pytest-asyncio>=1.2.0",
58+
"tensorflow>=2.18.1",
59+
"typeguard==2.13.3"
5660
]
5761

58-
59-
[build-system]
60-
requires = ["hatchling"]
61-
build-backend = "hatchling.build"
62-
6362
[tool.hatch.build]
6463
include = ["jaxtyping/*"]
6564

6665
[tool.ruff.lint]
67-
select = ["E", "F", "I001"]
6866
ignore = ["E721", "E731", "F722"]
67+
select = ["E", "F", "I001"]
6968

70-
[tool.ruff.lint.per-file-ignores]
71-
"jaxtyping/_typeguard/__init__.py" = ["E", "F", "I001"]
69+
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
70+
"collections" = "co"
71+
"functools" = "ft"
72+
"itertools" = "it"
7273

7374
[tool.ruff.lint.isort]
7475
combine-as-imports = true
75-
lines-after-imports = 2
7676
extra-standard-library = ["typing_extensions"]
77+
lines-after-imports = 2
7778
order-by-type = false
79+
80+
[tool.ruff.lint.per-file-ignores]
81+
"jaxtyping/_typeguard/__init__.py" = ["E", "F", "I001"]

0 commit comments

Comments
 (0)