-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `auth_requirements_error` module is moved to `globus_sdk.gare` and docs and importts are updated. Included in this change, `GlobusAuthRequirementsError` has been renamed to `GARE`, as the `Error` suffix to a name typically indicates that a class is an exception class. Aliasing has been put in place from `experimental` to the new code location. As a minor, related fix `_serializable.Serializable` now uses a `Self` type annotation, rather than a type var. This improves the doc rendering of the `from_dict` and `to_dict` methods, as they show the self-type rather than an unbound type variable T.
- Loading branch information
Showing
20 changed files
with
155 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changed | ||
~~~~~~~ | ||
|
||
- Globus Auth Requirements errors are no longer ``experimental``. They have | ||
been moved to the ``globus_sdk.gare`` module and the primary document type | ||
has been renamed from ``GlobusAuthRequirementsError`` to ``GARE``. (:pr:`NUMBER`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
import typing as t | ||
|
||
__all__ = ( | ||
"GlobusAuthRequirementsError", | ||
"GlobusAuthorizationParameters", | ||
"to_auth_requirements_error", | ||
"to_auth_requirements_errors", | ||
"is_auth_requirements_error", | ||
"has_auth_requirements_errors", | ||
) | ||
|
||
# legacy aliases | ||
# (when accessed, these will emit deprecation warnings) | ||
if t.TYPE_CHECKING: | ||
from globus_sdk.gare import GARE as GlobusAuthRequirementsError | ||
from globus_sdk.gare import ( | ||
GlobusAuthorizationParameters, | ||
has_auth_requirements_errors, | ||
is_auth_requirements_error, | ||
to_auth_requirements_error, | ||
to_auth_requirements_errors, | ||
) | ||
else: | ||
|
||
def __getattr__(name: str) -> t.Any: | ||
import globus_sdk.gare as gare_module | ||
from globus_sdk.exc import warn_deprecated | ||
|
||
warn_deprecated( | ||
"'globus_sdk.experimental.auth_requirements_error' has been renamed to " | ||
"'globus_sdk.gare'. " | ||
f"Importing '{name}' from `globus_sdk.experimental` is deprecated." | ||
) | ||
|
||
# rename GlobusAuthRequirementsError -> GARE | ||
if name == "GlobusAuthRequirementsError": | ||
name = "GARE" | ||
|
||
value = getattr(gare_module, name, None) | ||
if value is None: | ||
raise AttributeError(f"module {__name__} has no attribute {name}") | ||
setattr(sys.modules[__name__], name, value) | ||
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.