tox-dev / tox-conda

Make tox cooperate with conda envs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 0.8 broken on Github Actions

ailin-nemui opened this issue · comments

fails on github actions:

Run tox
  tox
  shell: /usr/bin/bash -e {0}
.package create: /home/runner/work/user/user/.tox/.package
.package installdeps: setuptools, wheel
ERROR: invocation failed (exit code 1), logfile: /home/runner/work/user/user/.tox/.package/log/.package-4.log
================================== log start ===================================
Traceback (most recent call last):
  File "/usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py", line 32, in <module>
    backend_paths = sys.argv[4].split(os.path.pathsep) if sys.argv[4] else []
IndexError: list index out of range
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['/home/runner/work/user/user/.tox/.package/bin/python', '/usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py', '.tox/dist', 'setuptools.build_meta', '', '']' command failed.  (See above for error)

=================================== log end ====================================
ERROR: FAIL could not package project - v = InvocationError("/home/runner/work/user/user/.tox/.package/bin/python /usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py .tox/dist setuptools.build_meta '' ''", 1)
Error: Process completed with exit code 2.

conda 4.9.2 seems to be installed in github actions

for reference the steps from the action.yml

    - uses: actions/checkout@v2
    - name: add conda to path
      run: |
        echo "$CONDA/bin" >> $GITHUB_PATH
    - name: Install tox
      run: |
        conda install -c conda-forge --no-update-deps tox-conda=0.7.1 $(conda -V|tr ' ' '=')
    - name: Test with tox
      run: |
        tox

you can replace 0.7.1 with 0.8.0 to see the problem

Could you provide the log when running tox with -v please?

Run tox -v
  tox -v
  shell: /usr/bin/bash -e {0}
using tox.ini: /home/runner/work/user/user/tox.ini (pid 2089)
using tox-3.23.0 from /usr/share/miniconda/lib/python3.8/site-packages/tox/__init__.py (pid 2089)
.package cannot reuse: no previous config /home/runner/work/user/user/.tox/.package/.tox-config1
.package create: /home/runner/work/user/user/.tox/.package
[2097] /home/runner/work/user/user$ /usr/share/miniconda/bin/conda -h >.tox/.package/log/.package-0.log
[2098] /home/runner/work/user/user/.tox$ /usr/share/miniconda/bin/conda env create -p .package --file /home/runner/work/user/user/environment.yml >.package/log/.package-1.log
.package installdeps: setuptools, wheel
[3845] /home/runner/work/user/user$ /home/runner/work/user/user/.tox/.package/bin/python -m pip install setuptools wheel >.tox/.package/log/.package-2.log
write config to /home/runner/work/user/user/.tox/.package/.tox-config1 as 'd00015014a061a6883bf7bb90b93ee2b1bee447d19fb3d6a37571a289c44b3bd /home/runner/work/user/user/.tox/.package/bin/python\n3.23.0 0 0 0\n00000000000000000000000000000000 setuptools\n00000000000000000000000000000000 wheel'
[3862] /home/runner/work/user/user$ /home/runner/work/user/user/.tox/.package/bin/python /usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_requires.py setuptools.build_meta '' '' >.tox/.package/log/.package-3.log
[3875] /home/runner/work/user/user$ /home/runner/work/user/user/.tox/.package/bin/python /usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py .tox/dist setuptools.build_meta '' '' >.tox/.package/log/.package-4.log
ERROR: invocation failed (exit code 1), logfile: /home/runner/work/user/user/.tox/.package/log/.package-4.log
================================== log start ===================================
Traceback (most recent call last):
  File "/usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py", line 32, in <module>
    backend_paths = sys.argv[4].split(os.path.pathsep) if sys.argv[4] else []
IndexError: list index out of range
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['/home/runner/work/user/user/.tox/.package/bin/python', '/usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py', '.tox/dist', 'setuptools.build_meta', '', '']' command failed.  (See above for error)

=================================== log end ====================================
ERROR: FAIL could not package project - v = InvocationError("/home/runner/work/user/user/.tox/.package/bin/python /usr/share/miniconda/lib/python3.8/site-packages/tox/helper/build_isolated.py .tox/dist setuptools.build_meta '' ''", 1)
Error: Process completed with exit code 2.

Can you share you tox.ini?

a part of my tox.ini

[tox]
isolated_build = True
requires = tox-conda
envlist =
    # py37
    py38

[testenv]
conda_env = environment.yml
conda_install_args=
    --override-channels
extras = test
description = test
commands =
    pytest --continue-on-collection-errors {posargs}

It looks like this is related to isolated_build = True.
I will investigate but in the meantime could you try without?

Run tox -v
  tox -v
  shell: /usr/bin/bash -e {0}
using tox.ini: /home/runner/work/user/user/tox.ini (pid 2012)
using tox-3.23.0 from /usr/share/miniconda/lib/python3.8/site-packages/tox/__init__.py (pid 2012)
ERROR: pyproject.toml file found.
To use a PEP 517 build-backend you are required to configure tox to use an isolated_build:
https://tox.readthedocs.io/en/latest/example/package.html

Error: Process completed with exit code 1.

That should be fixed when this PR is merged.

@ailin-nemui
A new version of tox with the fix has been released, you may update to the last version of tox.

thanks, I can confirm it works with tox 3.23.1