skipdist and usedevelop don't play well together

Issue #270 on hold
Alexandre Conrad created an issue

I'm trying to do usedevelop and skipsdist at the same time but it feels that they are mutually exclusive with tox.

I have 2 tasks, py34 and pep8. When I run py34 I want to use usedevelop=true but when I run pep8 I don't want my project to be installed at all and use skipsdist=true.

Please correct me if I'm wrong: skipsdist is only a global setting recognized under the section [tox] which would then skip the sdist step for all [testenv] sections which in turns would ignore any usedevelop=true flag since it's tox will not even try to install the testenv in the first place.

Can we have skipsdist be recognized under a [testenv]?

[tox]
envlist = py34, pep8

[testenv]
usedevelop = true
deps =
    -rtest-requirements.txt
commands =
    py.test {posargs:tests/}

[testenv:pep8]
skipsdist = true
basepython = python3.4
deps = flake8
commands =
    flake8 pricingsvc/ --max-line-length=100

[pytest]
addopts =
    --junitxml=junit.xml
    --cov=pricingsvc --cov-report=xml --cov-report=term-missing
    --verbose

Comments (7)

  1. Alexandre Conrad reporter

    Actually, I just noticed that there was a skip_install = true flag available for [testenv] (new in tox 1.9), I'll try using this and see if that solves my issue.

  2. Alexandre Conrad reporter

    The skip_install = true seems to have no effect (or at least not how I intended it to have). Here's my current tox.ini

    [tox]
    envlist = py34, pep8
    
    [testenv]
    usedevelop = true
    deps =
        -rtest-requirements.txt
    commands =
        py.test {posargs:tests/}
    
    [testenv:pep8]
    skip_install = true
    basepython = python3.4
    deps = flake8
    commands =
        flake8 pricingsvc/ --max-line-length=100
    
    [pytest]
    addopts =
        --junitxml=junit.xml
        --cov=pricingsvc --cov-report=xml --cov-report=term-missing
        --verbose
    

    and when I run tox -e pep8 -v it still seems to install the package (line pep8 develop-inst) even though skip_install = true:

    $ tox -e pep8 -v
    using tox.ini: /opt/src/PricingSvc/tox.ini
    using tox-2.1.1 from /opt/webapp/pricingsvc/local/lib/python3.4/site-packages/tox/__init__.py
    pep8 create: /opt/src/PricingSvc/.tox/pep8
      /opt/src/PricingSvc/.tox$ /opt/webapp/pricingsvc/bin/python3.4 -m virtualenv --python /opt/webapp/pricingsvc/bin/python3.4 pep8 >/opt/src/PricingSvc/.tox/pep8/log/pep8-0.log
    pep8 installdeps: flake8
      /opt/src/PricingSvc$ /opt/src/PricingSvc/.tox/pep8/bin/pip install flake8 >/opt/src/PricingSvc/.tox/pep8/log/pep8-1.log
    pep8 develop-inst: /opt/src/PricingSvc
      /opt/src/PricingSvc$ /opt/src/PricingSvc/.tox/pep8/bin/pip install -e /opt/src/PricingSvc >/opt/src/PricingSvc/.tox/pep8/log/pep8-2.log
    pep8 installed: -f /opt/pip/wheels,colorama==0.3.3,decorator==3.4.2,flake8==2.4.1,gunicorn==19.1.1,httplib2==0.9.1,mccabe==0.3,msgpack-python==0.4.6,ordereddict==1.1,PasteDeploy==1.5.2,pep8==1.5.7,-e git+git@code.corp.surveymonkey.com:devmonkeys/PricingSvc.git@b9e059f8416369615feccaa1af84f6434153b8c9#egg=pricingsvc-origin_tox_changes,pycountry==1.10,pycrypto==2.6.1,pyflakes==0.8.1,pyramid==1.5.2,python-dateutil==2.4.2,pytz==2015.4,PyYAML==3.11,RAttr==0.6.3,repoze.lru==0.6,requests==2.7.0,simplejson==3.8.0,six==1.9.0,SMCrypto==0.2.21,smlib.auth==3.0.0,smlib.config==0.3,smlib.locale==1.0.12,smlib.log==1.3.1,smpackage==0.22,tldextract==1.5.1,translationstring==1.3,validictory==1.0.0,venusian==1.0,waitress==0.8.9,WebOb==1.4.1,wheel==0.24.0,zope.component==4.2.2,zope.deprecation==4.1.2,zope.event==4.0.3,zope.i18n==4.0.0,zope.i18nmessageid==4.0.3,zope.interface==4.1.2,zope.schema==4.4.2
    pep8 runtests: PYTHONHASHSEED='248291095'
    pep8 runtests: commands[0] | flake8 pricingsvc/ --max-line-length=100
      /opt/src/PricingSvc$ /opt/src/PricingSvc/.tox/pep8/bin/flake8 pricingsvc/ --max-line-length=100
    __________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________
      pep8: commands succeeded
      congratulations :)
    

    What am I missing?

  3. Tai Lee

    Indeed, I also just tried skip_install = True in a testenv:flake8 section, but my project was still installed. Is this not what it is for? flake8 should be able to lint without having all my project's dependencies (specified in setup.py) installed into the venv (which takes a while)...

  4. Maximilian Hils

    FWIW, we were able to get the desired behaviour by using a tox configuration that looks like this:

    [tox]
    skipsdist = True
    
    [testenv]
    usedevelop = True
    
    [testenv:lint]
    usedevelop = False
    

    For reference, our full configuration is here.

  5. Log in to comment