Skip to content

Commit

Permalink
removal: remove deprecated pdm.models.environment (pdm-project#2710)
Browse files Browse the repository at this point in the history
* 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
frostming authored Mar 21, 2024
1 parent e68105f commit 9746780
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
1 change: 1 addition & 0 deletions news/2710.removal.md
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`.
15 changes: 0 additions & 15 deletions src/pdm/environments/__init__.py
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)
12 changes: 0 additions & 12 deletions src/pdm/models/environment.py

This file was deleted.

0 comments on commit 9746780

Please sign in to comment.