1
0
mirror of https://github.com/fedora-python/tox-current-env.git synced 2025-01-11 08:56:14 +01:00

Drop support for tox < 3.13 (< 3.15 with Python 3.8+)

We have tox 3.13 in Fedora 31 running on Python 3.7
We have tox 3.15 in Fedora 32 running on Python 3.8
This commit is contained in:
Miro Hrončok 2020-08-12 17:04:58 +02:00 committed by Petr Viktorin
parent 12b0f83762
commit 65cb96383b
5 changed files with 28 additions and 23 deletions

View File

@ -19,10 +19,10 @@ jobs:
tox_env:
# This information is repeated in tox.ini
# (see https://github.com/fedora-python/tox-github-action/issues/8)
- py36-tox35
- py37-tox35
- py38-tox35
- py39-tox35
- py36-tox313
- py37-tox313
- py38-tox315
- py39-tox315
- py36-toxrelease
- py37-toxrelease

View File

@ -18,7 +18,13 @@ setup(
package_dir={"": "src"},
packages=find_packages("src"),
entry_points={"tox": ["current-env = tox_current_env.hooks"]},
install_requires=["tox>=3.5"],
install_requires=[
# We support tox 3.13 only to support Fedora 31.
# Fedora's tox 3.13 is patched to support Python 3.8 and 3.9,
# but the one downloaded from PyPI isn't and it doesn't work properly.
"tox>=3.15; python_version >= '3.8'",
"tox>=3.13; python_version < '3.8'",
],
python_requires=">=3.6",
classifiers=[
"Development Status :: 3 - Alpha",

View File

@ -177,13 +177,11 @@ def tox_runtest(venv, redirect):
return True
if hasattr(tox.hookspecs, "tox_cleanup"):
@tox.hookimpl
def tox_cleanup(session):
"""Remove the fake virtualenv not to collide with regular tox
Collisions can happen anyway (when tox is killed forcefully before this happens)
Note that we don't remove real venvs, as recreating them is expensive"""
for venv in session.venv_dict.values():
if is_current_env_link(venv):
rm_venv(venv)
@tox.hookimpl
def tox_cleanup(session):
"""Remove the fake virtualenv not to collide with regular tox
Collisions can happen anyway (when tox is killed forcefully before this happens)
Note that we don't remove real venvs, as recreating them is expensive"""
for venv in session.venv_dict.values():
if is_current_env_link(venv):
rm_venv(venv)

View File

@ -49,8 +49,8 @@ def is_available(python):
TOX_VERSION = version.parse(tox("--version").stdout.split(" ")[0])
TOX38 = TOX_VERSION >= version.parse("3.8")
needs_tox38 = pytest.mark.skipif(not TOX38, reason="This test needs at least tox 3.8")
TOX313 = TOX_VERSION < version.parse("3.14")
needs_py36789 = pytest.mark.skipif(
not all((is_available(f"python3.{x}") for x in range(6, 10))),
@ -195,8 +195,10 @@ def test_regular_run():
assert "/.tox/py39 is the exec_prefix" in lines[3]
assert "congratulations" in result.stdout
for y in 6, 7, 8, 9:
if y == 9 and not TOX38:
# tox 3.5 cannot handle Python 3.9 venvs
if TOX313 and y > 8:
# there is a bug in tox < 3.14,
# it creates venv with /usr/bin/python3 if the version is unknown
# See https://src.fedoraproject.org/rpms/python-tox/pull-request/15
continue
for pkg in "py", "six", "test":
sitelib = DOT_TOX / f"py3{y}/lib/python3.{y}/site-packages"
@ -217,7 +219,6 @@ def test_regular_run_native_toxenv():
assert len(list(sitelib.glob(f"{pkg}-*.dist-info"))) == 1
@needs_tox38
def test_regular_after_current_is_supported():
result = tox("-e", NATIVE_TOXENV, "--current-env")
assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG
@ -237,7 +238,6 @@ def test_regular_after_killed_current_is_not_supported():
assert "--recreate" in result.stderr
@needs_tox38
def test_regular_after_first_deps_only_is_supported():
result = tox("-e", NATIVE_TOXENV, "--print-deps-only")
assert result.stdout.splitlines()[0] == "six"

View File

@ -2,14 +2,15 @@
# This information is repeated in .github/workflows/main.yaml
# (see https://github.com/fedora-python/tox-github-action/issues/8)
envlist = {py36,py37,py38,py39}-tox{35,release,master}
envlist = {py36,py37,py38,py39}-tox{release,master},{py36,py37}-tox313,{py38,py39}-tox315
[testenv]
deps=
pytest
pytest-xdist
packaging
tox35: tox >=3.5,<3.6
tox313: tox >=3.13,<3.14
tox315: tox >=3.15,<3.16
toxrelease: tox
toxmaster: git+https://github.com/tox-dev/tox.git@master
commands =