Skip to content

Commit f53eda6

Browse files
author
HatPdotS
committed
removed 3.9 compatibility due to pytorch numpy conflicts
1 parent 0906c4d commit f53eda6

2 files changed

Lines changed: 284 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "torchref"
77
version = "0.4.1"
88
description = "Pytorch based crystallographic refinement"
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
license = "MIT"
1212
authors = [
1313
{name = "HansPeterSeidel"},
@@ -88,7 +88,7 @@ torchref = ["data/*.csv", "data/*.json", "data/*.pt", "data/monomer_library/**/*
8888

8989
[tool.black]
9090
line-length = 88
91-
target-version = ["py39"]
91+
target-version = ["py310"]
9292

9393
[tool.isort]
9494
profile = "black"

tox.ini

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
[tox]
2+
envlist =
3+
# Major Python versions with latest packages
4+
py310-latest
5+
py311-latest
6+
py312-latest
7+
py313-latest
8+
# NumPy 2.x version boundaries
9+
py311-numpy2x
10+
py312-numpy2x
11+
# Numba version tests
12+
py311-numba061
13+
py312-numba063
14+
# Minimum viable modern stack
15+
py310-minimum
16+
py311-minimum
17+
# PyTorch version tests
18+
py311-torch24
19+
py311-torch26
20+
# Pandas version tests
21+
py311-pandas20
22+
py311-pandas22
23+
# Crystallography stack tests
24+
py311-gemmi-min
25+
# Lower bounds test
26+
py310-lowerbounds
27+
py311-lowerbounds
28+
isolated_build = True
29+
skip_missing_interpreters = True
30+
31+
[testenv]
32+
description = Run tests with {basepython}
33+
changedir = {toxinidir}
34+
setenv =
35+
PYTHONPATH = {toxinidir}
36+
deps =
37+
pytest>=6.0.0
38+
pytest-cov>=2.12.0
39+
# Base dependencies for all environments
40+
tqdm>=4.61.0
41+
gemmi>=0.5.0
42+
matplotlib>=3.4.0
43+
reciprocalspaceship>=0.9.0
44+
pyarrow>=4.0.0
45+
commands =
46+
python -c "import sys; print(f'Python: {sys.version}')"
47+
python -c "import numpy; print(f'numpy: {numpy.__version__}')"
48+
python -c "import pandas; print(f'pandas: {pandas.__version__}')"
49+
python -c "import torch; print(f'torch: {torch.__version__}')"
50+
python -c "import numba; print(f'numba: {numba.__version__}')"
51+
python -c "import scipy; print(f'scipy: {scipy.__version__}')"
52+
python -c "import torchref; print(f'torchref: {getattr(torchref, \"__version__\", \"unknown\")}')"
53+
pytest tests/ -v --tb=short -m "not gpu and not slow" {posargs}
54+
55+
# =============================================================================
56+
# Python 3.10 - Minimum supported version
57+
# =============================================================================
58+
[testenv:py310-latest]
59+
description = Python 3.10 with latest packages
60+
basepython = python3.10
61+
deps =
62+
{[testenv]deps}
63+
numpy
64+
pandas
65+
torch
66+
numba
67+
scipy
68+
69+
[testenv:py310-minimum]
70+
description = Python 3.10 with minimum viable versions (numpy 2.0 + torch 2.4)
71+
basepython = python3.10
72+
deps =
73+
{[testenv]deps}
74+
numpy==2.0.0
75+
pandas==2.0.0
76+
torch==2.4.0
77+
numba==0.61.0
78+
scipy==1.13.0
79+
80+
[testenv:py310-lowerbounds]
81+
description = Python 3.10 testing lower version bounds
82+
basepython = python3.10
83+
deps =
84+
pytest>=6.0.0
85+
pytest-cov>=2.12.0
86+
numpy==2.0.0
87+
pandas==2.0.0
88+
torch==2.4.0
89+
tqdm==4.61.0
90+
numba==0.59.0
91+
gemmi==0.5.0
92+
scipy==1.10.0
93+
matplotlib==3.7.0
94+
reciprocalspaceship==0.9.18
95+
pyarrow==12.0.0
96+
97+
# =============================================================================
98+
# Python 3.11 - Well-supported middle ground
99+
# =============================================================================
100+
[testenv:py311-latest]
101+
description = Python 3.11 with latest packages
102+
basepython = python3.11
103+
deps =
104+
{[testenv]deps}
105+
numpy
106+
pandas
107+
torch
108+
numba
109+
scipy
110+
111+
[testenv:py311-numpy2x]
112+
description = Python 3.11 with NumPy 2.x
113+
basepython = python3.11
114+
deps =
115+
{[testenv]deps}
116+
numpy>=2.0.0
117+
pandas>=2.2.0
118+
torch>=2.4.0
119+
numba>=0.61.0
120+
scipy>=1.13.0
121+
122+
[testenv:py311-numba061]
123+
description = Python 3.11 with numba 0.61 (first NumPy 2.x support)
124+
basepython = python3.11
125+
deps =
126+
{[testenv]deps}
127+
numpy>=2.0.0,<2.1.0
128+
pandas>=2.1.0
129+
torch>=2.4.0,<2.5.0
130+
numba>=0.61.0,<0.62.0
131+
scipy>=1.13.0,<1.14.0
132+
133+
[testenv:py311-minimum]
134+
description = Python 3.11 with minimum viable versions (numpy 2.0 + torch 2.4)
135+
basepython = python3.11
136+
deps =
137+
{[testenv]deps}
138+
numpy==2.0.0
139+
pandas==2.0.0
140+
torch==2.4.0
141+
numba==0.61.0
142+
scipy==1.13.0
143+
144+
# =============================================================================
145+
# Python 3.12 - Latest stable Python
146+
# =============================================================================
147+
[testenv:py312-latest]
148+
description = Python 3.12 with latest packages
149+
basepython = python3.12
150+
deps =
151+
{[testenv]deps}
152+
numpy
153+
pandas
154+
torch
155+
numba
156+
scipy
157+
158+
[testenv:py312-numpy2x]
159+
description = Python 3.12 with NumPy 2.x stack
160+
basepython = python3.12
161+
deps =
162+
{[testenv]deps}
163+
numpy>=2.0.0
164+
pandas>=2.2.0
165+
torch>=2.4.0
166+
numba>=0.61.0
167+
scipy>=1.13.0
168+
169+
[testenv:py312-numba063]
170+
description = Python 3.12 with numba 0.63 (latest)
171+
basepython = python3.12
172+
deps =
173+
{[testenv]deps}
174+
numpy>=2.0.0
175+
pandas>=2.2.0
176+
torch>=2.5.0
177+
numba>=0.63.0
178+
scipy>=1.14.0
179+
180+
# =============================================================================
181+
# Python 3.13 - Latest Python
182+
# =============================================================================
183+
[testenv:py313-latest]
184+
description = Python 3.13 with latest packages
185+
basepython = python3.13
186+
deps =
187+
{[testenv]deps}
188+
numpy
189+
pandas
190+
torch
191+
numba
192+
scipy
193+
194+
# =============================================================================
195+
# PyTorch Version Tests
196+
# =============================================================================
197+
[testenv:py311-torch24]
198+
description = Python 3.11 with PyTorch 2.4 (minimum supported)
199+
basepython = python3.11
200+
deps =
201+
{[testenv]deps}
202+
numpy>=2.0.0,<2.1.0
203+
pandas>=2.1.0,<2.3.0
204+
torch>=2.4.0,<2.5.0
205+
numba>=0.61.0,<0.62.0
206+
scipy>=1.13.0,<1.14.0
207+
208+
[testenv:py311-torch26]
209+
description = Python 3.11 with PyTorch 2.6
210+
basepython = python3.11
211+
deps =
212+
{[testenv]deps}
213+
numpy>=2.1.0,<2.2.0
214+
pandas>=2.2.0,<2.3.0
215+
torch>=2.6.0,<2.7.0
216+
numba>=0.61.0,<0.62.0
217+
scipy>=1.14.0,<1.15.0
218+
219+
# =============================================================================
220+
# Pandas Version Tests
221+
# =============================================================================
222+
[testenv:py311-pandas20]
223+
description = Python 3.11 with Pandas 2.0
224+
basepython = python3.11
225+
deps =
226+
{[testenv]deps}
227+
numpy>=2.0.0,<2.1.0
228+
pandas>=2.0.0,<2.1.0
229+
torch>=2.4.0,<2.5.0
230+
numba>=0.61.0,<0.62.0
231+
scipy>=1.13.0,<1.14.0
232+
233+
[testenv:py311-pandas22]
234+
description = Python 3.11 with Pandas 2.2
235+
basepython = python3.11
236+
deps =
237+
{[testenv]deps}
238+
numpy>=2.0.0,<2.2.0
239+
pandas>=2.2.0,<2.3.0
240+
torch>=2.4.0,<2.6.0
241+
numba>=0.61.0,<0.62.0
242+
scipy>=1.13.0,<1.15.0
243+
244+
# =============================================================================
245+
# Crystallography Stack Tests
246+
# =============================================================================
247+
[testenv:py311-gemmi-min]
248+
description = Python 3.11 with gemmi 0.5.0 (declared minimum)
249+
basepython = python3.11
250+
deps =
251+
pytest>=6.0.0
252+
pytest-cov>=2.12.0
253+
tqdm>=4.61.0
254+
gemmi==0.5.0
255+
matplotlib>=3.4.0
256+
reciprocalspaceship>=0.9.0,<1.0.0
257+
pyarrow>=4.0.0
258+
numpy>=2.0.0,<2.1.0
259+
pandas>=2.0.0,<2.2.0
260+
torch>=2.4.0,<2.5.0
261+
numba>=0.61.0,<0.62.0
262+
scipy>=1.13.0,<1.14.0
263+
264+
# =============================================================================
265+
# Lower Bounds Test - Test declared minimums from pyproject.toml
266+
# =============================================================================
267+
[testenv:py311-lowerbounds]
268+
description = Python 3.11 testing lower version bounds
269+
basepython = python3.11
270+
deps =
271+
pytest>=6.0.0
272+
pytest-cov>=2.12.0
273+
numpy==2.0.0
274+
pandas==2.0.0
275+
torch==2.4.0
276+
tqdm==4.61.0
277+
numba==0.59.0
278+
gemmi==0.5.0
279+
scipy==1.10.0
280+
matplotlib==3.7.0
281+
reciprocalspaceship==0.9.18
282+
pyarrow==12.0.0

0 commit comments

Comments
 (0)