diff --git a/tests/conftest.py b/tests/conftest.py index 87ddbc2..4c52a0a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -31,6 +31,8 @@ # Version of pip to test micropipenv with # the default is the pip wheel bundled in virtualenv package MICROPIPENV_TEST_PIP_VERSION = os.getenv("MICROPIPENV_TEST_PIP_VERSION") +# For some very old pips, we have to limit also setuptools version +MICROPIPENV_TEST_SETUPTOOLS_VERSION = os.getenv("MICROPIPENV_TEST_SETUPTOOLS_VERSION") # pip version used in tests, assigned using pytest_configure PIP_VERSION = None @@ -46,6 +48,9 @@ def _venv_install_pip(venv): else: venv.install(f"pip{MICROPIPENV_TEST_PIP_VERSION}") + if MICROPIPENV_TEST_SETUPTOOLS_VERSION is not None: + venv.install(f"setuptools{MICROPIPENV_TEST_SETUPTOOLS_VERSION}") + def pytest_configure(config): """Configure tests before pytest collects tests.""" diff --git a/tox.ini b/tox.ini index afadc1e..62ea835 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,10 @@ deps = tomli: tomli setenv = # platform-python-pip and python27-pip in RHEL8 - pip90: MICROPIPENV_TEST_PIP_VERSION = >=9.0,<10.0 + # pip 9 seems not to be compatible with the latest setuptools + # so we are using the same version we have in RHEL 8 + pip90: MICROPIPENV_TEST_PIP_VERSION = >=9.0,<10.0 + pip90: MICROPIPENV_TEST_SETUPTOOLS_VERSION = <60 # older version in Python 3.8 module pip192: MICROPIPENV_TEST_PIP_VERSION = >=19.2,<19.3 # first version with manylinux2014 support, Python 3.8 module, Fedora 32