Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

is this project necessary? #4

Closed
glyph opened this issue Feb 1, 2018 · 10 comments
Closed

is this project necessary? #4

glyph opened this issue Feb 1, 2018 · 10 comments
Labels

Comments

@glyph
Copy link

glyph commented Feb 1, 2018

On Treq, we have these three lines of tox.ini:

setenv =
    # Avoid unnecessary network access when creating virtualenvs for speed.
    VIRTUALENV_NO_DOWNLOAD=1
    PIP_DISABLE_PIP_VERSION_CHECK=1

https://github.com/twisted/treq/blob/c579f7366bd372322d04d013f088dceee6aeba6a/tox.ini#L20-L23

which seem to accomplish the same thing that this project does - at least, with a warm cache I can run my tox treq tests entirely offline.

Does this plugin do anything other than that?

@asottile
Copy link
Member

asottile commented Feb 1, 2018

It has two purposes:

  • in an enterprise setting you never want the default and so this is better than copy pasting to all repositories
  • I also believe (need to double check since I'm on my phone) that setenv is too late? edit: see comment below

@asottile
Copy link
Member

asottile commented Feb 1, 2018

@asottile
Copy link
Member

asottile commented Feb 1, 2018

So yes, it's mostly equivalent -- the only functional difference is this extension only exports VIRTUALENV_NO_DOWNLOAD=1 during virtualenv creation whereas setenv will set it for the entire test sequence (virtualenv creation, dependency installation, and test execution).

An example of how we deployed this at $previous_employer was to create a dh-virtualenv debian package with tox, tox-virtualenv-no-download (and a few other extensions such as tox-pip-extensions) installed. This debian package would be installed preferentially over the tox package provided by ubuntu (because we picked a higher version number). This would ensure that any tox invocation on $previous_employer machines wouldn't download from the internet independent of whether they had copy-pasted a setenv configuration. (we got burned by a setuptools upgrade several months earlier and this was the simplest way to roll this out to the thousand+ repositories using tox).

As I also find this behaviour desirable and work on many many projects (many which aren't mine!) I also set up a virtualenv at ~/opt/venv and install tox extensions and symlink tox into ~/bin.

Also note that I've suggested tox do something about this as well: tox-dev/tox#448 (I'm a tox maintainer too, so I could just make it happen -- though tox tends to lean towards "least surprise" and not overriding default behaviours of virtualenv / pip implicitly).

@asottile
Copy link
Member

Thanks for the issue! Hopefully this was helpful -- comment below if additional clarification is needed :)

@glyph
Copy link
Author

glyph commented Mar 17, 2018

Thanks so much for the thorough explanation!

@gaborbernat
Copy link

I would say not anymore 👍

@asottile
Copy link
Member

indeed, in latest tox this is obsolete 🎉

@gaborbernat
Copy link

Maybe we should mention it in the README and archive the repository.

@asottile
Copy link
Member

yep, did that

@gaborbernat
Copy link

thanks 😎

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants