Skip to content

Commit 5c9a0fd

Browse files
authored
Merge branch 'master' into fix/19427/double-iter
2 parents 7ccd72d + d5208f7 commit 5c9a0fd

File tree

11 files changed

+14
-42
lines changed

11 files changed

+14
-42
lines changed

_notebooks

requirements/ci.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ setuptools <70.1.1
22
wheel <0.46.0
33
awscli >=1.30.0, <1.41.0
44
twine ==6.0.1
5-
importlib-metadata <8.0.0
5+
importlib-metadata <9.0.0
66
wget
7-
pkginfo ==1.12.0
7+
pkginfo ==1.12.1.2
88
packaging <25.1

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ myst-parser >=0.18.1, <3.0.0
33
nbsphinx >=0.8.5, <=0.9.2
44
nbconvert <7.14 # temporary fix for https://github.com/jupyter/nbconvert/issues/2092
55
pandoc >=1.0, <=2.3
6-
docutils >=0.16, <0.21
6+
docutils >=0.16, <0.22
77
sphinxcontrib-fulltoc >=1.0, <=1.2.0
88
sphinxcontrib-mockautodoc
99
sphinx-autobuild

requirements/fabric/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
torch >=2.1.0, <2.8.0
55
fsspec[http] >=2022.5.0, <2025.4.0
66
packaging >=20.0, <=25.0
7-
typing-extensions >=4.4.0, <4.11.0
7+
typing-extensions >=4.4.0, <4.14.0
88
lightning-utilities >=0.10.0, <0.15.0

requirements/fabric/test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ coverage ==7.8.0
22
numpy >=1.17.2, <1.27.0
33
pytest ==8.3.5
44
pytest-cov ==6.1.1
5-
pytest-timeout ==2.1.0
5+
pytest-timeout ==2.3.1
66
pytest-rerunfailures ==12.0
7-
pytest-random-order ==1.1.0
7+
pytest-random-order ==1.1.1
88
click ==8.1.7
99
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute

requirements/pytorch/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ PyYAML >=5.4, <6.1.0
77
fsspec[http] >=2022.5.0, <2025.4.0
88
torchmetrics >=0.7.0, <1.8.0
99
packaging >=20.0, <=25.0
10-
typing-extensions >=4.4.0, <4.11.0
10+
typing-extensions >=4.4.0, <4.14.0
1111
lightning-utilities >=0.10.0, <0.15.0

requirements/pytorch/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r ../docs.txt
22

33
nbformat # used for generate empty notebook
4-
ipython[notebook] <8.7.0
4+
ipython[notebook] <8.19.0
55
setuptools<58.0 # workaround for `error in ipython setup command: use_2to3 is invalid.`
66

77
#-r ../../_notebooks/.actions/requires.txt

requirements/pytorch/extra.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
matplotlib>3.1, <3.9.0
66
omegaconf >=2.2.3, <2.4.0
77
hydra-core >=1.2.0, <1.4.0
8-
jsonargparse[signatures] >=4.27.7, <=4.35.0
8+
jsonargparse[signatures] >=4.28.0, <=4.40.0
99
rich >=12.3.0, <13.6.0
1010
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
1111
bitsandbytes >=0.45.2,<0.45.3; platform_system != "Darwin"

requirements/pytorch/test.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
coverage ==7.8.0
22
pytest ==8.3.5
33
pytest-cov ==6.1.1
4-
pytest-timeout ==2.1.0
4+
pytest-timeout ==2.3.1
55
pytest-rerunfailures ==12.0
6-
pytest-random-order ==1.1.0
6+
pytest-random-order ==1.1.1
77

88
# needed in tests
99
cloudpickle >=1.3, <3.2.0
1010
scikit-learn >0.22.1, <1.7.0
1111
numpy >=1.17.2, <1.27.0
12-
onnx >=1.12.0, <1.17.0
12+
onnx >=1.12.0, <1.18.0
1313
onnxruntime >=1.12.0, <1.21.0
14-
psutil <5.9.6 # for `DeviceStatsMonitor`
14+
psutil <7.0.1 # for `DeviceStatsMonitor`
1515
pandas >1.0, <2.3.0 # needed in benchmarks
1616
fastapi # for `ServableModuleValidator` # not setting version as re-defined in App
1717
uvicorn # for `ServableModuleValidator` # not setting version as re-defined in App

tests/tests_pytorch/loggers/test_wandb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from lightning.pytorch.demos.boring_classes import BoringModel
2727
from lightning.pytorch.loggers import TensorBoardLogger, WandbLogger
2828
from lightning.pytorch.utilities.exceptions import MisconfigurationException
29-
from tests_pytorch.test_cli import _xfail_python_ge_3_11_9
3029

3130

3231
def test_wandb_project_name(wandb_mock):
@@ -645,7 +644,6 @@ def test_wandb_logger_download_artifact(wandb_mock, tmp_path):
645644
wandb_mock.Api().artifact.assert_called_once_with("test_artifact", type="model")
646645

647646

648-
@_xfail_python_ge_3_11_9
649647
@pytest.mark.parametrize(("log_model", "expected"), [("True", True), ("False", False), ("all", "all")])
650648
def test_wandb_logger_cli_integration(log_model, expected, wandb_mock, monkeypatch, tmp_path):
651649
"""Test that the WandbLogger can be used with the LightningCLI."""

tests/tests_pytorch/test_cli.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import yaml
3030
from lightning_utilities import compare_version
3131
from lightning_utilities.test.warning import no_warning_call
32-
from packaging.version import Version
3332
from tensorboard.backend.event_processing import event_accumulator
3433
from tensorboard.plugins.hparams.plugin_data_pb2 import HParamsPluginData
3534
from torch.optim import SGD
@@ -65,14 +64,6 @@ def lazy_instance(*args, **kwargs):
6564
return None
6665

6766

68-
_xfail_python_ge_3_11_9 = pytest.mark.xfail(
69-
# https://github.com/omni-us/jsonargparse/issues/484
70-
Version(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}") >= Version("3.11.9"),
71-
strict=False,
72-
reason="jsonargparse + Python 3.11.9 compatibility issue",
73-
)
74-
75-
7667
@contextmanager
7768
def mock_subclasses(baseclass, *subclasses):
7869
"""Mocks baseclass so that it only has the given child subclasses."""
@@ -356,7 +347,6 @@ def test_save_to_log_dir_false_error():
356347
)
357348

358349

359-
@_xfail_python_ge_3_11_9
360350
def test_lightning_cli_logger_save_config(cleandir):
361351
class LoggerSaveConfigCallback(SaveConfigCallback):
362352
def __init__(self, *args, **kwargs) -> None:
@@ -753,7 +743,6 @@ def add_arguments_to_parser(self, parser):
753743
assert cli.trainer.lr_scheduler_configs[0].scheduler.step_size == 50
754744

755745

756-
@_xfail_python_ge_3_11_9
757746
@RunIf(min_torch="2.2")
758747
@pytest.mark.parametrize("use_generic_base_class", [False, True])
759748
def test_lightning_cli_optimizers_and_lr_scheduler_with_link_to(use_generic_base_class):
@@ -801,7 +790,6 @@ def __init__(self, optim1: dict, optim2: dict, scheduler: dict):
801790
assert isinstance(cli.model.scheduler, torch.optim.lr_scheduler.ExponentialLR)
802791

803792

804-
@_xfail_python_ge_3_11_9
805793
@RunIf(min_torch="2.2")
806794
def test_lightning_cli_optimizers_and_lr_scheduler_with_callable_type():
807795
class TestModel(BoringModel):
@@ -1118,7 +1106,6 @@ def __init__(self, foo, bar=5):
11181106
self.bar = bar
11191107

11201108

1121-
@_xfail_python_ge_3_11_9
11221109
def test_lightning_cli_model_short_arguments():
11231110
with (
11241111
mock.patch("sys.argv", ["any.py", "fit", "--model=BoringModel"]),
@@ -1146,7 +1133,6 @@ def __init__(self, foo, bar=5):
11461133
self.bar = bar
11471134

11481135

1149-
@_xfail_python_ge_3_11_9
11501136
def test_lightning_cli_datamodule_short_arguments():
11511137
# with set model
11521138
with (
@@ -1200,7 +1186,6 @@ def test_lightning_cli_datamodule_short_arguments():
12001186
assert cli.parser.groups["data"].group_class is BoringDataModule
12011187

12021188

1203-
@_xfail_python_ge_3_11_9
12041189
@pytest.mark.parametrize("use_class_path_callbacks", [False, True])
12051190
def test_callbacks_append(use_class_path_callbacks):
12061191
"""This test validates registries are used when simplified command line are being used."""
@@ -1244,7 +1229,6 @@ def test_callbacks_append(use_class_path_callbacks):
12441229
assert all(t in callback_types for t in expected)
12451230

12461231

1247-
@_xfail_python_ge_3_11_9
12481232
def test_optimizers_and_lr_schedulers_reload(cleandir):
12491233
base = ["any.py", "--trainer.max_epochs=1"]
12501234
input = base + [
@@ -1276,7 +1260,6 @@ def test_optimizers_and_lr_schedulers_reload(cleandir):
12761260
LightningCLI(BoringModel, run=False)
12771261

12781262

1279-
@_xfail_python_ge_3_11_9
12801263
def test_optimizers_and_lr_schedulers_add_arguments_to_parser_implemented_reload(cleandir):
12811264
class TestLightningCLI(LightningCLI):
12821265
def __init__(self, *args):
@@ -1540,7 +1523,6 @@ def test_cli_help_message():
15401523
assert "Implements Adam" in shorthand_help.getvalue()
15411524

15421525

1543-
@_xfail_python_ge_3_11_9
15441526
def test_cli_reducelronplateau():
15451527
with mock.patch(
15461528
"sys.argv", ["any.py", "--optimizer=Adam", "--lr_scheduler=ReduceLROnPlateau", "--lr_scheduler.monitor=foo"]
@@ -1551,7 +1533,6 @@ def test_cli_reducelronplateau():
15511533
assert config["lr_scheduler"]["scheduler"].monitor == "foo"
15521534

15531535

1554-
@_xfail_python_ge_3_11_9
15551536
def test_cli_configureoptimizers_can_be_overridden():
15561537
class MyCLI(LightningCLI):
15571538
def __init__(self):
@@ -1596,7 +1577,6 @@ def __init__(self, activation: torch.nn.Module = lazy_instance(torch.nn.LeakyReL
15961577
assert cli.model.activation is not model.activation
15971578

15981579

1599-
@_xfail_python_ge_3_11_9
16001580
def test_ddpstrategy_instantiation_and_find_unused_parameters(mps_count_0):
16011581
strategy_default = lazy_instance(DDPStrategy, find_unused_parameters=True)
16021582
with mock.patch("sys.argv", ["any.py", "--trainer.strategy.process_group_backend=group"]):
@@ -1612,7 +1592,6 @@ def test_ddpstrategy_instantiation_and_find_unused_parameters(mps_count_0):
16121592
assert strategy_default is not cli.config_init.trainer.strategy
16131593

16141594

1615-
@_xfail_python_ge_3_11_9
16161595
def test_cli_logger_shorthand():
16171596
with mock.patch("sys.argv", ["any.py"]):
16181597
cli = LightningCLI(TestModel, run=False, trainer_defaults={"logger": False})
@@ -1643,7 +1622,6 @@ def _test_logger_init_args(logger_name, init, unresolved=None):
16431622
assert data["dict_kwargs"] == unresolved
16441623

16451624

1646-
@_xfail_python_ge_3_11_9
16471625
def test_comet_logger_init_args():
16481626
_test_logger_init_args(
16491627
"CometLogger",
@@ -1664,7 +1642,6 @@ def test_comet_logger_init_args():
16641642
strict=False,
16651643
reason="TypeError on Windows when parsing",
16661644
)
1667-
@_xfail_python_ge_3_11_9
16681645
def test_neptune_logger_init_args():
16691646
_test_logger_init_args(
16701647
"NeptuneLogger",
@@ -1673,7 +1650,6 @@ def test_neptune_logger_init_args():
16731650
)
16741651

16751652

1676-
@_xfail_python_ge_3_11_9
16771653
def test_tensorboard_logger_init_args():
16781654
_test_logger_init_args(
16791655
"TensorBoardLogger",
@@ -1685,7 +1661,6 @@ def test_tensorboard_logger_init_args():
16851661
)
16861662

16871663

1688-
@_xfail_python_ge_3_11_9
16891664
def test_wandb_logger_init_args():
16901665
_test_logger_init_args(
16911666
"WandbLogger",
@@ -1770,7 +1745,6 @@ def __init__(self, a_func: Callable = torch.nn.Softmax):
17701745
assert "a_func: torch.nn.Softmax" in out.getvalue()
17711746

17721747

1773-
@_xfail_python_ge_3_11_9
17741748
def test_pytorch_profiler_init_args():
17751749
from lightning.pytorch.profilers import Profiler, PyTorchProfiler
17761750

0 commit comments

Comments
 (0)