Skip to content

Commit f3f5737

Browse files
committed
also deprecate transitive_python_constraint
1 parent 086f933 commit f3f5737

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/poetry/core/packages/dependency.py

+5
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ def python_constraint(self) -> VersionConstraint:
219219

220220
@property
221221
def transitive_python_constraint(self) -> VersionConstraint:
222+
warnings.warn(
223+
"'transitive_python_constraint' is deprecated and will be removed.",
224+
DeprecationWarning,
225+
stacklevel=2,
226+
)
222227
if self._transitive_python_constraint is None:
223228
return self._python_constraint
224229

tests/packages/test_dependency.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,10 @@ def test_with_constraint() -> None:
321321
assert new.marker == dependency.marker
322322
assert new.transitive_marker == dependency.transitive_marker
323323
assert new.python_constraint == dependency.python_constraint
324-
assert new.transitive_python_constraint == dependency.transitive_python_constraint
324+
with pytest.warns(DeprecationWarning):
325+
assert (
326+
new.transitive_python_constraint == dependency.transitive_python_constraint
327+
)
325328

326329

327330
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)