Bug 2427756 - tox py36 environment doesn't work even with python3.6 installed
Summary: tox py36 environment doesn't work even with python3.6 installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-virtualenv
Version: 43
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2428252
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-01-08 00:53 UTC by Adam Williamson
Modified: 2026-01-22 01:14 UTC (History)
5 users (show)

Fixed In Version: python-virtualenv-20.35.4-3.fc44 python-virtualenv-20.35.4-3.fc43 python-virtualenv-20.29.1-6.fc42
Clone Of:
Environment:
Last Closed: 2026-01-20 01:42:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-virtualenv pull-request 159 0 None None None 2026-01-09 11:01:49 UTC
Fedora Package Sources python-virtualenv pull-request 160 0 None None None 2026-01-09 11:01:49 UTC
Fedora Package Sources python-virtualenv pull-request 161 0 None None None 2026-01-09 11:39:45 UTC

Description Adam Williamson 2026-01-08 00:53:18 UTC
Even with the python3.6 package installed, you can't use the 'py36' tox environment on Fedora 43. If you run tox with `-v`, you can see this error:

py36: 161 I failed to query /usr/bin/python3.6 with code 1 err: '  File "/usr/lib/python3.14/site-packages/virtualenv/discovery/py_info.py", line 7\n    from __future__ import annotations\n    ^\nSyntaxError: future feature annotations is not defined\n' [virtualenv/discovery/cached_py_info.py:36]

This was changed upstream in https://github.com/pypa/virtualenv/pull/2548 in 2023, so it may have been around for a while and I just didn't notice.

I'm filing this downstream as I think it was intentional on upstream's part, they don't care to support 3.6 any more as it's long EOL upstream. Caring about it is kind of a Red Hat Extended Universe thing, because it's still the system Python in EL 8 (which is why I still kinda want to test things against it if possible, especially things there's an EPEL 8 build of).

Comment 1 Lumír Balhar 2026-01-09 00:59:18 UTC
Hello. Thank you for the report. It's unfortunate, but tox does not support EOL Pythons as long as we do. This behavior is documented with a workaround you can use, see: https://tox.wiki/en/latest/faq.html#testing-end-of-life-python-versions

Unfortunately, it's currently not possible to use tox with Python 3.6 and 3.15. If you need that combo, follow this discussion: https://github.com/tox-dev/tox/issues/3656

Currently, I don't think there is anything I can do on RPM level to make this less painful.

Comment 2 Adam Williamson 2026-01-09 01:37:19 UTC
Well, we could patch all the `from __future__ import annotations` calls to handle failure, for a start. But of course if they've started using other post-3.6 features that won't help.

Will the workaround actually work? Will tox notice the packaged virtualenv is too new and get an older one from pypi or something?

Comment 3 Miro Hrončok 2026-01-09 10:28:33 UTC
(In reply to Adam Williamson from comment #2)
> Will the workaround actually work? Will tox notice the packaged virtualenv
> is too new and get an older one from pypi or something?

Yes. It will create a "provision" venv with tox and an older virtualenv and delegate itself to it. It's rather magical, and of course, it no longer uses our RPM-packaged wheels.

Comment 4 Miro Hrončok 2026-01-09 10:36:16 UTC
(In reply to Adam Williamson from comment #2)
> Well, we could patch all the `from __future__ import annotations` calls to
> handle failure, for a start. But of course if they've started using other
> post-3.6 features that won't help.

I'm not quite sure we can pull an effort to patch virtualenv to support older Pythons. But maybe we can at least see how much effort that would be. I am afraid that eventually it will become unbearable.

Comment 5 Miro Hrončok 2026-01-09 10:44:17 UTC
OK, this is not that bad as I thought.

The following two changes are the only things needed to create Python 3.6 virtualenvs (with virtualenv directly or tox) in virtualenv 20.35.4:

$ sed -i '/from __future__ import annotations/d' $(grep -r 'from __future__ import annotations' venv/lib64/python3.14/site-packages/virtualenv -l)
$ sed -i 's/ -> PythonInfo/ -> "PythonInfo"/' venv/lib64/python3.14/site-packages/virtualenv/discovery/py_info.py

Comment 6 Miro Hrončok 2026-01-09 11:01:49 UTC
Well, at least for now, we can do this and postpone the problem to some later date.

I opened:

https://src.fedoraproject.org/rpms/python-virtualenv/pull-request/159
https://src.fedoraproject.org/rpms/python-virtualenv/pull-request/160

Would appreciate some testing.

Comment 7 Miro Hrončok 2026-01-09 11:25:42 UTC
This works nicely on Python 3.14 where "from __future__ import annotations" is implicit.

On Fedora 42, I am afraid this might be a tad more tedious :( But I'll see how much.

Comment 8 Miro Hrončok 2026-01-09 11:39:45 UTC
After further examination, we don't need to drop "from __future__ import annotations"  from anything but src/virtualenv/discovery/py_info.py

This makes it a much more sustainable approach than I originally expected. Too bad upstream does not want to support this :(

Fedorsa 42: https://src.fedoraproject.org/rpms/python-virtualenv/pull-request/161

Comment 9 Fedora Update System 2026-01-13 10:34:35 UTC
FEDORA-2026-95e5c9f82c (python-virtualenv-20.35.4-3.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-95e5c9f82c

Comment 10 Fedora Update System 2026-01-13 10:38:24 UTC
FEDORA-2026-95e5c9f82c (python-virtualenv-20.35.4-3.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2026-01-13 10:40:23 UTC
FEDORA-2026-995bb86cb3 (python-virtualenv-20.29.1-6.fc42 and python-wheel0.37-0.37.1-29.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-995bb86cb3

Comment 12 Fedora Update System 2026-01-13 10:40:24 UTC
FEDORA-2026-f4f2c6bb32 (python-virtualenv-20.35.4-3.fc43 and python-wheel0.37-0.37.1-30.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-f4f2c6bb32

Comment 13 Fedora Update System 2026-01-14 01:32:39 UTC
FEDORA-2026-995bb86cb3 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-995bb86cb3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-995bb86cb3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2026-01-14 01:48:54 UTC
FEDORA-2026-f4f2c6bb32 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-f4f2c6bb32`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-f4f2c6bb32

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2026-01-20 01:42:26 UTC
FEDORA-2026-f4f2c6bb32 (python-virtualenv-20.35.4-3.fc43 and python-wheel0.37-0.37.1-30.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2026-01-22 01:14:15 UTC
FEDORA-2026-995bb86cb3 (python-virtualenv-20.29.1-6.fc42 and python-wheel0.37-0.37.1-29.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.