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

also deprecate transitive_python_constraint #649

Merged
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
5 changes: 5 additions & 0 deletions src/poetry/core/packages/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def python_constraint(self) -> VersionConstraint:

@property
def transitive_python_constraint(self) -> VersionConstraint:
warnings.warn(
"'transitive_python_constraint' is deprecated and will be removed.",
DeprecationWarning,
stacklevel=2,
)
if self._transitive_python_constraint is None:
return self._python_constraint

Expand Down
5 changes: 4 additions & 1 deletion tests/packages/test_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ def test_with_constraint() -> None:
assert new.marker == dependency.marker
assert new.transitive_marker == dependency.transitive_marker
assert new.python_constraint == dependency.python_constraint
assert new.transitive_python_constraint == dependency.transitive_python_constraint
with pytest.warns(DeprecationWarning):
assert (
new.transitive_python_constraint == dependency.transitive_python_constraint
)


@pytest.mark.parametrize(
Expand Down