Skip to content

Commit

Permalink
Merge pull request #77 from ymyzk/drop-old-style-pypy-key
Browse files Browse the repository at this point in the history
tox4: Drop support of old-style PyPy key (breaking change)
  • Loading branch information
ymyzk committed Sep 4, 2021
2 parents b0426d5 + 676c258 commit cb09894
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -192,7 +192,6 @@ envlist = py3, pypy3
[gh-actions]
python =
3: py3, mypy
# pypy3 are still supported for backward compatibility
pypy-3: pypy3

[testenv]
Expand All @@ -203,6 +202,8 @@ If there are multiple matching Python versions in the configuration, only the mo
For example, if you are running CPython 3.8 and `gh-actions.python` has both `3` and `3.8`,
tox-gh-actions gets factors only from the key `3.8`.

_Changed in 3.0_: `pypy3` is not supported in the configuration anymore. Please use `pypy-3` instead.

#### Factor-Conditional Settings: Environment Variable
You can also use environment variable to decide which environment to run.
The following is an example to install different dependency based on platform.
Expand Down
4 changes: 0 additions & 4 deletions src/tox_gh_actions/plugin.py
Expand Up @@ -119,17 +119,13 @@ def get_python_version_keys():
- CPython 3.8.z => [3.8, 3]
- PyPy 3.6 (v7.3.z) => [pypy-3.6, pypy-3, pypy3]
- Pyston based on Python CPython 3.8.8 (v2.2) => [pyston-3.8, pyston-3]
Support of "pypy2" and "pypy3" is for backward compatibility with
tox-gh-actions v2.2.0 and before.
"""
major_version = str(sys.version_info[0])
major_minor_version = ".".join([str(i) for i in sys.version_info[:2]])
if "PyPy" in sys.version:
return [
"pypy-" + major_minor_version,
"pypy-" + major_version,
"pypy" + major_version,
]
elif hasattr(sys, "pyston_version_info"): # Pyston
return [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Expand Up @@ -314,7 +314,7 @@ def test_get_envlist_from_factors(envlist, factors, expected):
"3.6.9 (1608da62bfc7, Dec 23 2019, 10:50:04)\n"
"[PyPy 7.3.0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]",
(3, 6, 9, "final", 0),
["pypy-3.6", "pypy-3", "pypy3"],
["pypy-3.6", "pypy-3"],
),
],
)
Expand Down

0 comments on commit cb09894

Please sign in to comment.