Skip to content

Commit 9e2406c

Browse files
committed
Switch to uv min/max dependency resolution.
Rather than our custom script. This matches what we do in TabPFN.
1 parent f194b8b commit 9e2406c

4 files changed

Lines changed: 1891 additions & 1350 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ jobs:
3535
include:
3636
- os: ubuntu-latest
3737
python-version: "3.9"
38-
dependency-set: minimum
38+
dependency-set: lowest-direct
3939
- os: macos-15-intel # We need x86 as ARM is python>= 3.11 only.
4040
# https://github.com/actions/setup-python/issues/855
4141
python-version: "3.9"
42-
dependency-set: minimum
42+
dependency-set: lowest-direct
4343
- os: windows-latest
4444
python-version: "3.9"
45-
dependency-set: minimum
45+
dependency-set: lowest-direct
4646
- os: ubuntu-latest
4747
python-version: "3.13"
48-
dependency-set: maximum
48+
dependency-set: highest
4949
- os: macos-latest
5050
python-version: "3.13"
51-
dependency-set: maximum
51+
dependency-set: highest
5252
- os: windows-latest
5353
python-version: "3.13"
54-
dependency-set: maximum
54+
dependency-set: highest
5555
runs-on: ${{ matrix.os }}
5656

5757
env:
@@ -71,23 +71,8 @@ jobs:
7171
with:
7272
enable-cache: true
7373

74-
- name: Generate requirements file
75-
run: python scripts/generate_dependencies.py ${{ matrix.dependency-set }}
76-
7774
- name: Install dependencies
78-
run: |
79-
uv pip install --system ".[all]"
80-
# onnx is required for onnx export tests
81-
# we don't install all dev dependencies here for speed
82-
uv pip install --system -r requirements.txt
83-
uv pip install --system pytest psutil
84-
# licensecheck is required for license checking
85-
uv pip install --system licensecheck
86-
# onnx is not supported on python 3.13 yet https://github.com/onnx/onnx/issues/6339
87-
if [[ "${{ matrix.python-version }}" != "3.13" ]]; then
88-
uv pip install --system onnx
89-
fi
90-
shell: bash
75+
run: uv sync --all-extras --group ci --resolution ${{ matrix.dependency-set }}
9176

9277
- name: Restore model cache
9378
id: restore-model-cache
@@ -105,12 +90,13 @@ jobs:
10590
env:
10691
HF_TOKEN: ${{ secrets.HF_TOKEN }}
10792
TABPFN_TOKEN: ${{ secrets.TABPFN_TOKEN }}
108-
run: python scripts/download_all_models.py
93+
run: uv run --no-sync python scripts/download_all_models.py
10994

11095
- name: Check for forbidden licenses
11196
if: runner.os == 'MacOS' && matrix.python-version == '3.9'
97+
shell: bash
11298
run: |
113-
licensecheck \
99+
uv run --no-sync licensecheck \
114100
--requirements-paths pyproject.toml \
115101
--only-licenses APACHE MIT BSD ISC PYTHON UNLICENSE UNKNOWN \
116102
--ignore-packages certifi "tabpfn*" \
@@ -122,13 +108,13 @@ jobs:
122108
env:
123109
TABPFN_EXCLUDE_DEVICES: mps
124110
run: |
125-
FAST_TEST_MODE=1 pytest tests/
111+
FAST_TEST_MODE=1 uv run --no-sync pytest tests/
126112
127113
- name: Run Tests (Windows)
128114
if: runner.os == 'Windows'
129115
run: |
130116
$env:FAST_TEST_MODE = 1
131-
pytest tests/
117+
uv run --no-sync pytest tests/
132118
133119
- name: Save model cache
134120
if: github.ref == 'refs/heads/main'

pyproject.toml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,30 +81,25 @@ unsupervised = []
8181

8282
# Meta-package that installs all extensions
8383
all = [
84-
"shap>=0.41.0",
85-
"shapiq>=0.4.0",
86-
"seaborn>=0.12.2",
87-
88-
"llvmlite>=0.30.0",
89-
"hyperopt>=0.2.7",
90-
# https://discuss.python.org/t/pkg-resources-removal-how-to-go-from-there/106079
91-
"setuptools>=67.0.0,<82",
92-
"autogluon.tabular==1.4.0",
93-
94-
"scikit-survival>=0.25.0; python_version >= '3.10'",
84+
"tabpfn-extensions[interpretability,post_hoc_ensembles,hpo,survival]",
9585
]
9686

9787
[dependency-groups]
88+
# The minimum subset of the dev dependencies required to run the tests on the CI.
89+
# The idea is to be as close to the deployment environment as possible.
90+
ci = [
91+
"pytest>=8.0.0",
92+
"licensecheck>=2025.1.0",
93+
]
9894
dev = [
95+
{include-group = "ci"},
9996
"pre-commit>=3.0.0",
10097
"ruff==0.8.6", # This must be the same version as in .pre-commit-config.yaml
10198
"mypy>=1.0.0",
102-
"pytest>=8.0.0",
10399
"pytest-xdist>=3.6.0",
104100
"pytest-mock>=3.15.1",
105101
"build>=1.3.0",
106102
"twine>=6.2.0",
107-
"licensecheck>=2025.1.0",
108103
]
109104

110105
[tool.pytest.ini_options]

scripts/generate_dependencies.py

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

0 commit comments

Comments
 (0)