diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 66f9800a..88207e13 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -36,6 +36,10 @@ jobs: - dtype: float64 # Installation options variations - options: 'none' + # No options on Python < 3.14, where annotations are evaluated eagerly, to catch + # annotations referencing optional dependencies. + - python-version: '3.10' + options: 'none' # Lower-bounds of all dependencies and Python version. - python-version: '3.10.0' extra_groups: 'lower_bounds' diff --git a/CHANGELOG.md b/CHANGELOG.md index fccba32f..7615e3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ changelog does not include internal changes that do not affect the user. ## [Unreleased] +### Fixed + +- Fixed a bug with type annotations making it impossible to use TorchJD without any optional + dependencies on Python versions older than 3.14. + ## [0.17.0] - 2026-06-24 ### Added diff --git a/src/torchjd/_linalg/_dual_cone.py b/src/torchjd/_linalg/_dual_cone.py index 43fe59fb..7dd32482 100644 --- a/src/torchjd/_linalg/_dual_cone.py +++ b/src/torchjd/_linalg/_dual_cone.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import contextlib from abc import ABC, abstractmethod