Skip to content

Commit c0639d3

Browse files
authored
Transition from requirements.txt to deps in pyproject.toml (#111)
Only deps in pyproject.toml are included when installing with `pip`. This caused `clu` and other libraries to not be installed. Fixes #110.
1 parent f81e7e5 commit c0639d3

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
21+
pip install ".[dev]"
2222
- name: Run Unit Tests
2323
run: |
2424
pytest ./src/

.readthedocs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ sphinx:
1818
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
1919
python:
2020
install:
21-
- requirements: docs/requirements.txt
21+
- method: pip
22+
path: .
23+
extra_requirements:
24+
- docs

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ pip install google-metrax
2727

2828
## Development
2929

30+
Install the development dependencies:
31+
32+
```sh
33+
pip install ".[dev]"
34+
```
35+
3036
Run the tests:
3137

3238
```sh
@@ -36,7 +42,7 @@ pytest src/metrax
3642
Develop the docs locally:
3743

3844
```
39-
pip install -r ./docs/requirements.txt
45+
pip install ".[docs]"
4046
sphinx-build ./docs /tmp/metrax_docs
4147
python -m http.server --directory /tmp/metrax_docs
4248
```

docs/requirements.txt

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

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ classifiers = [
1616
"Operating System :: OS Independent",
1717
]
1818
license = {file = 'LICENSE'}
19+
dependencies = [
20+
"clu==0.0.12",
21+
"flax==0.11.1",
22+
"jax==0.6.2",
23+
"numpy==2.1.3",
24+
]
1925

2026
[tool.hatch.build]
2127
include = [
@@ -32,6 +38,27 @@ packages = ["src/metrax"]
3238
Homepage = "https://github.com/google/metrax"
3339
Issues = "https://github.com/google/metrax/issues"
3440

41+
[project.optional-dependencies]
42+
dev = [
43+
"absl-py>=2.3.1",
44+
"jax[cpu]==0.6.2",
45+
"jax_tpu_embedding==0.1.0.dev20250618",
46+
"keras-hub",
47+
"keras-rs>=0.2.1",
48+
"nltk>=3.9.1",
49+
"pytest>=8.4.1",
50+
"Pillow>=9.0.0",
51+
"protobuf>=5.29.5",
52+
"rouge-score>=0.1.2",
53+
"scikit-learn>=1.7.1",
54+
"tensorflow",
55+
"torchmetrics>=1.8.1",
56+
]
57+
docs = [
58+
"sphinx-rtd-theme==1.3.0rc1",
59+
"scikit-learn==1.6.1",
60+
]
61+
3562
[tool.ruff]
3663
indent-width = 2
3764
line-length = 120

requirements.txt

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

0 commit comments

Comments
 (0)