diff --git a/src/poetry/core/packages/dependency.py b/src/poetry/core/packages/dependency.py index 44bd5d299..363235dd8 100644 --- a/src/poetry/core/packages/dependency.py +++ b/src/poetry/core/packages/dependency.py @@ -82,7 +82,6 @@ def __init__( self._transitive_python_versions: str | None = None self._transitive_python_constraint: VersionConstraint | None = None self._transitive_marker: BaseMarker | None = None - self._extras = frozenset(extras or []) self._in_extras: list[str] = [] @@ -242,7 +241,7 @@ def transitive_python_constraint(self) -> VersionConstraint: @property def extras(self) -> frozenset[str]: - return self._extras + return self._features @property def in_extras(self) -> list[str]: @@ -462,7 +461,7 @@ def with_constraint(self, constraint: str | VersionConstraint) -> Dependency: optional=self.is_optional(), groups=list(self._groups), allows_prereleases=self.allows_prereleases(), - extras=self._extras, + extras=self.extras, source_type=self._source_type, source_url=self._source_url, source_reference=self._source_reference, @@ -612,14 +611,14 @@ def __eq__(self, other: Any) -> bool: return ( self.is_same_package_as(other) and self._constraint == other.constraint - and self._extras == other.extras + and self.extras == other.extras ) def __ne__(self, other: Any) -> bool: return not self.__eq__(other) def __hash__(self) -> int: - return super().__hash__() ^ hash(self._constraint) ^ hash(self._extras) + return super().__hash__() ^ hash(self._constraint) ^ hash(self.extras) def __str__(self) -> str: if self.is_root: diff --git a/src/poetry/core/packages/directory_dependency.py b/src/poetry/core/packages/directory_dependency.py index 16d7de821..b78400369 100644 --- a/src/poetry/core/packages/directory_dependency.py +++ b/src/poetry/core/packages/directory_dependency.py @@ -98,7 +98,7 @@ def with_constraint( optional=self.is_optional(), groups=list(self._groups), develop=self._develop, - extras=list(self._extras), + extras=list(self.extras), ) new.set_constraint(constraint) diff --git a/src/poetry/core/packages/file_dependency.py b/src/poetry/core/packages/file_dependency.py index 72780b974..d8c01fdc0 100644 --- a/src/poetry/core/packages/file_dependency.py +++ b/src/poetry/core/packages/file_dependency.py @@ -82,7 +82,7 @@ def with_constraint(self, constraint: str | VersionConstraint) -> FileDependency base=self.base, optional=self.is_optional(), groups=list(self._groups), - extras=list(self._extras), + extras=list(self.extras), ) new.set_constraint(constraint) diff --git a/src/poetry/core/packages/url_dependency.py b/src/poetry/core/packages/url_dependency.py index d098e6e96..5a14e89fd 100644 --- a/src/poetry/core/packages/url_dependency.py +++ b/src/poetry/core/packages/url_dependency.py @@ -62,7 +62,7 @@ def with_constraint(self, constraint: str | VersionConstraint) -> URLDependency: url=self._url, optional=self.is_optional(), groups=list(self._groups), - extras=list(self._extras), + extras=list(self.extras), ) new.set_constraint(constraint) diff --git a/src/poetry/core/packages/vcs_dependency.py b/src/poetry/core/packages/vcs_dependency.py index ef6599260..6da59f0d4 100644 --- a/src/poetry/core/packages/vcs_dependency.py +++ b/src/poetry/core/packages/vcs_dependency.py @@ -145,7 +145,7 @@ def with_constraint(self, constraint: str | VersionConstraint) -> VCSDependency: optional=self.is_optional(), groups=list(self._groups), develop=self._develop, - extras=list(self._extras), + extras=list(self.extras), ) new.set_constraint(constraint)