Skip to content

Commit 9d7456d

Browse files
committed
py version for old dlcs
1 parent d039790 commit 9d7456d

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tests/conftest.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ def huggingface_pytorch_training_version(huggingface_training_version):
273273

274274
@pytest.fixture(scope="module")
275275
def huggingface_pytorch_training_py_version(huggingface_pytorch_training_version):
276-
return "py39" if Version(huggingface_pytorch_training_version) >= Version("1.9") else "py36"
276+
if Version(huggingface_pytorch_training_version) >= Version("1.13"):
277+
return "py39"
278+
elif Version(huggingface_pytorch_training_version) >= Version("1.9"):
279+
return "py38"
280+
else:
281+
return "py36"
277282

278283

279284
@pytest.fixture(scope="module")
@@ -328,9 +333,12 @@ def huggingface_training_compiler_pytorch_py_version(
328333
def huggingface_pytorch_latest_training_py_version(
329334
huggingface_training_pytorch_latest_version,
330335
):
331-
return (
332-
"py39" if Version(huggingface_training_pytorch_latest_version) >= Version("1.9") else "py36"
333-
)
336+
if Version(huggingface_pytorch_training_version) >= Version("1.13"):
337+
return "py39"
338+
elif Version(huggingface_pytorch_training_version) >= Version("1.9"):
339+
return "py38"
340+
else:
341+
return "py36"
334342

335343

336344
@pytest.fixture(scope="module")
@@ -347,11 +355,12 @@ def pytorch_training_compiler_py_version(
347355
def huggingface_pytorch_latest_inference_py_version(
348356
huggingface_inference_pytorch_latest_version,
349357
):
350-
return (
351-
"py39"
352-
if Version(huggingface_inference_pytorch_latest_version) >= Version("1.9")
353-
else "py36"
354-
)
358+
if Version(huggingface_inference_pytorch_latest_version) >= Version("1.13"):
359+
return "py39"
360+
elif Version(huggingface_inference_pytorch_latest_version) >= Version("1.9"):
361+
return "py38"
362+
else:
363+
return "py36"
355364

356365

357366
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)