Tox: skip_install should not build sdist

Created on 13 Sep 2018  路  9Comments  路  Source: tox-dev/tox

We're using tox to build environments for supporting services:

[testenv:ourservice]
setenv=PIP_INDEX_URL=https://ourdevpi
skip_install=True
deps=ourservice==1.0
basepython=python2.7

However, when we invoke tox -e ourservice, it still builds an sdist for the project under test (.).

I would expect the skip_install to also imply not to build the sdist.

We did find that thanks to the work in #270, we can add usedevelop=True and now in combination with skip_install=True, the sdist isn't built. It's surprising that would be needed at all.

Is there a reason the sdist is built when skip_install=True?

package-building minor new wanted medium

All 9 comments

I would say it's an undesired side effect of how things worked in past. We should check if all envs are skip install we should auto skip packaging. I would accept a such PR.

@gaborbernat Thanks for the quick reply.

check if all envs are skip_install.

Do you mean all defined envs or all indicated envs? Is that because the dist is built once per tox run? Is there currently logic that performs this function for usedevelop? If so, could you point me to it?

yes it's built per once, the build should be conditional if any to be executed envs wants to use it or not

https://github.com/tox-dev/tox/blob/master/src/tox/session.py#L524

GitHub
Command line driven CI frontend and development task automation tool - tox-dev/tox

@jaraco implemented and merged, should work once released 3.4.0.

Nice. Thank you so much, @gaborbernat .

Please note that there are use cases where one would want to build an sdist without installing it.

For example, I set up an environment that builds a macOS application using briefcase. This requires an sdist, but it should not be installed. I was using skip_install=true to cater to this use case. Having upgraded tox now, this is no longer building the sdist, even if I set skipsdist=false. That doesn't make sense, IMHO.

Would you consider reverting this behavior?

Rather than revert the behavior and re-introduce the undesirable behavior I reported, there's a better solution that would give the user control over (a) is an sdist built, (b) is it installed, where (b) implies (a), but otherwise they're independent.

That could work. So:

  • if you want to install the sdist
    skipsdist=false ; the default skip_install=false ; the default
  • if you want an sdist to be built, but not installed
    skipsdist=false ; the default skip_install=true
  • if you want no sdist to be built (and not installed)
    skipsdist=true skip_install=true

Would the following build an sdist anyway? It would perhaps be better to be explicit and raise an error.

skipsdist=true
skip_install=false

Additionally, could an alias named skip_sdist be introduced for skipsdist, to make naming consistent with skip_install (and skip_missing_interpreters)?

Was this page helpful?
0 / 5 - 0 ratings