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

package category is not useful #7637

Merged
merged 1 commit into from
Apr 18, 2023
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
2 changes: 0 additions & 2 deletions src/poetry/packages/locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def locked_repository(self) -> LockfileRepository:
source_subdirectory=source.get("subdirectory"),
)
package.description = info.get("description", "")
package.category = info.get("category", "main")
package.optional = info["optional"]
metadata = cast("dict[str, Any]", lock_data["metadata"])

Expand Down Expand Up @@ -425,7 +424,6 @@ def _dump_package(self, package: Package) -> dict[str, Any]:
"name": package.pretty_name,
"version": package.pretty_version,
"description": package.description or "",
"category": package.category,
"optional": package.optional,
"python-versions": package.python_versions,
"files": sorted(
Expand Down
7 changes: 0 additions & 7 deletions src/poetry/puzzle/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from typing import Tuple
from typing import TypeVar

from poetry.core.packages.dependency_group import MAIN_GROUP

from poetry.mixology import resolve_version
from poetry.mixology.failure import SolveFailure
from poetry.puzzle.exceptions import OverrideNeeded
Expand Down Expand Up @@ -273,11 +271,9 @@ def __init__(
self.depth = -1

if not previous:
self.category = "dev"
self.groups: frozenset[str] = frozenset()
self.optional = True
elif dep:
self.category = "main" if MAIN_GROUP in dep.groups else "dev"
self.groups = dep.groups
self.optional = dep.is_optional()
else:
Expand Down Expand Up @@ -327,14 +323,11 @@ def aggregate_package_nodes(nodes: list[PackageNode]) -> tuple[Package, int]:
for node in nodes:
groups.extend(node.groups)

category = "main" if any(MAIN_GROUP in node.groups for node in nodes) else "dev"
optional = all(node.optional for node in nodes)
for node in nodes:
node.depth = depth
node.category = category
node.optional = optional

package.category = category
package.optional = optional

return package, depth
1 change: 0 additions & 1 deletion tests/console/commands/self/test_remove_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def install_plugin(installed: Repository) -> None:
{
"name": "poetry-plugin",
"version": "1.2.3",
"category": "main",
"optional": False,
"platform": "*",
"python-versions": "*",
Expand Down
Loading