From 1b953682ae611c929d4e76c40f32a8dc0b9c9fa5 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Wed, 24 Aug 2022 17:41:19 +0100 Subject: [PATCH] fix python_constraint_from_marker() again --- src/poetry/core/packages/utils/utils.py | 2 +- tests/packages/utils/test_utils.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/poetry/core/packages/utils/utils.py b/src/poetry/core/packages/utils/utils.py index c5d059946..dc6e8e124 100644 --- a/src/poetry/core/packages/utils/utils.py +++ b/src/poetry/core/packages/utils/utils.py @@ -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 = "" diff --git a/tests/packages/utils/test_utils.py b/tests/packages/utils/test_utils.py index 2afc8d3a4..f64550e0d 100644 --- a/tests/packages/utils/test_utils.py +++ b/tests/packages/utils/test_utils.py @@ -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: