diff options
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | docs/changelog/1415.bugfix.rst | 1 | ||||
-rw-r--r-- | src/tox/interpreters/py_spec.py | 2 | ||||
-rw-r--r-- | tests/unit/interpreters/test_py_spec.py | 5 |
4 files changed, 8 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index eb611238..e743ba98 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -64,6 +64,7 @@ Morgan Fainberg Nick Douma Nick Prendergast Oliver Bestwalter +Pablo Galindo Paweł Adamczak Philip Thiem Pierre-Jean Campigotto diff --git a/docs/changelog/1415.bugfix.rst b/docs/changelog/1415.bugfix.rst new file mode 100644 index 00000000..89612be8 --- /dev/null +++ b/docs/changelog/1415.bugfix.rst @@ -0,0 +1 @@ +Recognize correctly interpreters that have suffixes (like python3.7-dbg). diff --git a/src/tox/interpreters/py_spec.py b/src/tox/interpreters/py_spec.py index 2df06672..a1d3055a 100644 --- a/src/tox/interpreters/py_spec.py +++ b/src/tox/interpreters/py_spec.py @@ -53,7 +53,7 @@ class PythonSpec(object): if os.path.isabs(base_python): path = base_python else: - match = re.match(r"(python|pypy|jython)(\d)?(?:\.(\d+))?(-(32|64))?", base_python) + match = re.match(r"(python|pypy|jython)(\d)?(?:\.(\d+))?(-(32|64))?$", base_python) if match: groups = match.groups() name = groups[0] diff --git a/tests/unit/interpreters/test_py_spec.py b/tests/unit/interpreters/test_py_spec.py index 48024afd..d538c85a 100644 --- a/tests/unit/interpreters/test_py_spec.py +++ b/tests/unit/interpreters/test_py_spec.py @@ -4,3 +4,8 @@ from tox.interpreters.py_spec import PythonSpec def test_py_3_10(): spec = PythonSpec.from_name("python3.10") assert (spec.major, spec.minor) == (3, 10) + + +def test_debug_python(): + spec = PythonSpec.from_name("python3.10-dbg") + assert (spec.major, spec.minor) == (None, None) |