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

ignore_basepython_conflict option is not in effect in tox4 #2754

Closed
dkolvakh opened this issue Dec 19, 2022 · 7 comments · Fixed by #2824
Closed

ignore_basepython_conflict option is not in effect in tox4 #2754

dkolvakh opened this issue Dec 19, 2022 · 7 comments · Fixed by #2824
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@dkolvakh
Copy link

dkolvakh commented Dec 19, 2022

Issue

Seems ignore_basepython_conflict option is not in effect in tox4. Setting it up to True or False doesn't change anything if envlist contains py310 but python3 points to python3.8.

Environment

Provide at least:

  • OS: Linux Mint 20.3, running in VirtualBox
  • pip list of the host Python where tox is installed:
Package               Version             
--------------------- --------------------
appdirs               1.4.3               
apt-clone             0.2.1               
apturl                0.5.2               
astunparse            1.6.3               
attrs                 22.1.0              
autopage              0.5.1               
beautifulsoup4        4.8.2               
blinker               1.4                 
Brlapi                0.7.0               
ccsm                  0.9.14.1            
certifi               2019.11.28          
chardet               3.0.4               
Click                 7.0                 
cliff                 4.0.0               
cmd2                  2.4.2               
colorama              0.4.3               
command-not-found     0.3                 
compizconfig-python   0.9.14.1            
configobj             5.0.6               
coverage              6.4.4               
cryptography          2.8                 
cupshelpers           1.0                 
dbus-python           1.2.16              
ddt                   1.6.0               
defer                 1.0.6               
distlib               0.3.0               
distro                1.4.0               
entrypoints           0.3                 
execnet               1.9.0               
extras                1.0.0               
filelock              3.0.12              
fixtures              4.0.1               
flake8                6.0.0               
future                0.18.2              
glob2                 0.7                 
grpcio                1.16.1              
hammett               0.9.3               
httplib2              0.14.0              
idna                  2.8                 
ifaddr                0.1.6               
IMDbPY                6.8                 
importlib-metadata    4.12.0              
iniconfig             1.1.1               
junit-xml             1.8                 
keyring               18.0.1              
launchpadlib          1.10.13             
lazr.restfulclient    0.14.2              
lazr.uri              1.0.3               
linecache2            1.0.0               
logutils              0.3.5               
louis                 3.12.0              
lxml                  4.5.0               
Mako                  1.1.0               
MarkupSafe            1.1.0               
mccabe                0.7.0               
more-itertools        4.2.0               
mutmut                2.4.1               
netaddr               0.7.19              
netifaces             0.10.4              
oauthlib              3.1.0               
onboard               1.4.1               
packaging             20.3                
parso                 0.8.3               
pbr                   5.4.5               
pexpect               4.6.0               
Pillow                7.0.0               
pip                   20.0.2              
pluggy                0.13.0              
pony                  0.7.16              
prettytable           3.4.1               
protobuf              3.6.1               
psutil                5.5.1               
py                    1.11.0              
pycairo               1.16.2              
pycodestyle           2.10.0              
pycrypto              2.6.1               
pycups                1.9.73              
pycurl                7.43.0.2            
pyflakes              3.0.1               
Pygments              2.3.1               
PyGObject             3.36.0              
PyICU                 2.4.2               
PyJWT                 1.7.1               
pymacaroons           0.13.0              
PyNaCl                1.3.0               
pyparsing             2.4.6               
pyparted              3.11.2              
pyperclip             1.8.2               
pytest                7.1.3               
pytest-cov            3.0.0               
pytest-forked         1.4.0               
pytest-html           3.1.1               
pytest-metadata       2.0.2               
pytest-xdist          2.5.0               
python-apt            2.0.0+ubuntu0.20.4.8
python-debian         0.1.36ubuntu1       
python-magic          0.4.16              
python-subunit        1.4.0               
python-xapp           2.2.1               
python-xlib           0.23                
pyxdg                 0.26                
PyYAML                5.3.1               
reportlab             3.5.34              
requests              2.22.0              
requests-file         1.4.3               
requests-unixsocket   0.2.0               
SecretStorage         2.3.1               
setproctitle          1.1.10              
setuptools            57.4.0              
simplejson            3.16.0              
six                   1.14.0              
soupsieve             1.9.5               
stestr                4.0.0               
stevedore             4.0.0               
systemd-python        234                 
testresources         2.0.0               
testtools             2.5.0               
tldextract            2.2.1               
toml                  0.10.0              
tomli                 2.0.1               
tox                   3.13.2              
traceback2            1.4.0               
ubuntu-drivers-common 0.0.0               
ufw                   0.36                
Unidecode             1.1.1               
unittest2             1.1.0               
urllib3               1.25.8              
vboxapi               1.0                 
virtualenv            20.0.17             
voluptuous            0.13.1              
wadllib               1.3.3               
wcwidth               0.2.5               
wheel                 0.34.2              
xkit                  0.0.0               
youtube-dl            2021.4.26           
zipp                  1.0.0  

Output of running tox

Provide the output of tox -rvv:

using tox.ini: /home/dk/tox/pythonProject/tox.ini (pid 84121)
  removing /home/dk/tox/pythonProject/.tox/log
could not satisfy requires MissingDependency(<Requirement('tox>=3.18.0')>)
using tox-3.13.2 from /usr/local/lib/python3.8/dist-packages/tox/__init__.py (pid 84121)
.tox start: getenv /home/dk/tox/pythonProject/.tox/.tox
.tox cannot reuse: -r flag
.tox recreate: /home/dk/tox/pythonProject/.tox/.tox
/usr/bin/python3 (/usr/bin/python3) is {'executable': '/usr/bin/python3', 'name': 'python', 'version_info': [3, 8, 10, 'final', 0], 'version': '3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', 'is_64': True, 'sysplatform': 'linux'}
.tox uses /usr/bin/python3
  removing /home/dk/tox/pythonProject/.tox/.tox
setting PATH=/home/dk/tox/pythonProject/.tox/.tox/bin:/home/dk/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[84125] /home/dk/tox/pythonProject/.tox$ /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3 .tox
created virtual environment CPython3.8.10.final.0-64 in 120ms
  creator CPython3Posix(dest=/home/dk/tox/pythonProject/.tox/.tox, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/dk/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
.tox installdeps: tox >= 3.18.0
setting PATH=/home/dk/tox/pythonProject/.tox/.tox/bin:/home/dk/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[84134] /home/dk/tox/pythonProject$ /home/dk/tox/pythonProject/.tox/.tox/bin/python -m pip install 'tox >= 3.18.0'
Collecting tox>=3.18.0
  Using cached tox-4.0.14-py3-none-any.whl (143 kB)
Collecting packaging>=22
  Using cached packaging-22.0-py3-none-any.whl (42 kB)
Collecting colorama>=0.4.6
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting tomli>=2.0.1; python_version < "3.11"
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting cachetools>=5.2
  Using cached cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting virtualenv>=20.17.1
  Using cached virtualenv-20.17.1-py3-none-any.whl (8.8 MB)
Collecting filelock>=3.8.2
  Using cached filelock-3.8.2-py3-none-any.whl (10 kB)
Collecting chardet>=5.1
  Using cached chardet-5.1.0-py3-none-any.whl (199 kB)
Collecting platformdirs>=2.6
  Using cached platformdirs-2.6.0-py3-none-any.whl (14 kB)
Collecting pluggy>=1
  Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting pyproject-api>=1.2.1
  Using cached pyproject_api-1.2.1-py3-none-any.whl (11 kB)
Collecting distlib<1,>=0.3.6
  Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Installing collected packages: packaging, colorama, tomli, cachetools, platformdirs, distlib, filelock, virtualenv, chardet, pluggy, pyproject-api, tox
Successfully installed cachetools-5.2.0 chardet-5.1.0 colorama-0.4.6 distlib-0.3.6 filelock-3.8.2 packaging-22.0 platformdirs-2.6.0 pluggy-1.0.0 pyproject-api-1.2.1 tomli-2.0.1 tox-4.0.14 virtualenv-20.17.1
.tox finish: getenv /home/dk/tox/pythonProject/.tox/.tox after 3.19 seconds
.tox start: finishvenv 
write config to /home/dk/tox/pythonProject/.tox/.tox/.tox-config1 as 'cd74d88a9a263f1797fd10436370f4cf /usr/bin/python3\n3.13.2 0 1 0\n00000000000000000000000000000000 tox >= 3.18.0'
.tox finish: finishvenv  after 0.01 seconds
.tox start: provision 
[84140] /home/dk/tox/pythonProject$ /home/dk/tox/pythonProject/.tox/.tox/bin/python -m tox -rvv
py310: 143 I find interpreter for spec PythonSpec(major=3) [virtualenv/discovery/builtin.py:56]
py310: 143 D discover exe for PythonInfo(spec=CPython3.8.10.final.0-64, exe=/home/dk/tox/pythonProject/.tox/.tox/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:437]
py310: 143 D filesystem is case-sensitive [virtualenv/info.py:24]
py310: 144 D got python info of /usr/bin/python3.8 from /home/dk/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json [virtualenv/app_data/via_disk_folder.py:129]
py310: 144 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/dk/tox/pythonProject/.tox/.tox/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
py310: 144 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/dk/tox/pythonProject/.tox/.tox/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
py310: 172 I create virtual environment via CPython3Posix(dest=/home/dk/tox/pythonProject/.tox/.tox/py310, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
py310: 173 D create folder /home/dk/tox/pythonProject/.tox/.tox/py310/bin [virtualenv/util/path/_sync.py:9]
py310: 173 D create folder /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages [virtualenv/util/path/_sync.py:9]
py310: 173 D write /home/dk/tox/pythonProject/.tox/.tox/py310/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
py310: 173 D 	home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D 	base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
py310: 173 D symlink /usr/bin/python3.8 to /home/dk/tox/pythonProject/.tox/.tox/py310/bin/python [virtualenv/util/path/_sync.py:28]
py310: 174 D create virtualenv import hook file /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
py310: 174 D create /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
py310: 174 D ============================== target debug ============================== [virtualenv/run/session.py:50]
py310: 174 D debug via /home/dk/tox/pythonProject/.tox/.tox/py310/bin/python /home/dk/tox/pythonProject/.tox/.tox/lib/python3.8/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
py310: 174 D {
  "sys": {
    "executable": "/home/dk/tox/pythonProject/.tox/.tox/py310/bin/python",
    "_base_executable": "/home/dk/tox/pythonProject/.tox/.tox/py310/bin/python",
    "prefix": "/home/dk/tox/pythonProject/.tox/.tox/py310",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/dk/tox/pythonProject/.tox/.tox/py310",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [virtualenv/run/session.py:51]
py310: 201 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/dk/.local/share/virtualenv) [virtualenv/run/session.py:55]
py310: 203 D got embed update of distribution pip from /home/dk/.local/share/virtualenv/wheel/3.8/embed/3/pip.json [virtualenv/app_data/via_disk_folder.py:129]
py310: 207 D got embed update of distribution setuptools from /home/dk/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json [virtualenv/app_data/via_disk_folder.py:129]
py310: 208 D got embed update of distribution wheel from /home/dk/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json [virtualenv/app_data/via_disk_folder.py:129]
py310: 209 D install pip from wheel /home/dk/tox/pythonProject/.tox/.tox/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-22.3.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
py310: 209 D install setuptools from wheel /home/dk/tox/pythonProject/.tox/.tox/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/setuptools-65.6.3-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
py310: 210 D install wheel from wheel /home/dk/tox/pythonProject/.tox/.tox/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/wheel-0.38.4-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
py310: 211 D copy /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
py310: 212 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
py310: 212 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/pip [virtualenv/util/path/_sync.py:36]
py310: 214 D copy /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
py310: 215 D copy /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
py310: 215 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
py310: 218 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
py310: 224 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/wheel [virtualenv/util/path/_sync.py:36]
py310: 241 D generated console scripts wheel wheel3 wheel-3.8 wheel3.8 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py310: 246 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
py310: 248 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
py310: 293 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py310: 313 D copy /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
py310: 313 D copy directory /home/dk/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /home/dk/tox/pythonProject/.tox/.tox/py310/lib/python3.8/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
py310: 314 D generated console scripts pip-3.8 pip3 pip3.8 pip [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py310: 315 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
py310: 315 D write /home/dk/tox/pythonProject/.tox/.tox/py310/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
py310: 316 D 	home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
py310: 316 D 	base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
py310: 323 W install_deps> python -I -m pip install stestr -r /home/dk/tox/pythonProject/test-requirements.txt [tox/tox_env/api.py:417]
Collecting stestr
  Using cached stestr-4.0.1-py3-none-any.whl (117 kB)
Collecting pip~=22.2.1
  Using cached pip-22.2.2-py3-none-any.whl (2.0 MB)
Collecting attrs~=22.1.0
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting wheel~=0.37.1
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting setuptools~=63.3.0
  Using cached setuptools-63.3.0-py3-none-any.whl (1.2 MB)
Collecting packaging~=21.3
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting pyparsing~=3.0.9
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting zipp~=3.8.1
  Using cached zipp-3.8.1-py3-none-any.whl (5.6 kB)
Collecting future~=0.18.2
  Using cached future-0.18.2-py3-none-any.whl
Collecting pbr~=5.10.0
  Using cached pbr-5.10.0-py2.py3-none-any.whl (112 kB)
Collecting fixtures~=4.0.1
  Using cached fixtures-4.0.1-py3-none-any.whl
Collecting testtools~=2.5.0
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting six~=1.16.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting virtualenv~=20.16.5
  Using cached virtualenv-20.16.7-py3-none-any.whl (8.8 MB)
Collecting wcwidth~=0.2.5
  Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting cmd2~=2.4.2
  Using cached cmd2-2.4.2-py3-none-any.whl (147 kB)
Collecting pyperclip~=1.8.2
  Using cached pyperclip-1.8.2-py3-none-any.whl
Collecting PyYAML~=6.0
  Using cached PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
Collecting cliff~=4.0.0
  Using cached cliff-4.0.0-py3-none-any.whl (80 kB)
Collecting stevedore~=4.0.0
  Using cached stevedore-4.0.2-py3-none-any.whl (50 kB)
Collecting autopage~=0.5.1
  Using cached autopage-0.5.1-py3-none-any.whl (29 kB)
Collecting prettytable~=3.4.1
  Using cached prettytable-3.4.1-py3-none-any.whl (26 kB)
Collecting extras~=1.0.0
  Using cached extras-1.0.0-py2.py3-none-any.whl (7.3 kB)
Collecting python-subunit~=1.4.0
  Using cached python_subunit-1.4.2-py3-none-any.whl (106 kB)
Collecting voluptuous~=0.13.1
  Using cached voluptuous-0.13.1-py3-none-any.whl (29 kB)
Collecting distlib<1,>=0.3.6
  Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting platformdirs<3,>=2.4
  Using cached platformdirs-2.6.0-py3-none-any.whl (14 kB)
Collecting filelock<4,>=3.4.1
  Using cached filelock-3.8.2-py3-none-any.whl (10 kB)
Collecting importlib-metadata>=4.4
  Using cached importlib_metadata-5.2.0-py3-none-any.whl (21 kB)
Installing collected packages: wcwidth, voluptuous, pyperclip, extras, distlib, zipp, wheel, six, setuptools, PyYAML, pyparsing, prettytable, platformdirs, pip, pbr, future, filelock, autopage, attrs, virtualenv, stevedore, packaging, importlib-metadata, fixtures, cmd2, testtools, cliff, python-subunit, stestr
  Attempting uninstall: wheel
    Found existing installation: wheel 0.38.4
    Uninstalling wheel-0.38.4:
      Successfully uninstalled wheel-0.38.4
  Attempting uninstall: setuptools
    Found existing installation: setuptools 65.6.3
    Uninstalling setuptools-65.6.3:
      Successfully uninstalled setuptools-65.6.3
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed PyYAML-6.0 attrs-22.1.0 autopage-0.5.1 cliff-4.0.0 cmd2-2.4.2 distlib-0.3.6 extras-1.0.0 filelock-3.8.2 fixtures-4.0.1 future-0.18.2 importlib-metadata-5.2.0 packaging-21.3 pbr-5.10.0 pip-22.2.2 platformdirs-2.6.0 prettytable-3.4.1 pyparsing-3.0.9 pyperclip-1.8.2 python-subunit-1.4.2 setuptools-63.3.0 six-1.16.0 stestr-4.0.1 stevedore-4.0.2 testtools-2.5.0 virtualenv-20.16.7 voluptuous-0.13.1 wcwidth-0.2.5 wheel-0.37.1 zipp-3.8.1
py310: 6772 I exit 0 (6.45 seconds) /home/dk/tox/pythonProject> python -I -m pip install stestr -r /home/dk/tox/pythonProject/test-requirements.txt pid=84153 [tox/execute/api.py:275]
py310: 6773 W commands[0]> stestr run [tox/tox_env/api.py:417]
{0} tests.unit.test_calc.CalcTestCase.test_calc_all [0.000381s] ... ok
{1} tests.unit.test_calc.CalcTestCase.test_calc_raises [0.000295s] ... ok
{1} tests.unit.test_calc.CalcTestCase.test_calc_sub [0.000226s] ... ok
{2} tests.unit.test_calc.CalcTestCase.test_calc_add [0.000174s] ... ok
{2} tests.unit.test_calc.CalcTestCase.test_calc_mul [0.000045s] ... ok
{3} tests.unit.test_calc.CalcTestCase.test_calc_div [0.000322s] ... ok
{3} tests.unit.test_calc.CalcTestCase.test_calc_div_zero [0.000054s] ... ok

======
Totals
======
Ran: 7 tests in 0.0131 sec.
 - Passed: 7
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 0.0015 sec.

==============
Worker Balance
==============
 - Worker 0 (1 tests) => 0:00:00.000381
 - Worker 1 (2 tests) => 0:00:00.000838
 - Worker 2 (2 tests) => 0:00:00.000395
 - Worker 3 (2 tests) => 0:00:00.000817
py310: 7575 I exit 0 (0.80 seconds) /home/dk/tox/pythonProject> stestr run pid=84244 [tox/execute/api.py:275]
py310: OK ✔ in 7.44 seconds
pep8: 7579 I find interpreter for spec PythonSpec(major=3) [virtualenv/discovery/builtin.py:56]
pep8: 7579 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/dk/tox/pythonProject/.tox/.tox/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
pep8: 7579 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/dk/tox/pythonProject/.tox/.tox/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
[...cut...]
pep8: 10529 I exit 0 (0.35 seconds) /home/dk/tox/pythonProject> flake8 pid=84329 [tox/execute/api.py:275]
  py310: OK (7.44=setup[6.64]+cmd[0.80] seconds)
  pep8: OK (2.95=setup[2.60]+cmd[0.35] seconds)
  congratulations :) (10.45 seconds)
.tox finish: provision  after 10.59 seconds

Minimal example

tox.ini:

[tox]
envlist = py310,pep8
minversion = 3.18.0
skipsdist = True
ignore_basepython_conflict = False

[testenv]
basepython = python3
setenv = OS_STDOUT_CAPTURE=1
         OS_STDERR_CAPTURE=1
         OS_TEST_TIMEOUT=60
usedevelop = True
allowlist_externals =
  stestr
deps =
  stestr
  -r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}

[testenv:pep8]
envdir = {toxworkdir}/lint
deps =
  flake8
  flake8-import-order==0.18.1 # LGPLv3
  pylint==2.5.3 # GPLv2
commands=
  # If it is easier to add a check via a shell script, consider adding it in this file
  flake8

[testenv:venv]
deps =
  -r{toxinidir}/test-requirements.txt
commands = {posargs}

[flake8]
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# H405 multi line docstring summary not separated with an empty line
# I202 Additional newline in a group of imports
# N530 direct neutron imports not allowed
# TODO(amotoki) check the following new rules should be fixed or ignored
# E731 do not assign a lambda expression, use a def
# W504 line break after binary operator
ignore = E126,E128,E731,I202,H405,N530,W504
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
show-source = true
exclude = ./.*,build,dist,doc
import-order-style = pep8

Pythons:

$ ls -la /usr/bin/python*
lrwxrwxrwx 1 root root       7 Apr 15  2020 /usr/bin/python -> python3
lrwxrwxrwx 1 root root       9 Mar 13  2020 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3662032 Jul  1 15:27 /usr/bin/python2.7
lrwxrwxrwx 1 root root      33 Jul  1 15:27 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root      16 Mar 13  2020 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root       9 Aug  3 15:38 /usr/bin/python3 -> python3.8
-rwxr-xr-x 1 root root 5838616 Dec  7 04:12 /usr/bin/python3.10
lrwxrwxrwx 1 root root      34 Dec  7 04:12 /usr/bin/python3.10-config -> x86_64-linux-gnu-python3.10-config
-rwxr-xr-x 1 root root 5494584 Nov 14 15:59 /usr/bin/python3.8
lrwxrwxrwx 1 root root      33 Nov 14 15:59 /usr/bin/python3.8-config -> x86_64-linux-gnu-python3.8-config
lrwxrwxrwx 1 root root      16 Mar 13  2020 /usr/bin/python3-config -> python3.8-config
-rwxr-xr-x 1 root root     152 Apr  9  2020 /usr/bin/python3-pbr
-rwxr-xr-x 1 root root     384 Dec 17  2019 /usr/bin/python3-unit2
@gaborbernat gaborbernat added bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. labels Dec 19, 2022
@gaborbernat gaborbernat added this to the 4.0.x milestone Dec 20, 2022
@stephenfin
Copy link
Contributor

As an aside, that option really should have been removed in tox 4.x. It was an escape hatch intended to avoid introducing a backwards incompatible change, even though the backwards-incompatible behaviour was the correct one. Personally, I'd be in favour of removing this option immediately in 4.0.x and forcing the ignore_basepython_conflict = False behaviour (i.e. an environment with a pyXY factor would always use pythonX.Y regardless of the [testenv] basepython value but that's not my call.

@gaborbernat
Copy link
Member

gaborbernat commented Dec 31, 2022

I'm afraid I have to disagree. The breaking change with 4.x is to change ignore_basepython_conflict = False from ignore_basepython_conflict = True 🤔 so I wouldn't entirely remove it yet; would we remove it we'd hard fail on conflict rather than pick a winner.

@q0w
Copy link
Contributor

q0w commented Jan 1, 2023

You should remove basepython = python3 to get python version from sys.executable. Also python3 satisfies python3.12

@stephenfin
Copy link
Contributor

I'm afraid I have to disagree. The breaking change with 4.x is to change ignore_basepython_conflict = False from ignore_basepython_conflict = True 🤔 so I wouldn't entirely remove it yet; would we remove it we'd hard fail on conflict rather than pick a winner.

You got those backwards, I assume? In 3.x, if you set basepython = python3 and didn't set ignore_basepython_conflict then an env with e.g. the py38 factor would result in python3 being used, even if this was python3.6. I'm saying this is daft behaviour that should never have been allowed in the first place and the only reason we provided an option to opt into correct behaviour was to avoid breaking existing environments. Since we have a new major version, we no longer need to force people to opt into correct behaviour, surely?

(You should still be able to set [testenv] basepython = python3 btw - it should just be ignored)

@stephenfin
Copy link
Contributor

stephenfin commented Jan 4, 2023

You should remove basepython = python3 to get python version from sys.executable. Also python3 satisfies python3.12

This only applies if your host uses python3 by default.

Edit Actually, no, sys.executable would come from the environment that tox is running in and tox only supports python3 so you are correct here. However, this is still a large breaking change and there's no indication given that things are broken. For example, consider this reproducer (for another issue but still useful): if I run e.g. tox -e py33 on a host without python3.3, it will happily execute using python3 (which corresponds to python3.11 on my host). This is the entire reason ignore_basepython_conflict was added and is the issue that was supposed to prevent.

stephenfin added a commit to stephenfin/tox that referenced this issue Jan 5, 2023
The following is intended to be a correct tox configuration:

  [tox]
  min_version = 4.1
  env_list = py{38,39,310,311},docs

  [testenv]
  base_python = python3

  [testenv:docs]
  commands =
    sphinx-build ...

The goal of this is to use 'python3' (i.e. the value of '[testenv]
base_python') for all environments except those with specific 'pyXX'
factors in them. This helps eliminate issues where environments that do
not specify a 'pyXX' factor run with different Python versions in
different environments.

An earlier bug, tox-dev#477 [1], prevented us from doing this. Due to tox-dev#477, the
interpreter version indicated by '[testenv] base_python' (or rather
'[testenv] basepython' - the underscore-separated variant was only
introduced in tox 4) would override the value indicated by the 'pyXX'
factor. This was resolved with a PR, tox-dev#841 [2], which started warning
users if they were unintentionally running against the wrong interpreter
and introduced the 'ignore_basepython_conflict' value to opt into the
correct behavior.

Unfortunately, this has been broken in the move to tox 4. Currently,
running with the above configuration will result in 'python3' being used
for every environment. This is clearly incorrect. This issue stems from
an errant bit of logic. When comparing interpreter versions as part of
the '_validate_base_python', we ignore various attributes if they are
unset on either '[testenv] base_python' or the 'pyXX' factor. This
allows e.g. 'python3' to match 'python3.8', which isn't correct. Correct
this by insisting on matching on all attributes that are set on the
factor.

[1] tox-dev#477
[2] tox-dev#841

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: tox-dev#2754
stephenfin added a commit to stephenfin/tox that referenced this issue Jan 5, 2023
The following is intended to be a correct tox configuration:

  [tox]
  min_version = 4.1
  env_list = py{38,39,310,311},docs

  [testenv]
  base_python = python3.8

  [testenv:docs]
  commands =
    sphinx-build ...

The goal of this is to use 'python3.8' (i.e. the value of '[testenv]
base_python') for all environments except those with specific 'pyXX'
factors in them. This helps eliminate issues where environments that do
not specify a 'pyXX' factor run with different Python versions in
different environments.

An earlier bug, tox-dev#477 [1], prevented us from doing this. Due to tox-dev#477, the
interpreter version indicated by '[testenv] base_python' (or rather
'[testenv] basepython' - the underscore-separated variant was only
introduced in tox 4) would override the value indicated by the 'pyXX'
factor. This was resolved with a PR, tox-dev#841 [2], which started warning
users if they were unintentionally running against the wrong interpreter
and introduced the 'ignore_basepython_conflict' value to opt into the
correct behavior.

Unfortunately, this has been partially broken in the move to tox 4.
While the above configuration still works, the following no longer does:

  [tox]
  min_version = 4.1
  env_list = py{38,39,310,311},docs

  [testenv]
  base_python = python3

  [testenv:docs]
  commands =
    sphinx-build ...

This configuration was common back during the move from Python 2 to
Python 3. It ensured that 'python3' was used for all testenvs that did
not request an explicit Python version via a factor or their own
'base_python' version. While it's no longer necessary, it is still quite
common. Currently, running with this configuration will result in
'python3' being used for every environment, rather than e.g. 'python3.8'
for a testenv with the 'py38' factor. This is clearly incorrect. This
issue stems from an errant bit of logic. When comparing interpreter
versions as part of the '_validate_base_python', we ignore various
attributes if they are unset on either '[testenv] base_python' or the
'pyXX' factor. This allows e.g. 'python3' to match 'python3.8', since
the minor version is unset for the '[testenv] base_python' value,
'python3'. The fix is simple: while we can ignore unset attributes for
factor-derived versions (to allow a 'py3' factor to work with e.g.
'base_python = python3.8'), we should insist on them for
'base_python'-derived versions.

[1] tox-dev#477
[2] tox-dev#841

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: tox-dev#2754
@gaborbernat
Copy link
Member

Ok, I've changed my mind. I thought to leave ignore_basepython_conflict as a stopgap for people to migrate it, however, if we're considering it a feature to create confusing configurations, I'm now inclined to just remove it and set it to always False. ignore_basepython_conflict was not meant to set default pythons that can be then ignored by some envs.

@stephenfin
Copy link
Contributor

stephenfin commented Jan 5, 2023

I've also changed my mind. I still think that this option should exist, since I think there is value in being able to define a default base_python in [testenv] that is inherited by all testenvs that do not contain a pyXY factor. However, I no longer think it should be the default since it could definitely be confusing. tox 4 has already done the important thing of raising an error if this combination is found and ignore_base_python_conflict is not set (in tox 3 that was just a warning) so with #2824 now merged, we're good.

Put another way, with #2824, we should now be able to once again specify [testenv] base_python = python3 (as well as more specific interpreter versions like python3.8 or pypy3) but users will continue needing to opt-in. I'm okay with this status quo. 👌

openstack-mirroring pushed a commit to openstack/python-aodhclient that referenced this issue Jan 12, 2023
* use min version 4.2.5, for fixes [1][2][3]
* passenv fixed as space-separated list is not allowed anymore
* dock target uses requirements from requirements.txt as well as
  doc/requirements.txt
* skipsdist is not supported
* whitelist_externals has been removed in favour of allowlist_externals

* reno was added to doc/requirements.txt to fix the releasenotes target
* update setup.cfg to install aodh from tarball in the requirements
  The tarball wasn't being installed when specified in tox.ini, and the
  [extras] section in setup.cfg needed updating to support installing
  from a URL

[1] tox-dev/tox#2754
[2] tox-dev/tox#2824
[3] tox-dev/tox#2828

Change-Id: I4122d0d05f297f864318e80392e6c77fb2e9fdcf
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jan 12, 2023
* Update python-aodhclient from branch 'master'
  to 02176deb25b3a8f1bc02eb3d70f0a50ce22f02f7
  - Make tox.ini tox 4.0 compatible
    
    * use min version 4.2.5, for fixes [1][2][3]
    * passenv fixed as space-separated list is not allowed anymore
    * dock target uses requirements from requirements.txt as well as
      doc/requirements.txt
    * skipsdist is not supported
    * whitelist_externals has been removed in favour of allowlist_externals
    
    * reno was added to doc/requirements.txt to fix the releasenotes target
    * update setup.cfg to install aodh from tarball in the requirements
      The tarball wasn't being installed when specified in tox.ini, and the
      [extras] section in setup.cfg needed updating to support installing
      from a URL
    
    [1] tox-dev/tox#2754
    [2] tox-dev/tox#2824
    [3] tox-dev/tox#2828
    
    Change-Id: I4122d0d05f297f864318e80392e6c77fb2e9fdcf
stephenfin added a commit to getpatchwork/git-pw that referenced this issue Jan 13, 2023
It's the cause of many tox 4 bugs and the 'ignore_basepython_conflict'
option is likely to go away at some point [1].

[1] tox-dev/tox#2754 (comment)

Signed-off-by: Stephen Finucane <stephen@that.guru>
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jan 17, 2023
* Update aodh from branch 'master'
  to 84d59a198257ea6f3b839ca5d96cbaa74f2f3b76
  - Make tox.ini tox 4.0 compatible
    
    * use min version 4.2.5, for fixes [1][2][3]
    * passenv fixed as space-separated list is not allowed anymore
    * doc target uses requirements.txt as well as docs/requirements.txt
    * skipsdist is not supported
    * Add usedevelop = False so that aodh-api gets installed
    
    Update setup.cfg: [files] -> [options]
    
    [1] tox-dev/tox#2754
    [2] tox-dev/tox#2824
    [3] tox-dev/tox#2828
    
    Change-Id: I2422dc17e6c73ef346de80e57cdf61ef5d271d69
openstack-mirroring pushed a commit to openstack/aodh that referenced this issue Jan 17, 2023
* use min version 4.2.5, for fixes [1][2][3]
* passenv fixed as space-separated list is not allowed anymore
* doc target uses requirements.txt as well as docs/requirements.txt
* skipsdist is not supported
* Add usedevelop = False so that aodh-api gets installed

Update setup.cfg: [files] -> [options]

[1] tox-dev/tox#2754
[2] tox-dev/tox#2824
[3] tox-dev/tox#2828

Change-Id: I2422dc17e6c73ef346de80e57cdf61ef5d271d69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:minor does not affect many people or has no big impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants