tox-dev / tox

Command line driven CI frontend and development task automation tool.
https://tox.wiki
MIT License
3.69k stars 523 forks source link

pip install always executed when usedevelop=True #2336

Closed margars closed 2 years ago

margars commented 2 years ago

Hi,

I am using tox==3.24.5 with the following settings: skipsdist = True usedevelop = True

At every execution of tox "pip install -e ." is called even though no file has changed. I assume this is not the expected behavior. My project has setup.py and setup.cfg. Any suggestion?

jugmac00 commented 2 years ago

Having a look at the following test https://github.com/tox-dev/tox/blob/47cf25e9085d632f2fb21eab5efdb2012c784595/tests/unit/test_z_cmdline.py#L730-L751 I assume this behavior is intentional, ie that setup.py is executed, but no packages get re-installed.

Adding your configuration options to one of my projects, I cannot see any pip install -e. in my output. Could you please add the complete output of your tox command - do not forget to add -vv to increase verbosity.

That all said, tox4 will be published in the near future, so the tox maintainers allocate their spare time there.

margars commented 2 years ago

Thanks for quick reply, the output is attached.

using tox.ini: C:\dev\mypackage\tox.ini (pid 23968)
  removing C:\dev\mypackage\.tox\log
using tox-3.24.5 from c:\devtools\python3\lib\site-packages\tox\__init__.py (pid 23968)
skipping sdist step
dev uses c:\devtools\python3\python.exe
dev start: getenv C:\dev\mypackage\.tox\dev
dev reusing: C:\dev\mypackage\.tox\dev
dev finish: getenv C:\dev\mypackage\.tox\dev after 0.18 seconds
dev start: developpkg C:\dev\mypackage
[32072] C:\dev\mypackage$ 'C:\dev\mypackage\.tox\dev\Scripts\python' setup.py --name
[30112] C:\dev\mypackage$ 'C:\dev\mypackage\.tox\dev\Scripts\python' -c 'import sys;  import json; print(json.dumps(sys.path))'
dev develop-inst-nodeps: C:\dev\mypackage
setting PATH=C:\dev\mypackage\.tox\dev\Scripts;C:\Program Files\Java\jdk1.8.0_162\bin;C:\dev\own\dev-tools;C:\devtools\Python3\Scripts\;C:\devtools\Python3\;C:\Users\gABC\software\KDiff3;C:\Users\gABC\software\emacs-26.3-x86_64\bin;C:\Users\gABC\software\hunspell-1.3.2-3-w32-bin\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\HashiCorp\Vagrant\bin;C:\opt\gradle\bin;c:\oracle\12\product\12.2.0\clientx64\bin;c:\oracle\12\product\12.2.0\clientx86\bin;C:\Users\gABC\software\SysinternalsSuite;C:\Users\gABC\software\GnuWin32\somepath;C:\Program Files\PuTTY\;C:\Program Files\RedHat\java-11-openjdk-11.0.10-1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\gABC\AppData\Local\Microsoft\WindowsApps;;C:\Users\gABC\AppData\Local\Programs\MicrosoftVSCode\bin;
[21856] C:\dev\mypackage$ 'C:\dev\mypackage\.tox\dev\Scripts\python.EXE' -m pip install -i https://someurl.net/api/pypi/pypi-remote/simple --no-deps -e .
Looking in links: c:\dev\own\wheels
Obtaining file:///C:/dev/mypackage
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Installing collected packages: mypackage
  Attempting uninstall: mypackage
    Found existing installation: mypackage 0.1.0
    Uninstalling mypackage-0.1.0:
      Successfully uninstalled mypackage-0.1.0
  Running setup.py develop for mypackage
Successfully installed mypackage-0.1.0
dev finish: developpkg C:\dev\mypackage after 14.15 seconds
dev start: envreport 
setting PATH=C:\dev\mypackage\.tox\dev\Scripts;C:\Program Files\Java\jdk1.8.0_162\bin;C:\dev\own\dev-tools;C:\devtools\Python3\Scripts\;C:\devtools\Python3\;C:\Users\gABC\software\KDiff3;C:\Users\gABC\software\emacs-26.3-x86_64\bin;C:\Users\gABC\software\hunspell-1.3.2-3-w32-bin\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\HashiCorp\Vagrant\bin;C:\opt\gradle\bin;c:\oracle\12\product\12.2.0\clientx64\bin;c:\oracle\12\product\12.2.0\clientx86\bin;C:\Users\gABC\software\SysinternalsSuite;C:\Users\gABC\software\GnuWin32\somepath;C:\Program Files\PuTTY\;C:\Program Files\RedHat\java-11-openjdk-11.0.10-1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\gABC\AppData\Local\Microsoft\WindowsApps;;C:\Users\gABC\AppData\Local\Programs\MicrosoftVSCode\bin;
[28380] C:\dev\mypackage$ 'C:\dev\mypackage\.tox\dev\Scripts\python.EXE' -m pip freeze >.tox\dev\log\dev-30.log
dev finish: envreport  after 1.37 seconds
dev installed: asttokens==2.0.5,atomicwrites==1.4.0,attrs==21.4.0,backcall==0.2.0,black==21.12b0,click==8.0.3,colorama==0.4.4,coverage==6.2,decorator==5.1.1,execnet==1.9.0,executing==0.8.2,flake8==4.0.1,iniconfig==1.1.1,ipython==8.0.1,isort==5.10.1,jedi==0.18.1,jsonpickle==2.1.0,matplotlib-inline==0.1.3,mccabe==0.6.1,mypy==0.930,mypy-extensions==0.4.3,packaging==21.3,parso==0.8.3,pathspec==0.9.0,pickleshare==0.7.5,platformdirs==2.4.1,pluggy==1.0.0,prompt-toolkit==3.0.24,pure-eval==0.2.2,py==1.11.0,pycodestyle==2.8.0,pyflakes==2.4.0,Pygments==2.11.2,pyparsing==3.0.6,pytest==6.2.5,pytest-cov==3.0.0,pytest-forked==1.4.0,pytest-xdist==2.5.0,six==1.16.0,-e git+https://someurl.net/scm/ccrm/mypackage.git@06e5a99b286cf1188b99f2e370217f1d596c84a1#egg=mypackage,stack-data==0.1.4,toml==0.10.2,tomli==1.2.3,traitlets==5.1.1,typing_extensions==4.0.1,wcwidth==0.2.5
  removing C:\dev\mypackage\.tox\dev\tmp
dev start: run-test-pre 
dev run-test-pre: PYTHONHASHSEED='560'
dev finish: run-test-pre  after 0.00 seconds
dev start: run-test 
dev run-test: commands[0] | black mypackage tests
jugmac00 commented 2 years ago

I cannot reproduce your problem on Ubuntu 20.04.

This either means the issue is related to your setup or to your os.

Could you try to reproduce the problem with tox4? (pip install --pre tox)

margars commented 2 years ago

It works as expected with tox4, I will wait for the release.

Thanks again for quick response.

PS. Some of output text look strange in PowerShell, pytest colors are lost. image

jugmac00 commented 2 years ago

Thanks for the feedback. I use tox4 already for a year or so in production, so no need to wait, unless you encounter a serious problem, but that is up to you.

About the color issue... please report it as a new issue. Unfortunately, I have no access to a windows box, and cannot help with this problem.

gaborbernat commented 2 years ago

PS. Some of output text look strange in PowerShell, pytest colors are lost.

Seems your shell does not handle colouring correctly. Can you provide the exact run environment you're using? I'll probably cut a first beta release today/tomorrow. What we have here will be what we ship soon (minus any bugs reported before it). You likely should open a new issue for it.

margars commented 2 years ago

I am using PowerShell 5.1 (running inside ConsoleZ) on Windows 10. In the same environment tox 3.x shows correctly the commands and color.

image

gaborbernat commented 2 years ago

Colours might be lost because of https://github.com/tox-dev/tox/issues/1773, for which I don't have a good solution (and the reason it worked for tox 4 is no longer a valid route for tox 3). However, from what your first screenshot shows the colour is printed (hence the [36m chars) but ConzoleZ fails to render it correctly. Can you open a new issue for it please, and mention the powershell + consoleZ combo? Did/can you try it with Windows Terminal and see if that renders it better?

margars commented 2 years ago

The problem is still there using CMD as well as default PowerShell window, which suggests it is not related to ConsoleZ.

Somewhat surprisingly the message at the end of execution is correctly displayed: image