Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removal: remove deprecated pdm.models.environment #2710

Merged
merged 2 commits into from
Mar 21, 2024
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
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.

Loading