Skip to content

Commit 5827647

Browse files
committed
consistent representations
1 parent f42758e commit 5827647

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/poetry/core/constraints/generic/constraint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def __hash__(self) -> int:
214214
return hash((self._operator, self._value))
215215

216216
def __str__(self) -> str:
217-
space = " " if self._operator in {"in", "not in"} else ""
217+
if self._operator in {"in", "not in"}:
218+
return f"'{self._value}' {self._operator}"
218219
op = self._operator if self._operator != "==" else ""
219-
return f"{op}{space}{self._value}"
220+
return f"{op}{self._value}"

tests/version/test_markers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def test_parse_marker(marker: str) -> None:
114114
"platform_machine",
115115
"!=aarch64, !=loongarch64",
116116
),
117-
('"tegra" not in platform_release', "platform_release", "not in tegra"),
118-
('"rpi-v8" in platform_release', "platform_release", "in rpi-v8"),
117+
('"tegra" not in platform_release', "platform_release", "'tegra' not in"),
118+
('"rpi-v8" in platform_release', "platform_release", "'rpi-v8' in"),
119119
],
120120
)
121121
def test_parse_single_marker(

0 commit comments

Comments
 (0)