Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider relaxing virtualenv minimum version requirement #3130

Closed
hashar opened this issue Sep 21, 2023 · 3 comments
Closed

Consider relaxing virtualenv minimum version requirement #3130

hashar opened this issue Sep 21, 2023 · 3 comments

Comments

@hashar
Copy link
Contributor

hashar commented Sep 21, 2023

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)
@hashar hashar changed the title Stop pinning virtualenv to a too recent version unless required Consider relaxing virtualenv minimum version requirement Sep 21, 2023
@gaborbernat
Copy link
Member

The alternative solution is the right solution. We do not test with the latest virtualenv inside the CI so there's no way to know it actually works or not.

@hashar
Copy link
Contributor Author

hashar commented Dec 14, 2023

The way I worked around it is to install the latest tox (to benefit from its bug fixes) then downgrade virtualenv to eg 20.21.1 (to keep supporting some older python versions).

What I do not understand is why virtualenv keeps being bumped automatically apparently without good reasons beyond tracking upstream. Then I guess it is to also have tox to support the latest python availables. That is tricky.

@gaborbernat gaborbernat closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@gaborbernat
Copy link
Member

We do not test with the latest virtualenv inside the CI so there's no way to know it actually works or not.

This is the reason.

@tox-dev tox-dev locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants