summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-09-03 16:13:10 +0100
committerBernát Gábor <bgabor8@bloomberg.net>2019-09-03 16:13:10 +0100
commit6cb400e20d8d0d350c1bfb914ecdf09dbfe36a76 (patch)
treebcd851c91a3f19eb8ffdf6a1f35b0fa132e1f28a
parentf39983c9459ea23ecbe3810be2848cfc4e38bf5c (diff)
downloadtox-git-6cb400e20d8d0d350c1bfb914ecdf09dbfe36a76.tar.gz
Correctly recognize interpreters that has suffixes (#1416)
-rw-r--r--CONTRIBUTORS1
-rw-r--r--docs/changelog/1415.bugfix.rst1
-rw-r--r--src/tox/interpreters/py_spec.py2
-rw-r--r--tests/unit/interpreters/test_py_spec.py5
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)