tox-dev / tox-conda

Make tox cooperate with conda envs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken on windows

AntoineD opened this issue · comments

Hello,

the latest release and the master branch do not work for windows 10 (I've not tested other windows versions).
For instance, see what happens when using tox-conda with its own sources:

  • setup with
conda create -n tox-conda python=3.8 pip
conda activate tox-conda
pip install -e .
  • The executable installed in an env and used by a command is not found, here pre-commit
tox -e fix_lint
    fix_lint create: C:\Users\AntoineD\PycharmProjects\tox-conda\.tox\fix_lint
    fix_lint installdeps: virtualenv < 20.0.34, pre-commit >= 1.14.4, < 2
    fix_lint installed: appdirs==1.4.4,aspy.yaml==1.3.0,certifi==2020.6.20,cfgv==3.2.0,distlib==0.3.1,filelock==3.0.12,identify==1.5.
    9,importlib-metadata==2.0.0,nodeenv==1.5.0,pre-commit==1.21.0,PyYAML==5.3.1,six==1.15.0,toml==0.10.2,virtualenv==20.0.33,wincerts
    tore==0.2,zipp==3.4.0
    fix_lint run-test-pre: PYTHONHASHSEED='196'
    fix_lint run-test: commands[0] | pre-commit run --all-files --show-diff-on-failure
    ERROR: InvocationError for command could not find executable pre-commit
    ___________________________________________________________ summary ____________________________________________________________
    ERROR:   fix_lint: commands failed
  • And here pytest, found outside the env
tox -e py37
    GLOB sdist-make: C:\Users\AntoineD\PycharmProjects\tox-conda\setup.py
    py37 create: C:\Users\AntoineD\PycharmProjects\tox-conda\.tox\py37
    py37 installdeps: pip >= 19.0.1, pytest-timeout, tox[testing] >= 3.8.1, < 4
    py37 inst: C:\Users\AntoineD\PycharmProjects\tox-conda\.tox\.tmp\package\1\tox-conda-0.3.0.dev0.zip
    py37 installed: apipkg==1.5,appdirs==1.4.4,atomicwrites==1.4.0,attrs==20.3.0,certifi==2020.6.20,colorama==0.4.4,coverage==5.3,dis
    tlib==0.3.1,execnet==1.7.1,filelock==3.0.12,flaky==3.7.0,freezegun==1.0.0,importlib-metadata==2.0.0,iniconfig==1.1.1,packaging==2
    0.4,pathlib2==2.3.5,pluggy==0.13.1,psutil==5.7.3,py==1.9.0,pyparsing==2.4.7,pytest==6.1.2,pytest-cov==2.10.1,pytest-forked==1.3.0
    ,pytest-mock==3.3.1,pytest-randomly==3.4.1,pytest-timeout==1.4.2,pytest-xdist==2.1.0,python-dateutil==2.8.1,six==1.15.0,toml==0.1
    0.2,tox==3.20.1,tox-conda @ file:///C:/Users/AntoineD/PycharmProjects/tox-conda/.tox/.tmp/package/1/tox-conda-0.3.0.dev0.
    zip,virtualenv==20.1.0,wincertstore==0.2,zipp==3.4.0
    py37 run-test-pre: PYTHONHASHSEED='423'
    py37 run-test: commands[0] | pytest --cov /tox_conda --cov-config 'C:\Users\AntoineD\PycharmProjects\tox-conda/tox.ini' -
    -timeout 180 --junitxml 'C:\Users\AntoineD\PycharmProjects\tox-conda\.tox/.test.py37.xml' tests
    WARNING: test command found but not installed in testenv
      cmd: C:\Users\AntoineD\Anaconda3\Scripts\pytest.EXE
      env: C:\Users\AntoineD\PycharmProjects\tox-conda\.tox\py37
    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!
    ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
    pytest: error: unrecognized arguments: --cov --cov-config tox.ini --timeout 180 tests
      inifile: C:\Users\AntoineD\PycharmProjects\tox-conda\setup.cfg
      rootdir: C:\Users\AntoineD\PycharmProjects\tox-conda

    ERROR: InvocationError for command 'C:\Users\AntoineD\Anaconda3\Scripts\pytest.EXE' --cov /tox_conda --cov-config tox.ini
     --timeout 180 --junitxml 'C:\Users\AntoineD\PycharmProjects\tox-conda\.tox/.test.py37.xml' tests (exited with code 4)
    ___________________________________________________________ summary ____________________________________________________________
    ERROR:   py37: commands failed

Also, the interpreter installed inside an anaconda env is not recorded by tox (in envdir/.tox-config1) the first time an env is created, then on the second run of an env tox cannot reuse it and thus recreates the env. This happens on all platforms.

I will propose a PR for these issues.

Closing since it is fixed in master.

Version 0.3.0 just released contains this.

Thanks a lot @gaborbernat.
BTW, I'm working on a fix for #19.