Skip to content
Merged
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
22 changes: 20 additions & 2 deletions src/poetry/core/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def __init__(

self._dependency_groups: dict[str, DependencyGroup] = {}

# For compatibility with previous version, we keep the category
self.category = "main"
# Category is heading towards deprecation.
self._category = "main"
self.files: list[dict[str, str]] = []
self.optional = False

Expand Down Expand Up @@ -374,6 +374,24 @@ def urls(self) -> dict[str, str]:

return urls

@property
def category(self) -> str:
warnings.warn(
"`category` is deprecated and will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
)
return self._category

@category.setter
def category(self, category: str) -> None:
warnings.warn(
"Setting `category` is deprecated and will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
)
self._category = category

@property
def readme(self) -> Path | None:
warnings.warn(
Expand Down