Skip to content

Consider relaxing virtualenv minimum version requirement #3130

@hashar

Description

@hashar

What's the problem this feature will solve?

#3013 upgrades several requirements and notably raises virtualenv from >=20.21 to >=20.23. That breaks Testing end-of-life Python versions which instructs to do:

[tox]
requires = virtualenv<20.22.0

That fails due to tox 4.5.2+ requiring virtualenv>20.23, though one can add requires = tox<4.5.2, they will loose the benefit of using a newer tox version.

The virtualenv requirement got further bumped by:

PR requirement
#3035 virtualenv>=20.23.1
#3072 virtualenv>=20.24.1
#3091 virtualenv>=20.24.3

For each of those pull requests, it looks like the requirement has been bumped automatically even when a change clearly does not justify an upgrade of the minimal version (for example #3072 simply fix a broken link in a rst documentation file).

Describe the solution you'd like

I went to change pyproject.toml of main to require virtualenv<20.22.0 and the full test suite is passing. It seems thus the virtualenv requirement can be relaxed to make it possible to use an older virtualenv.

Alternative Solutions

Change the docs.faq.rst for //Testing end-of-life Python versions// to pin tox to 4.5.1 which is the last version not requiring virtualenv 20.22.0 or later:

[tox]
requires = tox==4.5.1
           virtualenv<20.22.0

The drawback of that solution is one is stuck to tox 4.5.1 :-(

Additional context

I have the use case to create testenv with older python versions. Example:

[tox]
minversion = 4.8.0
requires =
# We still need Python 3.6 support
# See https://github.com/tox-dev/tox/blob/main/docs/faq.rst#testing-end-of-life-python-versions
    virtualenv<20.22.0
$ tox3
.tox create: /path/to/.tox/.tox
.tox installdeps: virtualenv<20.22.0, tox >= 4.8.0
...
ERROR: Cannot install tox==4.10.0, tox==4.11.0, tox==4.11.1, tox==4.11.2, tox==4.11.3, tox==4.8.0, tox==4.9.0 and virtualenv==20.21.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested virtualenv==20.21.1
    tox 4.11.3 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.11.2 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.11.1 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.11.0 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.10.0 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.9.0 depends on virtualenv>=20.24.3
    The user requested virtualenv==20.21.1
    tox 4.8.0 depends on virtualenv>=20.24.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

ERROR: could not install deps [virtualenv==20.21.1, tox >= 4.8.0];
v = InvocationError("/home/hashar/projects/pywikibot/core/.tox/.tox/bin/python -m pip install virtualenv==20.21.1 'tox >= 4.8.0'", 1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions