Skip to content

tox 3.14.2 uses wrong Python interpreters #1484

Closed
@hynek

Description

@hynek

When trying to run a tox env using Python 3.8, it actually uses 3.7 (concretely the system interpreter).

I only noticed it because I used hashes in my lockfiles and my builds started failing due to a lack of a hash to dependency that is need on 3.7 but not on 3.8.

Downgrading to homebrew's 3.14.1 fixes it.

tox -rvv:

using tox.ini: /Users/hynek/Work/rdap-svc/tox.ini (pid 49542)
  removing /Users/hynek/Work/rdap-svc/.tox/log
using tox-3.14.2 from /Users/hynek/.local/pipx/venvs/tox/lib/python3.7/site-packages/tox/__init__.py (pid 49542)
GLOB start: packaging
GLOB sdist-make: /Users/hynek/Work/rdap-svc/setup.py
  removing /Users/hynek/Work/rdap-svc/.tox/dist
[49543] /Users/hynek/Work/rdap-svc$ /Users/hynek/.local/pipx/venvs/tox/bin/python setup.py sdist --formats=zip --dist-dir .tox/dist >.tox/log/GLOB-0.log
running sdist
running egg_info
writing src/rdap_svc.egg-info/PKG-INFO
writing dependency_links to src/rdap_svc.egg-info/dependency_links.txt
writing top-level names to src/rdap_svc.egg-info/top_level.txt
reading manifest file 'src/rdap_svc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '*.txt'
warning: no previously-included files found matching '*.cfg'
warning: no previously-included files found matching '*.rst'
warning: no previously-included files found matching '*.ini'
warning: no previously-included files found matching '*.yml'
warning: no previously-included files found matching '*.yaml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching 'Makefile'
warning: no previously-included files found matching 'conftest.py'
warning: no previously-included files found matching '.envrc'
warning: no previously-included files found matching 'Dockerfile'
warning: no previously-included files found matching 'test-queries.http'
warning: no previously-included files found matching '.dockerignore'
warning: no previously-included files found matching 'Pipfile*'
warning: no previously-included files found matching '*.toml'
warning: no previously-included files found matching '*.paw'
warning: no previously-included files found matching '*.pot'
no previously-included directories found matching 'tests'
no previously-included directories found matching 'deploy'
no previously-included directories found matching 'requirements'
warning: no files found matching '*.md' under directory 'src'
writing manifest file 'src/rdap_svc.egg-info/SOURCES.txt'
running check
warning: check: missing required meta-data: url

warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied

creating rdap-svc-0
creating rdap-svc-0/src
creating rdap-svc-0/src/rdap_svc
creating rdap-svc-0/src/rdap_svc.egg-info
creating rdap-svc-0/src/rdap_svc/templates
copying files to rdap-svc-0...
copying MANIFEST.in -> rdap-svc-0
copying setup.py -> rdap-svc-0
copying src/rdap_svc/__init__.py -> rdap-svc-0/src/rdap_svc
[... MANY LINES... ]
copying src/rdap_svc.egg-info/PKG-INFO -> rdap-svc-0/src/rdap_svc.egg-info
copying src/rdap_svc.egg-info/SOURCES.txt -> rdap-svc-0/src/rdap_svc.egg-info
copying src/rdap_svc.egg-info/dependency_links.txt -> rdap-svc-0/src/rdap_svc.egg-info
copying src/rdap_svc.egg-info/not-zip-safe -> rdap-svc-0/src/rdap_svc.egg-info
copying src/rdap_svc.egg-info/top_level.txt -> rdap-svc-0/src/rdap_svc.egg-info
copying src/rdap_svc/templates/help.html -> rdap-svc-0/src/rdap_svc/templates
Writing rdap-svc-0/setup.cfg
creating '.tox/dist/rdap-svc-0.zip' and adding 'rdap-svc-0' to it
adding 'rdap-svc-0'
adding 'rdap-svc-0/src'
adding 'rdap-svc-0/PKG-INFO'
adding 'rdap-svc-0/MANIFEST.in'
adding 'rdap-svc-0/setup.py'
adding 'rdap-svc-0/setup.cfg'
adding 'rdap-svc-0/src/rdap_svc.egg-info'
adding 'rdap-svc-0/src/rdap_svc'
adding 'rdap-svc-0/src/rdap_svc.egg-info/PKG-INFO'
adding 'rdap-svc-0/src/rdap_svc.egg-info/not-zip-safe'
adding 'rdap-svc-0/src/rdap_svc.egg-info/SOURCES.txt'
adding 'rdap-svc-0/src/rdap_svc.egg-info/top_level.txt'
adding 'rdap-svc-0/src/rdap_svc.egg-info/dependency_links.txt'
[... MANY LINES ...]
removing 'rdap-svc-0' (and everything under it)

GLOB finish: packaging  after 0.43 seconds
copying new sdistfile to '/Users/hynek/.tox/distshare/rdap-svc-0.zip'
package .tmp/package/1/rdap-svc-0.zip links to dist/rdap-svc-0.zip (/Users/hynek/Work/rdap-svc/.tox)
mypy start: getenv /Users/hynek/Work/rdap-svc/.tox/mypy
mypy cannot reuse: -r flag
mypy recreate: /Users/hynek/Work/rdap-svc/.tox/mypy
python3.8 (/Users/hynek/.local/venvs/rdap-svc/bin/python3.8) is {'executable': '/Users/hynek/.local/pipx/venvs/tox/bin/python', 'name': 'python', 'version_info': [3, 8, 0, 'final', 0], 'version': '3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) \n[Clang 6.0 (clang-600.0.57)]', 'is_64': True, 'sysplatform': 'darwin'}
mypy uses /Users/hynek/.local/pipx/venvs/tox/bin/python
  removing /Users/hynek/Work/rdap-svc/.tox/mypy
setting PATH=/Users/hynek/Work/rdap-svc/.tox/mypy/bin:/Users/hynek/.local/venvs/rdap-svc/bin:/Users/hynek/.pyenv/shims:/Users/hynek/.local/bin:/Users/hynek/Library/Python/3.7/bin:/Users/hynek/.poetry/bin:/Users/hynek/.gem/ruby/2.5.0/bin/:/Users/hynek/.gem/ruby/2.6.0/bin/:/usr/local/opt/openssl@1.1/bin:/Users/hynek/Work/go/bin:/Applications/SQLAnywhere17/System/bin64:/usr/local/opt/perl/bin:/Users/hynek/.cargo/bin:/usr/local/opt/gettext/bin:/opt/X11/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[49551] /Users/hynek/Work/rdap-svc/.tox$ /Users/hynek/.local/pipx/venvs/tox/bin/python -m virtualenv --no-download --python /Users/hynek/.local/pipx/venvs/tox/bin/python mypy
Already using interpreter /Users/hynek/.local/pipx/venvs/tox/bin/python
Using base prefix '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7'
New python executable in /Users/hynek/Work/rdap-svc/.tox/mypy/bin/python
Installing setuptools, pip, wheel...
done.
mypy installdeps: -rrequirements/main.txt, -rrequirements/dev.txt
setting PATH=/Users/hynek/Work/rdap-svc/.tox/mypy/bin:/Users/hynek/.local/venvs/rdap-svc/bin:/Users/hynek/.pyenv/shims:/Users/hynek/.local/bin:/Users/hynek/Library/Python/3.7/bin:/Users/hynek/.poetry/bin:/Users/hynek/.gem/ruby/2.5.0/bin/:/Users/hynek/.gem/ruby/2.6.0/bin/:/usr/local/opt/openssl@1.1/bin:/Users/hynek/Work/go/bin:/Applications/SQLAnywhere17/System/bin64:/usr/local/opt/perl/bin:/Users/hynek/.cargo/bin:/usr/local/opt/gettext/bin:/opt/X11/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[49560] /Users/hynek/Work/rdap-svc$ /Users/hynek/Work/rdap-svc/.tox/mypy/bin/python -m pip install -rrequirements/main.txt -rrequirements/dev.txt
Looking in indexes: https://pypi.vm.ag/root/vrmd/+simple/
Collecting attrs==19.3.0
  Using cached https://pypi.vm.ag/root/pypi/%2Bf/08a/96c641c3a74e4/attrs-19.3.0-py2.py3-none-any.whl
[... MANY LINES ...]
Requirement already satisfied: setuptools>=3.0 in ./.tox/mypy/lib/python3.7/site-packages (from gunicorn[setproctitle]==20.0.4->-r requirements/main.txt (line 41)) (41.6.0)
Collecting importlib-metadata>=0.12; python_version < "3.8"
ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    importlib-metadata>=0.12; python_version < "3.8" from https://pypi.vm.ag/root/pypi/%2Bf/d95/141fbfa7ef2ec/importlib_metadata-1.3.0-py2.py3-none-any.whl#sha256=d95141fbfa7ef2ec65cfd945e2af7e5a6ddbd7c8d9a25e66ff3be8e3daf9f60f (from pluggy==0.13.1->-r requirements/dev.txt (line 135))
ERROR: invocation failed (exit code 1)
ERROR: could not install deps [-rrequirements/main.txt, -rrequirements/dev.txt]; v = InvocationError('/Users/hynek/Work/rdap-svc/.tox/mypy/bin/python -m pip install -rrequirements/main.txt -rrequirements/dev.txt', 1)
mypy finish: getenv /Users/hynek/Work/rdap-svc/.tox/mypy after 32.84 seconds
__________________________________________________________________________ summary ___________________________________________________________________________
ERROR:   mypy: could not install deps [-rrequirements/main.txt, -rrequirements/dev.txt]; v = InvocationError('/Users/hynek/Work/rdap-svc/.tox/mypy/bin/python -m pip install -rrequirements/main.txt -rrequirements/dev.txt', 1)
cleanup /Users/hynek/Work/rdap-svc/.tox/.tmp/package/1/rdap-svc-0.zip

Please note:

Using base prefix '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7'

which leads to:

$ /Users/hynek/.local/pipx/venvs/tox/bin/python
Python 3.7.3 (default, Nov 15 2019, 04:04:52)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Please also note that Python 3.8 is the Python interpreter in the active virtualenv (but tox is not ran out of that virtualenv. It uses the Catalina system 3.7 installed using pipx). IOW it uses the tox interpreter, so I suspect a connection here (homebrew's tox also uses 3.7, just not the system's).

Could this be related to #1462?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions