Skip to content

Commit fa70c3d

Browse files
hbq1ChexDev
authored andcommitted
* Migrate to pyproject.toml
* Drop support for python 3.10 PiperOrigin-RevId: 801826037
1 parent b4bb3b9 commit fa70c3d

File tree

12 files changed

+161
-115
lines changed

12 files changed

+161
-115
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ jobs:
2323

2424
strategy:
2525
matrix:
26-
python-version: ["3.10", "3.11", "3.12", "3.13"]
26+
python-version: ["3.11", "3.12", "3.13"]
2727
os: [ubuntu-latest]
2828
jax-version: ["newest"]
2929
include:
30-
- python-version: "3.10"
31-
os: "ubuntu-latest"
32-
jax-version: "0.4.27" # Keep this in sync with version in requirements.txt
3330
- python-version: "3.13"
3431
os: "ubuntu-latest"
3532
jax-version: "nightly"

.github/workflows/pypi-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Check consistency between the package version and release tag
2323
run: |
2424
RELEASE_VER=${GITHUB_REF#refs/*/}
25-
PACKAGE_VER="v`python setup.py --version`"
25+
PACKAGE_VER="v`python -c 'import chex; print(chex.__version__)'`"
2626
if [ $RELEASE_VER != $PACKAGE_VER ]
2727
then
2828
echo "package ver. ($PACKAGE_VER) != release ver. ($RELEASE_VER)"; exit 1

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
build/
66
dist/
77
venv/
8+
_testing/
9+
10+
# Building the documentation
11+
docs/_autosummary
812
docs/_build/
13+
docs/_collections
14+
docs/modules/generated
15+
docs/sg_execution_times.rst
916

1017
# Mac OS
1118
.DS_Store

.readthedocs.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ sphinx:
1515

1616
python:
1717
install:
18-
- requirements: requirements/requirements-docs.txt
19-
- requirements: requirements/requirements.txt
20-
- method: setuptools
18+
# Equivalent to 'pip install .'
19+
- method: pip
2120
path: .
21+
# Equivalent to 'pip install .[docs]'
22+
- method: pip
23+
path: .
24+
extra_requirements:
25+
- docs

MANIFEST.in

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

chex/py.typed

Whitespace-only changes.

pyproject.toml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
[build-system]
2+
requires = ["flit_core >=3.2,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[project]
6+
name = "chex"
7+
dynamic = ["version"]
8+
description = "Chex: Testing made fun, in JAX!"
9+
readme = "README.md"
10+
license = { file = "LICENSE" }
11+
requires-python = ">=3.11"
12+
authors = [
13+
{name = "Google DeepMind", email = "chex-dev@google.com"},
14+
]
15+
keywords = [
16+
"jax",
17+
"testing",
18+
"debugging",
19+
"python",
20+
"machine learning",
21+
]
22+
classifiers = [
23+
"Environment :: Console",
24+
"Programming Language :: Python",
25+
"Intended Audience :: Developers",
26+
"Operating System :: OS Independent",
27+
"Programming Language :: Python :: 3",
28+
"Intended Audience :: Science/Research",
29+
"Development Status :: 4 - Beta",
30+
"License :: OSI Approved :: Apache Software License",
31+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
32+
"Topic :: Software Development :: Libraries :: Python Modules",
33+
]
34+
dependencies = [
35+
"absl-py>=2.3.1",
36+
"typing_extensions>=4.15.0",
37+
"jax>=0.7.0",
38+
"jaxlib>=0.7.0",
39+
"numpy>=1.24.1",
40+
"toolz>=1.0.0",
41+
]
42+
43+
[project.urls]
44+
homepage = "https://github.com/google-deepmind/chex"
45+
repository = "https://github.com/google-deepmind/chex"
46+
documentation = "https://chex.readthedocs.io/"
47+
48+
[project.optional-dependencies]
49+
test = [
50+
"cloudpickle==3.1.0",
51+
"dm-tree>=0.1.9",
52+
]
53+
54+
docs = [
55+
"sphinx>=6.0.0",
56+
"sphinx-book-theme>=1.0.1",
57+
"sphinxcontrib-katex",
58+
]
59+
60+
[tool.setuptools.packages.find]
61+
include = ["README.md", "LICENSE"]
62+
exclude = ["*_test.py"]
63+
64+
[tool.ruff]
65+
line-length = 80
66+
67+
[tool.ruff.lint]
68+
select = [
69+
"F",
70+
"E",
71+
"W291", # whitespace at the end of the line
72+
"B023", # pylint's cell-var-over-loop, closures capturing variables in loop
73+
]
74+
ignore = [
75+
"E731", # lambdas are allowed
76+
"F401", # allow unused imports
77+
"E402", # allow modules not at top of file
78+
"E741", # allow "l" as a variable name
79+
"E703", # allow semicolons (for jupyter notebooks)
80+
]
81+
82+
[tool.pylint.messages_control]
83+
disable = [
84+
"bad-indentation",
85+
"unknown-option-value",
86+
"invalid-name",
87+
"missing-function-docstring",
88+
"missing-class-docstring",
89+
"missing-module-docstring",
90+
"no-member",
91+
"too-many-locals",
92+
"too-many-positional-arguments",
93+
"no-else-return",
94+
"line-too-long",
95+
"too-many-arguments",
96+
"no-value-for-parameter",
97+
"duplicate-code",
98+
"unused-argument",
99+
"too-few-public-methods",
100+
"wrong-import-order",
101+
"unused-import",
102+
"wrong-import-position",
103+
"unnecessary-lambda-assignment",
104+
"too-many-lines",
105+
"too-many-statements",
106+
"deprecated-class",
107+
"redefined-builtin",
108+
"used-before-assignment",
109+
"undefined-variable",
110+
"protected-access",
111+
"not-callable",
112+
"redefined-outer-name",
113+
"too-many-instance-attributes",
114+
"missing-final-newline",
115+
"too-many-public-methods",
116+
"import-error",
117+
]
118+
119+
# We include pyink to allow external contributors to optionally, but easily,
120+
# pass google internal formatting checks.
121+
[tool.pyink]
122+
pyink = true # false would mean black is used directly without pyink features
123+
pyink-use-majority-quotes = true
124+
pyink-indentation = 2
125+
line-length = 80
126+
include = '\.pyi?$'

requirements/requirements-docs.txt

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

requirements/requirements-test.txt

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

requirements/requirements.txt

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

0 commit comments

Comments
 (0)