From 735272f8e1fc2a4527b20c6e0e35d71030569479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Thu, 30 Oct 2025 04:30:43 +0100 Subject: [PATCH 1/2] Revert "chore: Make Python 3.14 support official (#474)" This reverts commit 3407290363e33844cb2d9def7e1bff43d3cafd8a. --- .github/workflows/build-deploy-docs.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 4 ++-- CHANGELOG.md | 1 - CONTRIBUTING.md | 4 ++-- docs/source/installation.md | 2 +- pyproject.toml | 1 - 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 00f94558..1a291f8c 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -8,7 +8,7 @@ on: env: UV_NO_SYNC: 1 - PYTHON_VERSION: '3.14' + PYTHON_VERSION: '3.13' jobs: build-deploy-doc: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 282ac671..4744cf2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: types: [published] env: - PYTHON_VERSION: 3.14 + PYTHON_VERSION: 3.13 jobs: pypi-publish: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44ea78ed..5548de2f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ on: env: UV_NO_SYNC: 1 - PYTHON_VERSION: 3.14 + PYTHON_VERSION: 3.13 jobs: tests-full-install: @@ -17,7 +17,7 @@ jobs: 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: diff --git a/CHANGELOG.md b/CHANGELOG.md index b7515825..033f8f5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a088ad53..1321ab8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,8 +12,8 @@ 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: diff --git a/docs/source/installation.md b/docs/source/installation.md index 8647738c..dcb6bb47 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -5,7 +5,7 @@ :end-before: ``` -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: diff --git a/pyproject.toml b/pyproject.toml index cd0822b0..62ea34f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] From 686c1676c86b7491861bf4a61b2e7a1437638b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Thu, 30 Oct 2025 04:33:06 +0100 Subject: [PATCH 2/2] Revert "ci: Fix doc dependency resolving (#475)" This reverts commit 7e7c6234663da716a22922fc92cf64a9698f9dcf. --- .github/workflows/build-deploy-docs.yml | 8 ++------ .github/workflows/release.yml | 5 +---- .github/workflows/tests.yml | 18 +++++++----------- CONTRIBUTING.md | 18 ++---------------- pyproject.toml | 4 ++-- 5 files changed, 14 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 1a291f8c..4ddf9e22 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -6,10 +6,6 @@ on: tags: - 'v[0-9]*.[0-9]*.[0-9]*' -env: - UV_NO_SYNC: 1 - PYTHON_VERSION: '3.13' - jobs: build-deploy-doc: name: Build & deploy doc @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4744cf2f..6e00a72d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,6 @@ on: release: types: [published] -env: - PYTHON_VERSION: 3.13 - jobs: pypi-publish: name: Publish to PyPI @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5548de2f..fdf465f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,10 +6,6 @@ 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.13 - jobs: tests-full-install: name: Run tests with full install @@ -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 @@ -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 \ @@ -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 @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1321ab8a..5df922a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,21 +19,7 @@ mandatory, we only provide installation steps with this tool. You can install it 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 ``` @@ -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 ``` diff --git a/pyproject.toml b/pyproject.toml index 62ea34f7..d1773b68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,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 ]