forked from pdm-project/pdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removal: remove deprecated pdm.models.environment (pdm-project#2710)
* removal: remove deprecated pdm.models.environment Signed-off-by: Frost Ming <[email protected]> * add news Signed-off-by: Frost Ming <[email protected]>
- Loading branch information
Showing
3 changed files
with
1 addition
and
27 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 @@ | ||
Remove `pdm.models.environment` module deprecated before. Also remove the renamed members from `pdm.environments`. |
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 |
---|---|---|
@@ -1,25 +1,10 @@ | ||
from typing import Any | ||
|
||
from pdm.environments.base import BareEnvironment, BaseEnvironment | ||
from pdm.environments.local import PythonLocalEnvironment | ||
from pdm.environments.python import PythonEnvironment | ||
from pdm.utils import deprecation_warning | ||
|
||
_deprecated = {"Environment": PythonLocalEnvironment, "GlobalEnvironment": PythonEnvironment} | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name in _deprecated: | ||
real = _deprecated[name] | ||
deprecation_warning(f"{name} is deprecated, please use {real.__name__} instead", stacklevel=2) | ||
return real | ||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | ||
|
||
|
||
__all__ = [ | ||
"BaseEnvironment", | ||
"BareEnvironment", | ||
"PythonEnvironment", | ||
"PythonLocalEnvironment", | ||
] | ||
__all__.extend(_deprecated) |
This file was deleted.
Oops, something went wrong.