Bug 1798929 - tox runs py39 tests with /usr/bin/python3 Python version [fedora-all]
Summary: tox runs py39 tests with /usr/bin/python3 Python version [fedora-all]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-tox
Version: 30
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1725939
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-06 10:54 UTC by Miro Hrončok
Modified: 2020-02-15 02:54 UTC (History)
4 users (show)

Fixed In Version: python-tox-3.14.3-1.fc32 python-tox-3.13.2-3.fc31 python-tox-3.5.3-4.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-08 02:01:57 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github tox-dev tox pull 1377 None closed Un-hardcode the supported factors again 2020-02-26 10:16:38 UTC

Description Miro Hrončok 2020-02-06 10:54:05 UTC
Description of problem:
tox runs py39 tests with /usr/bin/python3 Python version - i.e. with Python 3.7 on Fedora 30 and 31 or 3.8 on 32. This is extremely dangerous, as it creates false assumptions about the code working on Python 3.9.

Version-Release number of selected component:
python3-tox-3.13.2-2.fc31 also problem in F30 and F32

How reproducible: easy


Steps to Reproduce:
0. dnf install tox python3.9

1. Create tox.ini:

[tox]
envlist = py39
skipsdist = True

[testenv]
commands = python -c 'import sys; print(sys.version)'

2. Run tox:

$ tox


Actual results:

py39 recreate: /home/churchyard/tmp/tox39/.tox/py39
py39 run-test-pre: PYTHONHASHSEED='3890376491'
py39 run-test: commands[0] | python -c 'import sys; print(sys.version)'
3.7.6 (default, Jan 30 2020, 09:44:41) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
____________ summary __________
  py39: commands succeeded
  congratulations :)


Expected results:

py39 recreate: /home/churchyard/tmp/tox39/.tox/py39
py39 run-test-pre: PYTHONHASHSEED='3890376491'
py39 run-test: commands[0] | python -c 'import sys; print(sys.version)'
3.9.0a3 (default, Jan 27 2020, 00:00:00) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
____________ summary __________
  py39: commands succeeded
  congratulations :)


Additional info:
This is an upstream regression fixed in 3.14.0 via https://github.com/tox-dev/tox/pull/1377

Comment 1 Miro Hrončok 2020-02-06 11:14:39 UTC
Also opened https://src.fedoraproject.org/tests/python/pull-request/19

Comment 3 Fedora Update System 2020-02-07 01:04:03 UTC
python-tox-3.5.3-4.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-54c575571e

Comment 4 Fedora Update System 2020-02-07 02:44:39 UTC
python-tox-3.13.2-3.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5a7bc7cd39

Comment 5 Lumír Balhar 2020-02-07 09:46:49 UTC
Testing on Feora 31 with your reproducer and it seems that tox cannot create a virtual environment with Python 3.9:

# tox
py39 create: //.tox/py39
ERROR: invocation failed (exit code 1), logfile: //.tox/py39/log/py39-0.log
======================================================= log start =======================================================
Already using interpreter /usr/bin/python3.9
Using base prefix '/usr'
New python executable in /.tox/py39/bin/python3.9
Also creating executable in /.tox/py39/bin/python
Command /.tox/py39/bin/python3.9 -m pip config list had error code 1
Installing setuptools, pip, wheel...

  Complete output from command /.tox/py39/bin/python3.9 - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 10, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 40, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/cli/autocompletion.py", line 8, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/cli/main_parser.py", line 12, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 25, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_internal/index.py", line 14, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/__init__.py", line 25, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/html5parser.py", line 8, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/_tokenizer.py", line 16, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/_trie/__init__.py", line 3, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/_trie/py.py", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/_trie/_base.py", line 3, in <module>
ImportError: cannot import name 'Mapping' from 'collections' (/.tox/py39/lib64/python3.9/collections/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 13, in <module>
ImportError: cannot import name 'main' from 'pip' (/usr/share/python-wheels/pip-19.1.1-py2.py3-none-any.whl/pip/__init__.py)
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 2617, in <module>
    main()
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 855, in main
    create_environment(
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 1157, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 1007, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 1094, in _install_wheel_with_search_dir
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
  File "/usr/lib/python3.7/site-packages/virtualenv.py", line 958, in call_subprocess
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /.tox/py39/bin/python3.9 - setuptools pip wheel failed with error code 1
Running virtualenv with interpreter /usr/bin/python3.9

======================================================== log end ========================================================
ERROR: InvocationError for command /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3.9 py39 (exited with code 1)
________________________________________________________ summary ________________________________________________________
ERROR:   py39: InvocationError for command /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3.9 py39 (exited with code 1)

Comment 6 Miro Hrončok 2020-02-07 11:01:17 UTC
What is your python-pip-wheel version? Because what you are reporting has been fixed already in https://src.fedoraproject.org/rpms/python-pip/c/b71b777d9e717a82d16d41e4bc2836daeac56ca4?branch=f31 

It is technically possibly to make python39 require python-pip-wheel > 19.1.1-6, but since the version is different on every Fedora, I'd rather just let it be and consider users having up to date systems. If you disagree, the code to add could look like this:


%if 0%{?fedora} >= 32
Requires: python-pip-wheel > 19.3
%else
%if 0%{?fedora} >= 31
Requires: python-pip-wheel > 19.1.1-6
%else
Requires: python-pip-wheel > 19.0.3-5
%endif
%endif

(uglier code, straightforward requires on the result)


Or:


Requires: python-pip-wheel > 19.0.3-5
Requires: (python-pip-wheel > 19.3 if fedora-release >= 32)
Requires: (python-pip-wheel > 19.1.1-6 if fedora-release >= 31)

(straightforward code, uglier requires on the result)

Comment 7 Fedora Update System 2020-02-08 02:01:57 UTC
python-tox-3.13.2-3.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2020-02-15 02:54:18 UTC
python-tox-3.5.3-4.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, 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.