Skip to content

Commit

Permalink
refactor: adjust plan
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 12, 2024
1 parent 0e134b6 commit a11b0f8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ape_pm/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,10 @@ class PythonDependency(DependencyAPI):
@model_validator(mode="before")
@classmethod
def validate_model(cls, values):
# TODO: In 0.9, remove this check and require 'site_package'.
if "python" in values:
logger.warning(
"'python' key name is deprecated. Use 'site_package' for "
"already-installed packages or 'pypi' to download the package from PyPI."
)
# `.python` is the old key but we have to always support it
# so dependencies-of-dependencies always work, even when referencing
# older projects.
values["site_package"] = values.pop("python")

if "name" not in values:
Expand Down Expand Up @@ -473,7 +471,7 @@ def package_id(self) -> str:

@property
def python(self) -> Optional[str]:
logger.warning("'.python' is deprecated. Please use 'site_package'.")
# For backwards-compat; serves as an undocumented alias.
return self.site_package

@property
Expand Down

0 comments on commit a11b0f8

Please sign in to comment.