Skip to content

Commit 0e567de

Browse files
committed
Simplify scikit-learn dependencies to fix uv resolution conflicts
- Use single constraint: scikit-learn>=1.3.0,<1.7.0 (resolves to 1.6.1) - Works with Python 3.9-3.12 and NumPy 2.0 - Eliminates dependency resolution errors - All tests pass locally (107 main + 4 compatibility)
1 parent 639ad4a commit 0e567de

File tree

4 files changed

+70
-138
lines changed

4 files changed

+70
-138
lines changed

.github/workflows/compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
sklearn-version: '1.3.2'
2121
- python-version: '3.12'
2222
python-version-short: 'py312'
23-
sklearn-version: '1.7.2'
23+
sklearn-version: '1.6.1'
2424

2525
steps:
2626
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ dependencies = [
4848
"numpy>=1.21.0",
4949
"pandas>=1.3.0",
5050
"scipy>=1.7.0",
51-
"scikit-learn>=1.3.0,<1.4.0; python_version < '3.10'",
52-
"scikit-learn>=1.3.0,<1.7.0; python_version >= '3.10' and python_version < '3.12'",
53-
"scikit-learn>=1.7.0,<1.8.0; python_version >= '3.12'",
51+
"scikit-learn>=1.3.0,<1.7.0",
5452
"rich>=13.7.0",
5553
"numba>=0.60.0",
5654
"packaging>=21.0",

tests/test_compatibility.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Focus on edge cases and critical combinations
1414
COMPATIBILITY_MATRIX = [
1515
("3.9", "1.3.2", "Min supported: Python 3.9 + sklearn 1.3.2"),
16-
("3.12", "1.7.2", "Python 3.12 + sklearn 1.7.2 + NumPy 2.0"),
16+
("3.12", "1.6.1", "Python 3.12 + sklearn 1.6.1 + NumPy 2.0"),
1717
]
1818

1919

@@ -32,8 +32,8 @@ def get_numpy_constraint(python_ver, sklearn_ver):
3232
"""Get appropriate numpy version constraint."""
3333
if sklearn_ver in ["1.3.0", "1.3.2"] or python_ver == "3.9":
3434
return "numpy>=1.21,<2.0"
35-
elif sklearn_ver in ["1.7.2"]:
36-
# scikit-learn 1.7.2+ should support NumPy 2.0
35+
elif sklearn_ver in ["1.6.1"]:
36+
# scikit-learn 1.6.1+ should support NumPy 2.0
3737
return "numpy>=1.21,<2.1"
3838
else:
3939
return "numpy>=1.21,<2.1"

0 commit comments

Comments
 (0)