tox: skipsdist and usedevelop don't play well together

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]?

#!ini

[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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 6
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

and if they are used together usedevelop wins over skip_install.

I think that’s the point that needs reaching an agreement.

Considering that (directly or indirectly - like in my config) one arrives to have both

skip_install = True
usedevelop = True

in one environment. To my mind it seems much more reasonable to honour skip_install, because it doesn’t really disrespect usedevelop. I see it clear that usedevelop is an install mode, so if there’s nothing to install it’s still honoured. Best

Hi thanks for your reply. Consider this case, which is I think can be quite common:

[tox]
skipdist = True

[testenv]
usedevelop = True   # By default all tests shall run with develop
changedir = tests
commands =
    py.test {posargs}
deps =
    -r{toxinidir}/test-requirements.txt
    -r{toxinidir}/requirements.txt

[testenv:flake8]
changedir = {toxinidir}
deps = flake8
skip_install = True   # In this particular env don't install the package, we just need the env
commands = flake8 setup.py mypackage tests

As you say, the options seem exclusive, but due to “inheritance” we end up with a configuration that produces a strange effect - installing in develop when we instructed not to install at all. And typically rules defined in a tighter scope should have precedence. Due to complex deps, the package installation, which was not intended, fails.

It is in the title already - or what do you mean?

I meant skip_install, sorry

I looked into the source and can be easily fixed. I’m running the tests. I can make a PR later. Thanks