Skip to content

Commit

Permalink
Add GraalPy and test both GraalPy and Jython env identifiers (#3312)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel authored Jul 23, 2024
1 parent e6b9803 commit 17435df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/3312.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add "graalpy" prefix as a supported base python
1 change: 1 addition & 0 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ implementations of Python and provide default values for ``base_python``:
- ``cpythonNM``: configures ``basepython = cpythonN.M``
- ``ironpythonNM``: configures ``basepython = ironpythonN.M``
- ``rustpythonNM``: configures ``basepython = rustpythonN.M``
- ``graalpyNM``: configures ``basepython = graalpyN.M``

You can also specify these factors with a period between the major and minor versions (e.g. ``pyN.M``), without a minor
version (e.g. ``pyN``), or without any version information whatsoever (e.g. ``py``)
Expand Down
2 changes: 1 addition & 1 deletion src/tox/tox_env/python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def version_dot(self) -> str:
PY_FACTORS_RE = re.compile(
r"""
^(?!py$) # don't match 'py' as it doesn't provide any info
(?P<impl>py|pypy|cpython|jython|rustpython|ironpython) # the interpreter; most users will simply use 'py'
(?P<impl>py|pypy|cpython|jython|graalpy|rustpython|ironpython) # the interpreter; most users will simply use 'py'
(?P<version>[2-9]\.?[0-9]?[0-9]?)?$ # the version; one of: MAJORMINOR, MAJOR.MINOR
""",
re.VERBOSE,
Expand Down
2 changes: 2 additions & 0 deletions tests/tox_env/python/test_python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def test_diff_msg_no_diff() -> None:
("py3.12", "py3.12"),
("pypy2", "pypy2"),
("rustpython3", "rustpython3"),
("graalpy", "graalpy"),
("jython", "jython"),
("cpython3.8", "cpython3.8"),
("ironpython2.7", "ironpython2.7"),
("functional-py310", "py310"),
Expand Down

0 comments on commit 17435df

Please sign in to comment.