Skip to content

Commit

Permalink
1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Dec 21, 2020
1 parent aa24423 commit 38c7cb4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pytorch_lightning/utilities/argparse_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from warnings import warn

warn("`argparse_utils` package has been renamed to `argparse` since v1.2 and will be removed in v1.3",
warn("`argparse_utils` package has been renamed to `argparse` since v1.2 and will be removed in v1.4",
DeprecationWarning)

from pytorch_lightning.utilities.argparse import * # noqa: F403 E402 F401
2 changes: 1 addition & 1 deletion pytorch_lightning/utilities/model_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from warnings import warn

warn("`model_utils` package has been renamed to `model_helpers` since v1.2 and will be removed in v1.3",
warn("`model_utils` package has been renamed to `model_helpers` since v1.2 and will be removed in v1.4",
DeprecationWarning)

from pytorch_lightning.utilities.model_helpers import * # noqa: F403 E402 F401
2 changes: 1 addition & 1 deletion pytorch_lightning/utilities/warning_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from warnings import warn

warn("`warning_utils` package has been renamed to `warnings` since v1.2 and will be removed in v1.3",
warn("`warning_utils` package has been renamed to `warnings` since v1.2 and will be removed in v1.4",
DeprecationWarning)

from pytorch_lightning.utilities.warnings import * # noqa: F403 E402 F401
2 changes: 1 addition & 1 deletion pytorch_lightning/utilities/xla_device_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from warnings import warn

warn("`xla_device_utils` package has been renamed to `xla_device` since v1.2 and will be removed in v1.3",
warn("`xla_device_utils` package has been renamed to `xla_device` since v1.2 and will be removed in v1.4",
DeprecationWarning)

from pytorch_lightning.utilities.xla_device import * # noqa: F403 E402 F401
18 changes: 0 additions & 18 deletions tests/deprecated_api/test_remove_1-3.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,3 @@ def test_v1_3_0_trainer_cli_profiler(cli_args, expected_parsed_arg, expected_pro
assert getattr(args, "profiler") == expected_parsed_arg
trainer = Trainer.from_argparse_args(args)
assert isinstance(trainer.profiler, expected_profiler)


def test_v1_3_0_deprecated_imports():
_soft_unimport_module('pytorch_lightning.utilities.argparse_utils')
with pytest.deprecated_call(match='will be removed in v1.3'):
from pytorch_lightning.utilities.argparse_utils import from_argparse_args # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.model_utils')
with pytest.deprecated_call(match='will be removed in v1.3'):
from pytorch_lightning.utilities.model_utils import is_overridden # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.warning_utils')
with pytest.deprecated_call(match='will be removed in v1.3'):
from pytorch_lightning.utilities.warning_utils import WarningCache # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.xla_device_utils')
with pytest.deprecated_call(match='will be removed in v1.3'):
from pytorch_lightning.utilities.xla_device_utils import XLADeviceUtils # noqa: F811 F401
35 changes: 35 additions & 0 deletions tests/deprecated_api/test_remove_1-4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Test deprecated functionality which will be removed in vX.Y.Z"""
import pytest

from tests.deprecated_api import _soft_unimport_module


def test_v1_4_0_deprecated_imports():
_soft_unimport_module('pytorch_lightning.utilities.argparse_utils')
with pytest.deprecated_call(match='will be removed in v1.4'):
from pytorch_lightning.utilities.argparse_utils import from_argparse_args # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.model_utils')
with pytest.deprecated_call(match='will be removed in v1.4'):
from pytorch_lightning.utilities.model_utils import is_overridden # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.warning_utils')
with pytest.deprecated_call(match='will be removed in v1.4'):
from pytorch_lightning.utilities.warning_utils import WarningCache # noqa: F811 F401

_soft_unimport_module('pytorch_lightning.utilities.xla_device_utils')
with pytest.deprecated_call(match='will be removed in v1.4'):
from pytorch_lightning.utilities.xla_device_utils import XLADeviceUtils # noqa: F811 F401

0 comments on commit 38c7cb4

Please sign in to comment.