Skip to content

Fix outdated min version of virtualenv#3829

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
kajinamit:fix-venv
Feb 25, 2026
Merged

Fix outdated min version of virtualenv#3829
gaborbernat merged 1 commit intotox-dev:mainfrom
kajinamit:fix-venv

Conversation

@kajinamit
Copy link
Contributor

@kajinamit kajinamit commented Feb 25, 2026

The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 .

[1] #3815

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

gaborbernat
gaborbernat previously approved these changes Feb 25, 2026
@gaborbernat gaborbernat enabled auto-merge (squash) February 25, 2026 15:07
auto-merge was automatically disabled February 25, 2026 15:07

Head branch was pushed to by a user without write access

The recent 4.46.0 release introduced the feature[1] which requires
virtualenv>=20.39.0 .

[1] tox-dev#3815
@gaborbernat gaborbernat enabled auto-merge (squash) February 25, 2026 15:13
@gaborbernat gaborbernat merged commit dde9a37 into tox-dev:main Feb 25, 2026
28 checks passed
@kajinamit kajinamit deleted the fix-venv branch February 25, 2026 16:39
@stephenfin
Copy link
Contributor

stephenfin commented Feb 25, 2026

@gaborbernat Would it be possible to yank the broken releases?

❯ cat constraints.txt
virtualenv===20.38.0

❯ cat tox.ini
[testenv]
deps =
  requests
❯ virtualenv .venv
❯ source .venv/bin/activate
❯ pip install -c constraint.txt tox
Collecting tox
  Using cached tox-4.46.3-py3-none-any.whl.metadata (3.6 kB)
Collecting cachetools>=7.0.1 (from tox)
  Using cached cachetools-7.0.1-py3-none-any.whl.metadata (5.6 kB)
Collecting colorama>=0.4.6 (from tox)
  Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting filelock>=3.24.3 (from tox)
  Using cached filelock-3.24.3-py3-none-any.whl.metadata (2.0 kB)
Collecting packaging>=26 (from tox)
  Using cached packaging-26.0-py3-none-any.whl.metadata (3.3 kB)
Collecting platformdirs>=4.9.2 (from tox)
  Using cached platformdirs-4.9.2-py3-none-any.whl.metadata (4.7 kB)
Collecting pluggy>=1.6 (from tox)
  Using cached pluggy-1.6.0-py3-none-any.whl.metadata (4.8 kB)
Collecting pyproject-api>=1.10 (from tox)
  Using cached pyproject_api-1.10.0-py3-none-any.whl.metadata (2.7 kB)
INFO: pip is looking at multiple versions of tox to determine which version is compatible with other requirements. This could take a while.
Collecting tox
  Using cached tox-4.46.2-py3-none-any.whl.metadata (3.6 kB)
Collecting virtualenv>=20.38 (from tox)
  Using cached virtualenv-20.38.0-py3-none-any.whl.metadata (5.1 kB)
Collecting distlib<1,>=0.3.7 (from virtualenv>=20.38->tox)
  Using cached distlib-0.4.0-py2.py3-none-any.whl.metadata (5.2 kB)
Using cached tox-4.46.2-py3-none-any.whl (201 kB)
Using cached cachetools-7.0.1-py3-none-any.whl (13 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached filelock-3.24.3-py3-none-any.whl (24 kB)
Using cached packaging-26.0-py3-none-any.whl (74 kB)
Using cached platformdirs-4.9.2-py3-none-any.whl (21 kB)
Using cached pluggy-1.6.0-py3-none-any.whl (20 kB)
Using cached pyproject_api-1.10.0-py3-none-any.whl (13 kB)
Using cached virtualenv-20.38.0-py3-none-any.whl (5.8 MB)
Using cached distlib-0.4.0-py2.py3-none-any.whl (469 kB)
Installing collected packages: distlib, pluggy, platformdirs, packaging, filelock, colorama, cachetools, virtualenv, pyproject-api, tox
Successfully installed cachetools-7.0.1 colorama-0.4.6 distlib-0.4.0 filelock-3.24.3 packaging-26.0 platformdirs-4.9.2 pluggy-1.6.0 pyproject-api-1.10.0 tox-4.46.2 virtualenv-20.38.0

[notice] A new release of pip is available: 25.1.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
❯ tox --version
4.46.2 from /tmp/foo/.venv/lib/python3.14/site-packages/tox/__init__.py

❯ tox -e py310
py310: internal error
Traceback (most recent call last):
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/session/cmd/run/single.py", line 51, in _evaluate
    tox_env.setup()
    ~~~~~~~~~~~~~^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/api.py", line 299, in setup
    self._setup_env()
    ~~~~~~~~~~~~~~~^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/runner.py", line 145, in _setup_env
    super()._setup_env()
    ~~~~~~~~~~~~~~~~~~^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 279, in _setup_env
    self.ensure_python_env()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 283, in ensure_python_env
    conf = self.python_cache()
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/virtual_env/api.py", line 95, in python_cache
    base = super().python_cache()
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 320, in python_cache
    "version_info": list(self.base_python.version_info),
                         ^^^^^^^^^^^^^^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 326, in base_python
    base_pythons: list[str] = self.conf["base_python"]
                              ~~~~~~~~~^^^^^^^^^^^^^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/config/sets.py", line 150, in __getitem__
    return self.load(item)
           ~~~~~~~~~^^^^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/config/sets.py", line 162, in load
    return config_definition.__call__(self._conf, self.loaders, ConfigLoadArgs(chain, self.name, self.env_name))  # noqa: PLC2801
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/config/of_type.py", line 123, in __call__
    value = self.post_process(value)
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 95, in validate_base_python
    return self._validate_base_python(self.name, value, self.core["ignore_base_python_conflict"])
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 224, in _validate_base_python
    if any(
       ^^^
  File "/tmp/foo/.venv/lib/python3.14/site-packages/tox/tox_env/python/api.py", line 227, in <genexpr>
    if getattr(spec_name, key) is not None
       ~~~~~~~^^^^^^^^^^^^^^^^
AttributeError: 'PythonSpec' object has no attribute 'machine'
  py310: FAIL code 2 (0.00 seconds)
  evaluation failed :( (0.03 seconds)

This affects 4.46.0 - 4.46.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants