tox: changedir breaks script discovery
Hi, firstly thanks for providing Tox. It’s awesome! I also saw the PyCon talk about Tox 4 and I’m really looking forward to it 😄
I’ve created an env for building Sphinx documentation with its make scripts. I know the documentation suggests using sphinx-build directly but anyways: the script cannot be found under the directory.
InvocationError for command could not find executable my_script
Output of tox -e script -rvv
tox -e script -rvv(venv) C:\Felix\Git\ztst>tox -e script -rvv
using tox.ini: C:\Felix\Git\ztst\tox.ini (pid 14348)
removing C:\Felix\Git\ztst\.tox\log
using tox-3.23.1 from c:\felix\git\ztst\venv\lib\site-packages\tox\__init__.py (pid 14348)
GLOB start: packaging
GLOB sdist-make: C:\Felix\Git\ztst\setup.py
removing C:\Felix\Git\ztst\.tox\dist
[6856] C:\Felix\Git\ztst$ 'c:\felix\git\ztst\venv\scripts\python.exe' setup.py sdist --formats=zip --dist-dir '.tox\dist' >.tox\log
\GLOB-0.log
running sdist
running egg_info
writing package.egg-info\PKG-INFO
writing dependency_links to package.egg-info\dependency_links.txt
writing top-level names to package.egg-info\top_level.txt
reading manifest file 'package.egg-info\SOURCES.txt'
writing manifest file 'package.egg-info\SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md
running check
warning: check: missing required meta-data: url
creating package-0.0.1
creating package-0.0.1\package
creating package-0.0.1\package.egg-info
copying files to package-0.0.1...
copying setup.py -> package-0.0.1
copying package\__init__.py -> package-0.0.1\package
copying package.egg-info\PKG-INFO -> package-0.0.1\package.egg-info
copying package.egg-info\SOURCES.txt -> package-0.0.1\package.egg-info
copying package.egg-info\dependency_links.txt -> package-0.0.1\package.egg-info
copying package.egg-info\top_level.txt -> package-0.0.1\package.egg-info
Writing package-0.0.1\setup.cfg
creating '.tox\dist\package-0.0.1.zip' and adding 'package-0.0.1' to it
adding 'package-0.0.1'
adding 'package-0.0.1\package'
adding 'package-0.0.1\package.egg-info'
adding 'package-0.0.1\PKG-INFO'
adding 'package-0.0.1\setup.cfg'
adding 'package-0.0.1\setup.py'
adding 'package-0.0.1\package\__init__.py'
adding 'package-0.0.1\package.egg-info\dependency_links.txt'
adding 'package-0.0.1\package.egg-info\PKG-INFO'
adding 'package-0.0.1\package.egg-info\SOURCES.txt'
adding 'package-0.0.1\package.egg-info\top_level.txt'
removing 'package-0.0.1' (and everything under it)
GLOB finish: packaging after 0.28 seconds
copying new sdistfile to 'C:\\Users\\Felix The III\\.tox\\distshare\\package-0.0.1.zip'
package .tmp\package\1\package-0.0.1.zip links to dist\package-0.0.1.zip (C:\Felix\Git\ztst\.tox)
c:\felix\git\ztst\venv\scripts\python.exe (c:\felix\git\ztst\venv\scripts\python.exe) is {'executable': 'c:\\felix\\git\\ztst\\venv
\\scripts\\python.exe', 'implementation': 'CPython', 'version_info': [3, 9, 4, 'final', 0], 'version': '3.9.4 (tags/v3.9.4:1f2e308,
Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)]', 'is_64': True, 'sysplatform': 'win32', 'os_sep': '\\', 'extra_version_info':
None}
script uses c:\felix\git\ztst\venv\scripts\python.exe
script start: getenv C:\Felix\Git\ztst\.tox\script
script cannot reuse: -r flag
script recreate: C:\Felix\Git\ztst\.tox\script
removing C:\Felix\Git\ztst\.tox\script
setting PATH=C:\Felix\Git\ztst\.tox\script\Scripts;C:\Felix\Git\ztst\venv\Scripts;C:\Program Files\Python39\Scripts\;C:\Program Fil
es\Python39\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\R\Rtools\bin;C:\Program Files\Python37\S
cripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Fi
les (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\Users\Felix The III\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft
SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corp
oration\PhysX\Common;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\WinSCP\;C:\WINDOWS\system32;C:\WINDOWS;C:\W
INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Meld;C:\Progra
m Files\Java\jdk1.8.0_131\jre\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\Ruby26-x64\Perl\c\bin;C:\Ruby26-x
64\Perl\perl\site\bin;C:\Ruby26-x64\Perl\perl\bin;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\PuTTY\;C:\Program Files\Inksc
ape\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Graphviz\bin;C:\Program Files\Git\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WI
NDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Ruby26-x64\bin;C:\Users\Felix The I
II\AppData\Local\Microsoft\WindowsApps;C:\Users\Felix The III\AppData\Local\Microsoft\WindowsApps
[12584] C:\Felix\Git\ztst\.tox$ 'c:\felix\git\ztst\venv\scripts\python.exe' -m virtualenv --no-download --python 'c:\felix\git\ztst
\venv\scripts\python.exe' script
created virtual environment CPython3.9.4.final.0-64 in 443ms
creator CPython3Windows(dest=C:\Felix\Git\ztst\.tox\script, 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\Felix The III\App
Data\Local\pypa\virtualenv)
added seed packages: pip==21.1.2, setuptools==57.0.0, wheel==0.36.2
activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
script finish: getenv C:\Felix\Git\ztst\.tox\script after 0.89 seconds
script start: installpkg C:\Felix\Git\ztst\.tox\.tmp\package\1\package-0.0.1.zip
script inst: C:\Felix\Git\ztst\.tox\.tmp\package\1\package-0.0.1.zip
write config to C:\Felix\Git\ztst\.tox\script\.tox-config1 as 'a1b7ef8ecc300c0c3968e75eee0bacebceafee09837fc27d41da46c09ea194b3 c:\
\felix\\git\\ztst\\venv\\scripts\\python.exe\n3.23.1 0 0 0'
setting PATH=C:\Felix\Git\ztst\.tox\script\Scripts;C:\Felix\Git\ztst\venv\Scripts;C:\Program Files\Python39\Scripts\;C:\Program Fil
es\Python39\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\R\Rtools\bin;C:\Program Files\Python37\S
cripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Fi
les (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\Users\Felix The III\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft
SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corp
oration\PhysX\Common;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\WinSCP\;C:\WINDOWS\system32;C:\WINDOWS;C:\W
INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Meld;C:\Progra
m Files\Java\jdk1.8.0_131\jre\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\Ruby26-x64\Perl\c\bin;C:\Ruby26-x
64\Perl\perl\site\bin;C:\Ruby26-x64\Perl\perl\bin;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\PuTTY\;C:\Program Files\Inksc
ape\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Graphviz\bin;C:\Program Files\Git\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WI
NDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Ruby26-x64\bin;C:\Users\Felix The I
II\AppData\Local\Microsoft\WindowsApps;C:\Users\Felix The III\AppData\Local\Microsoft\WindowsApps
[6656] C:\Felix\Git\ztst$ 'C:\Felix\Git\ztst\.tox\script\Scripts\python.EXE' -m pip install --exists-action w '.tox\.tmp\package\1\
package-0.0.1.zip'
Processing c:\felix\git\ztst\.tox\.tmp\package\1\package-0.0.1.zip
Building wheels for collected packages: package
Building wheel for package (setup.py) ... done
Created wheel for package: filename=package-0.0.1-py3-none-any.whl size=1299 sha256=2b23f54312efcb9ccde8fdc40a2e0bde06b6699d9c261
ddec7add086f590c4b9
Stored in directory: c:\users\felix the iii\appdata\local\pip\cache\wheels\3a\ff\d7\7610bc53c7eb3c2f1bbde735f922ecaad85b79d792533
8629c
Successfully built package
Installing collected packages: package
Successfully installed package-0.0.1
script finish: installpkg C:\Felix\Git\ztst\.tox\.tmp\package\1\package-0.0.1.zip after 2.81 seconds
script start: envreport
setting PATH=C:\Felix\Git\ztst\.tox\script\Scripts;C:\Felix\Git\ztst\venv\Scripts;C:\Program Files\Python39\Scripts\;C:\Program Fil
es\Python39\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\R\Rtools\bin;C:\Program Files\Python37\S
cripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Fi
les (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\Users\Felix The III\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft
SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corp
oration\PhysX\Common;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\WinSCP\;C:\WINDOWS\system32;C:\WINDOWS;C:\W
INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Meld;C:\Progra
m Files\Java\jdk1.8.0_131\jre\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\Ruby26-x64\Perl\c\bin;C:\Ruby26-x
64\Perl\perl\site\bin;C:\Ruby26-x64\Perl\perl\bin;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\PuTTY\;C:\Program Files\Inksc
ape\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Graphviz\bin;C:\Program Files\Git\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WI
NDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Ruby26-x64\bin;C:\Users\Felix The I
II\AppData\Local\Microsoft\WindowsApps;C:\Users\Felix The III\AppData\Local\Microsoft\WindowsApps
[12348] C:\Felix\Git\ztst$ 'C:\Felix\Git\ztst\.tox\script\Scripts\python.EXE' -m pip freeze >.tox\script\log\script-0.log
script finish: envreport after 0.40 seconds
script installed: package @ file:///C:/Felix/Git/ztst/.tox/.tmp/package/1/package-0.0.1.zip
script start: run-test-pre
script run-test-pre: PYTHONHASHSEED='551'
script finish: run-test-pre after 0.00 seconds
script start: run-test
script run-test: commands[0] | my_script
setting PATH=C:\Felix\Git\ztst\.tox\script\Scripts;C:\Felix\Git\ztst\venv\Scripts;C:\Program Files\Python39\Scripts\;C:\Program Fil
es\Python39\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\R\Rtools\bin;C:\Program Files\Python37\S
cripts\;C:\Program Files\Python37\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Fi
les (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windo
ws\System32\WindowsPowerShell\v1.0\;C:\Users\Felix The III\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft
SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corp
oration\PhysX\Common;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\WinSCP\;C:\WINDOWS\system32;C:\WINDOWS;C:\W
INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Meld;C:\Progra
m Files\Java\jdk1.8.0_131\jre\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.5.0\;C:\Ruby26-x64\Perl\c\bin;C:\Ruby26-x
64\Perl\perl\site\bin;C:\Ruby26-x64\Perl\perl\bin;C:\Program Files\MATLAB\R2020a\bin;C:\Program Files\PuTTY\;C:\Program Files\Inksc
ape\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Graphviz\bin;C:\Program Files\Git\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WI
NDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Ruby26-x64\bin;C:\Users\Felix The I
II\AppData\Local\Microsoft\WindowsApps;C:\Users\Felix The III\AppData\Local\Microsoft\WindowsApps
ERROR: InvocationError for command could not find executable my_script
script finish: run-test after 0.04 seconds
script start: run-test-post
script finish: run-test-post after 0.00 seconds
____________________________________________________________ summary _____________________________________________________________
ERROR: script: commands failed
cleanup C:\Felix\Git\ztst\.tox\.tmp\package\1\package-0.0.1.zip
Environment: Windows 10, Python 3.9.4, virtualenv, tox 3.23.1
; my_script.bat
echo YEAH.
; tox.ini
[testenv:script]
changedir = doc
allowlist_externals = my_script
commands = my_script
I also had a dummy project with a setup.py file just for installing the package.
- When the script is in the top level folder (and there’s no changedir), this works
- This works on Linux (conf, workflow, successful run)
- I’m pretty sure this has worked on Windows before
For the reasons above, I posted this as a bug. But feel free to correct me if I’m simply doing something wrong!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Document script discovery wrt changedir (#2089) — committed to felix-hilden/tox by felix-hilden 3 years ago
- Document script discovery wrt changedir (#2089) — committed to felix-hilden/tox by felix-hilden 3 years ago
- Document script discovery wrt changedir (#2089) — committed to gaborbernat/tox by felix-hilden 3 years ago
- Document script discovery wrt changedir (#2089) (#2096) Co-authored-by: Felix Hildén <felix.hilden@gmail.com> Co-authored-by: felix-hilden <felix.hilden@gmail.com> Co-authored-by: pre-commit-ci[bot... — committed to tox-dev/tox by gaborbernat 3 years ago
I think this can be closed now!
Thanks for your contribution!
I meant documentation for Tox 3 for now. Then depending on whether this is changed or left as it is in Tox 4 is up to you, and the documentation can be moved over or updated. How does that sound?
Thanks for the prompt response! This also happens with
And I want to reiterate that it worked without the extension when
changedirhad no value. Sadly I could not produce the working configuration anymore when trying various combinations ofallowandcommand, but I can’t imagine why I would have built the script and managed to run it for at least a year without noticing 😅 But certainly it’s a possibility.