Skip to content

Commit 24b23a2

Browse files
authored
fix(linalg): Fix numpy annotations on Python<3.14 (#780)
* Fix np.ndarray annotations when numpy is missing on python<3.14 * Add test config for python<3.14 and none options * Add changelog entry
1 parent 30db018 commit 24b23a2

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎.github/workflows/checks.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
- dtype: float64
3737
# Installation options variations
3838
- options: 'none'
39+
# No options on Python < 3.14, where annotations are evaluated eagerly, to catch
40+
# annotations referencing optional dependencies.
41+
- python-version: '3.10'
42+
options: 'none'
3943
# Lower-bounds of all dependencies and Python version.
4044
- python-version: '3.10.0'
4145
extra_groups: 'lower_bounds'

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ changelog does not include internal changes that do not affect the user.
88

99
## [Unreleased]
1010

11+
### Fixed
12+
13+
- Fixed a bug with type annotations making it impossible to use TorchJD without any optional
14+
dependencies on Python versions older than 3.14.
15+
1116
## [0.17.0] - 2026-06-24
1217

1318
### Added

‎src/torchjd/_linalg/_dual_cone.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import contextlib
24
from abc import ABC, abstractmethod
35

0 commit comments

Comments
 (0)