1
0
mirror of https://github.com/fedora-python/tox-current-env.git synced 2025-11-11 21:35:37 +01:00

Only use old virtualenv with old tox

Fixes https://github.com/fedora-python/tox-current-env/issues/74
This commit is contained in:
Miro Hrončok
2024-10-22 17:35:13 +02:00
parent 0c125a3c7f
commit 0cf27856f8
4 changed files with 12 additions and 3 deletions

View File

@@ -83,11 +83,17 @@ def is_available(python):
return True
@functools.lru_cache()
def drop_unsupported_pythons(envlist):
return envlist[len("py36,py37,"):] if TOX4 else envlist
@functools.lru_cache()
def envs_from_tox_ini():
cp = ConfigParser()
cp.read(FIXTURES_DIR / "tox.ini")
return cp["tox"]["envlist"].split(",")
envlist = drop_unsupported_pythons(cp["tox"]["envlist"])
return envlist.split(",")
def tox_footer(envs=None, spaces=8):