Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'

env:
UV_NO_SYNC: 1
PYTHON_VERSION: '3.14'

jobs:
build-deploy-doc:
name: Build & deploy doc
Expand All @@ -24,10 +20,10 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: '3.13'

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

- name: Determine deployment folder
id: deploy_folder
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
release:
types: [published]

env:
PYTHON_VERSION: 3.14

jobs:
pypi-publish:
name: Publish to PyPI
Expand All @@ -22,7 +19,7 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: '3.13'

- name: Build
run: uv build
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ on:
schedule:
- cron: '41 16 * * *' # Every day at 16:41 UTC (to avoid high load at exact hour values).

env:
UV_NO_SYNC: 1
PYTHON_VERSION: 3.14

jobs:
tests-full-install:
name: Run tests with full install
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Ensure matrix jobs keep running even if one fails
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand All @@ -27,7 +23,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install default (with full options) and test dependencies
run: uv pip install --python-version=${{ matrix.python-version }} '.[full]' --group test
run: uv pip install '.[full]' --group test
- name: Run unit and doc tests with coverage report
run: uv run pytest -W error tests/unit tests/doc --cov=src --cov-report=xml
- name: Upload results to Codecov
Expand All @@ -43,9 +39,9 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: '3.13'
- name: Install default (without any option) and test dependencies
run: uv pip install --python-version=${{ env.PYTHON_VERSION }} . --group test
run: uv pip install . --group test
- name: Run unit and doc tests with coverage report
run: |
uv run pytest -W error tests/unit tests/doc \
Expand All @@ -68,10 +64,10 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: '3.13'

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

- name: Build Documentation
working-directory: docs
Expand All @@ -87,10 +83,10 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: '3.13'

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

- name: Run mypy
run: uv run mypy src/torchjd
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ changes that do not affect the user.
- Added usage example for IWRM with autogram.
- Added usage example for IWRM with partial autogram.
- Added usage example for IWMTL with autogram.
- Added Python 3.14 classifier in pyproject.toml (we now also run tests on Python 3.14 in the CI).

### Changed

Expand Down
22 changes: 4 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,14 @@ mandatory, we only provide installation steps with this tool. You can install it
1) Pre-requisites: Use `uv` to install a Python version compatible with TorchJD and to pin it to the
`torchjd` folder. From the root of the `torchjd` repo, run:
```bash
uv python install 3.14.0
uv python pin 3.14.0
uv python install 3.13.3
uv python pin 3.13.3
```

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

3) Install pre-commit:
```bash
CC=gcc uv pip install -e '.[full]' --group check --group doc --group test --group plot
uv run pre-commit install
```

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

Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:end-before: <!-- end installation -->
```

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

Some aggregators (CAGrad and Nash-MTL) have additional dependencies that are not included by default
when installing `torchjd`. To install them, you can use:
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
Expand Down Expand Up @@ -72,9 +71,9 @@ check = [

doc = [
"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
"furo>=2023.0", # Force it to be recent so that the theme looks better
"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
"tomli>=1.1", # The load function doesn't work similarly before 1.1
"sphinx-autodoc-typehints>=3.5.0", # Bugged Union on Python 3.14 before 3.5.0
"sphinx-autodoc-typehints>=1.16.0", # Some problems with TypeVars before 1.16
"myst-parser>=3.0.1", # Never tested lower versions
"sphinx-design>=0.6.0", # Never tested lower versions
]
Expand Down
Loading