Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Changed
-------

- Update ``warn_deprecated`` to emit ``RemovedInV5Warning`` and remove
``RemovedInV4Warning`` class (:pr:`NUMBER`)
2 changes: 1 addition & 1 deletion docs/core/warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Warnings
The following warnings can be emitted by the Globus SDK to indicate a
problem, or a future change, which is not necessarily an error.

.. autoclass:: globus_sdk.RemovedInV4Warning
.. autoclass:: globus_sdk.RemovedInV5Warning
:members:
:show-inheritance:

Expand Down
4 changes: 2 additions & 2 deletions src/globus_sdk/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from .exc import (
GlobusSDKUsageError,
GlobusTimeoutError,
NetworkError,
RemovedInV4Warning,
RemovedInV5Warning,
ValidationError,
)
from .globus_app import ClientApp, GlobusApp, GlobusAppConfig, UserApp
Expand Down Expand Up @@ -141,7 +141,7 @@ __all__ = (
"GlobusSDKUsageError",
"GlobusTimeoutError",
"NetworkError",
"RemovedInV4Warning",
"RemovedInV5Warning",
"ValidationError",
"ClientApp",
"GlobusApp",
Expand Down
6 changes: 3 additions & 3 deletions src/globus_sdk/exc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ErrorInfo,
ErrorInfoContainer,
)
from .warnings import RemovedInV4Warning, warn_deprecated
from .warnings import RemovedInV5Warning, warn_deprecated

__all__ = (
"GlobusError",
Expand All @@ -27,14 +27,14 @@
"ErrorInfoContainer",
"AuthorizationParameterInfo",
"ConsentRequiredInfo",
"RemovedInV4Warning",
"RemovedInV5Warning",
"warn_deprecated",
)

# imports from `globus_sdk.exc.convert` are done lazily
#
# this ensures that we do not eagerly import `requests` when attempting to use SDK
# components which do not need it, but which do need errors (e.g., RemovedInV4Warning)
# components which do not need it, but which do need errors (e.g., RemovedInV5Warning)
# and we avoid paying the performance penalty for importing the relevant dependencies
if t.TYPE_CHECKING:
from .convert import (
Expand Down
6 changes: 3 additions & 3 deletions src/globus_sdk/exc/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import warnings


class RemovedInV4Warning(DeprecationWarning):
class RemovedInV5Warning(DeprecationWarning):
"""
This warning indicates that a feature or usage was detected which will be
unsupported in globus-sdk version 4.
unsupported in globus-sdk version 5.

Users are encouraged to resolve these warnings when possible.
"""


def warn_deprecated(message: str, stacklevel: int = 2) -> None:
warnings.warn(message, RemovedInV4Warning, stacklevel=stacklevel)
warnings.warn(message, RemovedInV5Warning, stacklevel=stacklevel)
Loading