Skip to content

Commit 811ef26

Browse files
committed
Remove dead Python 3.9 guards and duplicate torch constant
1 parent fbdf042 commit 811ef26

3 files changed

Lines changed: 0 additions & 16 deletions

File tree

src/lightning/fabric/utilities/imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@
3737
_TORCH_GREATER_EQUAL_2_5 = compare_version("torch", operator.ge, "2.5.0")
3838
_TORCH_GREATER_EQUAL_2_6 = compare_version("torch", operator.ge, "2.6.0")
3939
_TORCH_LESS_EQUAL_2_6 = compare_version("torch", operator.le, "2.6.0")
40-
_TORCH_GREATER_EQUAL_2_6 = compare_version("torch", operator.ge, "2.6.0")
4140
_TORCHMETRICS_GREATER_EQUAL_1_0_0 = compare_version("torchmetrics", operator.ge, "1.0.0")
4241
_PYTHON_GREATER_EQUAL_3_10_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 10)

tests/tests_pytorch/models/test_hparams.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import functools
1616
import os
1717
import pickle
18-
import sys
1918
from argparse import Namespace
2019
from dataclasses import dataclass, field
2120
from enum import Enum
@@ -46,8 +45,6 @@
4645
from omegaconf import Container, OmegaConf
4746
from omegaconf.dictconfig import DictConfig
4847

49-
_PYTHON_GREATER_EQUAL_3_9_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 9)
50-
5148

5249
class SaveHparamsModel(BoringModel):
5350
"""Tests that a model can take an object."""
@@ -783,14 +780,6 @@ def test_model_with_fsspec_as_parameter(tmp_path):
783780
trainer.test(weights_only=weights_only)
784781

785782

786-
@pytest.mark.xfail(
787-
# AttributeError: 'OrphanPath' object has no attribute 'exists'
788-
# Issue with `importlib_resources>=6.2.0`
789-
raises=AttributeError,
790-
condition=(not _PYTHON_GREATER_EQUAL_3_9_0),
791-
reason="Issue with `importlib_resources`",
792-
strict=False,
793-
)
794783
@pytest.mark.skipif(RequirementCache("hydra-core<1.1"), reason="Requires Hydra's Compose API")
795784
def test_model_save_hyper_parameters_interpolation_with_hydra(tmp_path):
796785
"""This test relies on configuration saved under tests/models/conf/config.yaml."""

tests/tests_pytorch/utilities/test_compile.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
from tests_pytorch.conftest import mock_cuda_count
2626
from tests_pytorch.helpers.runif import RunIf
2727

28-
_PYTHON_GREATER_EQUAL_3_9_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 9)
29-
3028

3129
# https://github.com/pytorch/pytorch/issues/95708
3230
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
@@ -157,7 +155,6 @@ def has_dynamo(fn):
157155

158156
# https://github.com/pytorch/pytorch/issues/95708
159157
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
160-
@pytest.mark.skipif(not _PYTHON_GREATER_EQUAL_3_9_0, reason="AssertionError: failed to reach fixed point")
161158
@pytest.mark.xfail(
162159
sys.platform == "win32" and _TORCH_GREATER_EQUAL_2_2, strict=False, reason="RuntimeError: Failed to import"
163160
)
@@ -188,7 +185,6 @@ def training_step(self, batch, batch_idx):
188185

189186
# https://github.com/pytorch/pytorch/issues/95708
190187
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
191-
@pytest.mark.skipif(not _PYTHON_GREATER_EQUAL_3_9_0, reason="AssertionError: failed to reach fixed point")
192188
@pytest.mark.xfail(
193189
sys.platform == "win32" and _TORCH_GREATER_EQUAL_2_2, strict=False, reason="RuntimeError: Failed to import"
194190
)

0 commit comments

Comments
 (0)