Skip to content

Commit 3b4d597

Browse files
committed
fix torch min
1 parent 89905e5 commit 3b4d597

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ preview = true
162162
line-length = 100
163163
indent-width = 4
164164
src = ["ctgan"]
165+
target-version = "py314"
165166
exclude = [
166167
"docs",
167168
".tox",
@@ -193,7 +194,6 @@ ignore = [
193194
# pydocstyle
194195
"D107", # Missing docstring in __init__
195196
"D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
196-
"PD901",
197197
"PD101",
198198
]
199199

tasks.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inspect
22
import operator
33
import os
4+
import platform
45
import shutil
56
import stat
67
import sys
@@ -12,6 +13,7 @@
1213
from packaging.version import Version
1314

1415
COMPARISONS = {'>=': operator.ge, '>': operator.gt, '<': operator.lt, '<=': operator.le}
16+
EXTERNAL_DEPENDENCY_CAPS_FOR_WINDOWS = {'torch': '2.9.0'}
1517

1618
if not hasattr(inspect, 'getargspec'):
1719
inspect.getargspec = inspect.getfullargspec
@@ -74,6 +76,8 @@ def _get_minimum_versions(dependencies, python_version):
7476
(spec.version for spec in req.specifier if spec.operator in ('>=', '==')),
7577
existing_version,
7678
)
79+
if isinstance(new_version, str):
80+
new_version = Version(new_version)
7781
if new_version > existing_version:
7882
min_versions[req.name] = (
7983
f'{req.name}=={new_version}' # Change when a valid newer version is found
@@ -94,8 +98,9 @@ def install_minimum(c):
9498
if minimum_versions:
9599
install_deps = ' '.join(minimum_versions)
96100
c.run(f'python -m pip install {install_deps}')
97-
98-
101+
if platform.system() == 'Windows' and sys.version_info < (3,14):
102+
for dep, cap in EXTERNAL_DEPENDENCY_CAPS_FOR_WINDOWS.items():
103+
c.run(f'python -m pip install "{dep}<{cap}"')
99104
@task
100105
def minimum(c):
101106
install_minimum(c)

0 commit comments

Comments
 (0)