Skip to content

Commit 42a3d7f

Browse files
authored
Merge branch 'main' into dev-new-engine
2 parents 481d83f + 3407290 commit 42a3d7f

7 files changed

Lines changed: 45 additions & 18 deletions

File tree

.github/workflows/build-deploy-docs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
tags:
77
- 'v[0-9]*.[0-9]*.[0-9]*'
88

9+
env:
10+
UV_NO_SYNC: 1
11+
PYTHON_VERSION: '3.14'
12+
913
jobs:
1014
build-deploy-doc:
1115
name: Build & deploy doc
@@ -20,10 +24,10 @@ jobs:
2024
- name: Set up uv
2125
uses: astral-sh/setup-uv@v5
2226
with:
23-
python-version: '3.13'
27+
python-version: ${{ env.PYTHON_VERSION }}
2428

2529
- name: Install dependencies (default with full options & doc)
26-
run: uv pip install '.[full]' --group doc
30+
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} '.[full]' --group doc
2731

2832
- name: Determine deployment folder
2933
id: deploy_folder

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66

7+
env:
8+
PYTHON_VERSION: 3.14
9+
710
jobs:
811
pypi-publish:
912
name: Publish to PyPI
@@ -19,7 +22,7 @@ jobs:
1922
- name: Set up uv
2023
uses: astral-sh/setup-uv@v5
2124
with:
22-
python-version: '3.13'
25+
python-version: ${{ env.PYTHON_VERSION }}
2326

2427
- name: Build
2528
run: uv build

.github/workflows/tests.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ on:
66
schedule:
77
- cron: '41 16 * * *' # Every day at 16:41 UTC (to avoid high load at exact hour values).
88

9+
env:
10+
UV_NO_SYNC: 1
11+
PYTHON_VERSION: 3.14
12+
913
jobs:
1014
tests-full-install:
1115
name: Run tests with full install
1216
runs-on: ${{ matrix.os }}
1317
strategy:
1418
fail-fast: false # Ensure matrix jobs keep running even if one fails
1519
matrix:
16-
python-version: ['3.10', '3.11', '3.12', '3.13']
20+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1721
os: [ubuntu-latest, macOS-latest, windows-latest]
1822

1923
steps:
@@ -23,7 +27,7 @@ jobs:
2327
with:
2428
python-version: ${{ matrix.python-version }}
2529
- name: Install default (with full options) and test dependencies
26-
run: uv pip install '.[full]' --group test
30+
run: uv pip install --python-version=${{ matrix.python-version }} '.[full]' --group test
2731
- name: Run unit and doc tests with coverage report
2832
run: uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml
2933
- name: Upload results to Codecov
@@ -39,9 +43,9 @@ jobs:
3943
- name: Set up uv
4044
uses: astral-sh/setup-uv@v5
4145
with:
42-
python-version: '3.13'
46+
python-version: ${{ env.PYTHON_VERSION }}
4347
- name: Install default (without any option) and test dependencies
44-
run: uv pip install . --group test
48+
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} . --group test
4549
- name: Run unit and doc tests with coverage report
4650
run: |
4751
uv run pytest -W error tests/unit tests/doc \
@@ -64,10 +68,10 @@ jobs:
6468
- name: Set up uv
6569
uses: astral-sh/setup-uv@v5
6670
with:
67-
python-version: '3.13'
71+
python-version: ${{ env.PYTHON_VERSION }}
6872

6973
- name: Install dependencies (default with full options & doc)
70-
run: uv pip install '.[full]' --group doc
74+
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} '.[full]' --group doc
7175

7276
- name: Build Documentation
7377
working-directory: docs
@@ -83,10 +87,10 @@ jobs:
8387
- name: Set up uv
8488
uses: astral-sh/setup-uv@v5
8589
with:
86-
python-version: '3.13'
90+
python-version: ${{ env.PYTHON_VERSION }}
8791

8892
- name: Install dependencies (default with full options & check)
89-
run: uv pip install '.[full]' --group check
93+
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} '.[full]' --group check
9094

9195
- name: Run mypy
9296
run: uv run mypy src/torchjd

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ changes that do not affect the user.
3535
- Added usage example for IWRM with autogram.
3636
- Added usage example for IWRM with partial autogram.
3737
- Added usage example for IWMTL with autogram.
38+
- Added Python 3.14 classifier in pyproject.toml (we now also run tests on Python 3.14 in the CI).
3839

3940
### Changed
4041

CONTRIBUTING.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,28 @@ mandatory, we only provide installation steps with this tool. You can install it
1212
1) Pre-requisites: Use `uv` to install a Python version compatible with TorchJD and to pin it to the
1313
`torchjd` folder. From the root of the `torchjd` repo, run:
1414
```bash
15-
uv python install 3.13.3
16-
uv python pin 3.13.3
15+
uv python install 3.14.0
16+
uv python pin 3.14.0
1717
```
1818

1919
2) Create a virtual environment and install the project in it. From the root of `torchjd`, run:
2020
```bash
2121
uv venv
22-
CC=gcc uv pip install -e '.[full]' --group check --group doc --group test --group plot
22+
CC=gcc uv pip install --python-version=3.13.3 -e '.[full]' --group check --group doc --group test --group plot
23+
```
24+
We also advise using `UV_NO_SYNC=1` to prevent `uv` from syncing all the time. This is because by
25+
default, it tries to resolve libraries compatible with the whole range of Python versions
26+
supported by TorchJD, but in reality, we just need an installation compatible with the currently
27+
used Python version. That's also why we specify `--python-version=3.14` when running
28+
`uv pip install`. To follow that recommendation, add the following line to your `.bashrc`:
29+
```bash
30+
export UV_NO_SYNC=1
31+
```
32+
and start a new terminal. The alternative is to use the `--no-sync` flag whenever you run a pip
33+
command that would normally sync (like `uv run`).
34+
35+
3) Install pre-commit:
36+
```bash
2337
uv run pre-commit install
2438
```
2539

@@ -46,7 +60,7 @@ from the root of `torchjd`:
4660
rm -rf .venv
4761
rm uv.lock
4862
uv venv
49-
CC=gcc uv pip install -e '.[full]' --group check --group doc --group test --group plot
63+
CC=gcc uv pip install --python-version=3.13.3 -e '.[full]' --group check --group doc --group test --group plot
5064
uv run pre-commit install
5165
```
5266

docs/source/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:end-before: <!-- end installation -->
66
```
77

8-
Note that `torchjd` requires Python 3.10, 3.11, 3.12 or 3.13 and `torch>=2.0`.
8+
Note that `torchjd` requires Python 3.10, 3.11, 3.12, 3.13 or 3.14 and `torch>=2.0`.
99

1010
Some aggregators (CAGrad and Nash-MTL) have additional dependencies that are not included by default
1111
when installing `torchjd`. To install them, you can use:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering",
3334
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3435
]
@@ -71,9 +72,9 @@ check = [
7172

7273
doc = [
7374
"sphinx>=6.0, !=7.2.0, !=7.2.1, !=7.2.3, !=7.2.4, !=7.2.5", # Versions in [7.2.0, 7.2.5] have a bug with an internal torch import from _C
74-
"furo>=2023.0, <2024.04.27", # Force it to be recent so that the theme looks better, 2024.04.27 seems to have bugged link colors
75+
"furo>=2023.0", # Force it to be recent so that the theme looks better
7576
"tomli>=1.1", # The load function doesn't work similarly before 1.1
76-
"sphinx-autodoc-typehints>=1.16.0", # Some problems with TypeVars before 1.16
77+
"sphinx-autodoc-typehints>=3.5.0", # Bugged Union on Python 3.14 before 3.5.0
7778
"myst-parser>=3.0.1", # Never tested lower versions
7879
"sphinx-design>=0.6.0", # Never tested lower versions
7980
]

0 commit comments

Comments
 (0)