Skip to content

Commit

Permalink
fix python_constraint_from_marker() again
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Aug 24, 2022
1 parent c9348e8 commit 1b95368
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/poetry/core/packages/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def normalize_python_version_markers( # NOSONAR
ands = []
for op, version in or_:
# Expand python version
if op == "==" and "*" not in version:
if op == "==" and "*" not in version and version.count(".") < 2:
version = "~" + version
op = ""

Expand Down
5 changes: 5 additions & 0 deletions tests/packages/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def test_convert_markers(
'python_version >= "3.5" and python_full_version != "3.7.6"',
">=3.5,<3.7.6 || >3.7.6",
),
# Full exact version
(
'python_full_version == "3.6.1"',
"3.6.1",
),
],
)
def test_get_python_constraint_from_marker(marker: str, constraint: str) -> None:
Expand Down

0 comments on commit 1b95368

Please sign in to comment.