Navigation Menu

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

tox uses wrong virtualenv PATH under MSYS #1982

Closed
jschwartzentruber opened this issue Mar 29, 2021 · 1 comment · Fixed by #1983
Closed

tox uses wrong virtualenv PATH under MSYS #1982

jschwartzentruber opened this issue Mar 29, 2021 · 1 comment · Fixed by #1983
Labels
bug:normal affects many people or has quite an impact

Comments

@jschwartzentruber
Copy link

jschwartzentruber commented Mar 29, 2021

tox assumes that all Windows installations use "{ENV}\Scripts" as the installation folder. This isn't true for MSYS, which uses "{ENV}\bin". If I patch TestenvConfig.get_envbindir() to return "bin" instead of "Scripts", tox uses the correct interpreter.

I believe an exception is needed if MSYSTEM is set in the environment (or I don't know if there's a more "proper" way to detect MSYS), similar to the exception that exists in that function for PyPy.

$ tox -rvv -e py38
using tox.ini: C:/Users/User/source/repos/fuzzfetch/tox.ini (pid 6820)
  removing C:/Users/User/source/repos/fuzzfetch/.tox/log
using tox-3.23.0 from C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/lib/python3.8/site-packages/tox/__init__.py (pid 6820)
skipping sdist step
py38 uses C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.exe
py38 start: getenv C:/Users/User/source/repos/fuzzfetch/.tox/py38
py38 cannot reuse: -r flag
py38 recreate: C:/Users/User/source/repos/fuzzfetch/.tox/py38
  removing C:/Users/User/source/repos/fuzzfetch/.tox/py38
setting PATH=C:/Users/User/source/repos/fuzzfetch/.tox/py38/Scripts;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\mingw64\bin;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\User\.dotnet\tools;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\mingw64\bin\
[9056] C:/Users/User/source/repos/fuzzfetch/.tox$ C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.exe -m virtualenv --no-download --python C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.exe py38
created virtual environment CPython3.8.8.final.0-64 in 532ms
  creator CPython3Windows(dest=C:/Users/User/source/repos/fuzzfetch/.tox/py38, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:/Users/User/AppData/Local/pypa/virtualenv)
    added seed packages: pip==21.0.1, setuptools==54.1.2, wheel==0.36.2
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
py38 installdeps: freezegun, pytest, pytest-cov, requests-mock
setting PATH=C:/Users/User/source/repos/fuzzfetch/.tox/py38/Scripts;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\mingw64\bin;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\User\.dotnet\tools;C:\Users\User\Desktop\msys64-JHtqq6ULSEu38CxK8FxfLQ\mingw64\bin\
WARNING: test command found but not installed in testenv
  cmd: C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.EXE
  env: C:/Users/User/source/repos/fuzzfetch/.tox/py38
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.

DEPRECATION WARNING: this will be an error in tox 4 and above!
[5732] C:/Users/User/source/repos/fuzzfetch$ C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.EXE -m pip install freezegun pytest pytest-cov requests-mock
Requirement already satisfied: freezegun in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (1.1.0)
Requirement already satisfied: pytest in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (6.2.2)
Requirement already satisfied: pytest-cov in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (2.11.1)
Requirement already satisfied: requests-mock in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (1.8.0)
Requirement already satisfied: python-dateutil>=2.7 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from freezegun) (2.8.1)
Requirement already satisfied: six>=1.5 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from python-dateutil>=2.7->freezegun) (1.15.0)
Requirement already satisfied: py>=1.8.2 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (1.10.0)
Requirement already satisfied: toml in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (0.10.2)
Requirement already satisfied: iniconfig in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (1.1.1)
Requirement already satisfied: atomicwrites>=1.0 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (1.4.0)
Requirement already satisfied: packaging in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (20.9)
Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (0.13.1)
Requirement already satisfied: colorama in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (0.4.4)
Requirement already satisfied: attrs>=19.2.0 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest) (20.3.0)
Requirement already satisfied: coverage>=5.2.1 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from pytest-cov) (5.5)
Requirement already satisfied: requests<3,>=2.3 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from requests-mock) (2.25.1)
Requirement already satisfied: certifi>=2017.4.17 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from requests<3,>=2.3->requests-mock) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from requests<3,>=2.3->requests-mock) (1.26.4)
Requirement already satisfied: chardet<5,>=3.0.2 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from requests<3,>=2.3->requests-mock) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from requests<3,>=2.3->requests-mock) (2.10)
Requirement already satisfied: pyparsing>=2.0.2 in c:/users/user/desktop/msys64-jhtqq6ulseu38cxk8fxflq/mingw64/lib/python3.8/site-packages (from packaging->pytest) (2.4.7)
WARNING: test command found but not installed in testenv
  cmd: C:/Users/User/Desktop/msys64-JHtqq6ULSEu38CxK8FxfLQ/mingw64/bin/python.EXE
  env: C:/Users/User/source/repos/fuzzfetch/.tox/py38
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.

DEPRECATION WARNING: this will be an error in tox 4 and above!
py38 finish: getenv C:/Users/User/source/repos/fuzzfetch/.tox/py38 after 2.28 seconds
py38 start: developpkg C:/Users/User/source/repos/fuzzfetch
py38 develop-inst: C:/Users/User/source/repos/fuzzfetch
--- snip ---

This was already mentioned in msys2/MINGW-packages#7014 and #1648, but those dealt with other upstream packaging issues, and I see no tox issue regarding this specific problem.

Steps to reproduce

Install msys2 and in its bash shell, run pacman -S mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-wheel, then install latest tox using pip.

The project I've experienced this on is fuzzfetch. Just clone and run tox -e py38.

@jschwartzentruber jschwartzentruber added the bug:normal affects many people or has quite an impact label Mar 29, 2021
@gaborbernat
Copy link
Member

PRs are welcomed.

jschwartzentruber added a commit to jschwartzentruber/tox that referenced this issue Mar 29, 2021
…on Windows.

MSYS2 prefers a Linux filesystem layout, but is otherwise a native
Windows interpreter.

Fixes tox-dev#1982
jschwartzentruber added a commit to jschwartzentruber/tox that referenced this issue Apr 1, 2021
…on Windows.

MSYS2 prefers a Linux filesystem layout, but is otherwise a native
Windows interpreter.

Fixes tox-dev#1982
jschwartzentruber added a commit to jschwartzentruber/tox that referenced this issue Apr 1, 2021
…on Windows.

MSYS2 prefers a Linux filesystem layout, but is otherwise a native
Windows interpreter.

Fixes tox-dev#1982
@gaborbernat gaborbernat changed the title Tox uses wrong virtualenv PATH under MSYS tox uses wrong virtualenv PATH under MSYS Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:normal affects many people or has quite an impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants