Environment is not recreated when install_requires in setup.py is changed

Issue #93 on hold
Takafumi Arakaki created an issue

Here is a recipe to reproduce this problem.

  1. Run tox in some project.
  2. Add a new package to install_requires in setup.py
  3. Run tox again.

I can write dependency in tox.ini to force recreate, but I think it is simpler if tox reinstall package. I think it is as easy as removing --no-deps flag so I wonder why --no-deps is used in the first place. Is there any drawbacks? Wouldn't it be nice if we can disable this flag optionally?

Comments (12)

  1. Takafumi Arakaki reporter

    I guess a simple solution is to put the following in the first entry of commands

    pip install --quiet --use-mirrors {toxinidir} --log {envtmpdir}/pip.log
  2. Holger Krekel repo owner

    Some time ago someone else complained that reinstalling a package would always re-install the dependencies, increasing overall run time. Changing install_requires is a relatively rare event -- can you not issue --recreate on this occassion?

  3. Takafumi Arakaki reporter

    Can't we detect requirements before running pip? Or how about caching setup.py (or compare timestamp or checksum) and reinstall it without --no-deps when it is changed?

  4. Holger Krekel repo owner

    we could probably do a checksum of the setup.py and run a full (no --no-deps) install if it changes. There is no direct general way to just get the install_requires content out of it.

  5. Łukasz Balcerzak

    I would vote against it.

    Passing --recreate flag seems good enough. I often tinker setup.py file without touching deps at all and if I do, I actually know about it most of the time.

  6. Holger Krekel repo owner

    Maybe we could do a "setup.py egg_info" if "setuptools" appears in setup.py and then fish for *.egg-info/requirements.txt to get to know the deps. This would still allow changing other aspects of setup.py without recreating automatically the venv.

  7. Takafumi Arakaki reporter

    @lukaszb If you are running tox manually then --recreate is perfect. But how about when you are using it in Jenkins, for example?

    @hpk42 I think that's more accurate solution and I like that.

  8. Thomas “graingert” Grainger

    pull request #64 should help with this:

    simply configure your setup.py to pull install_requires out of requirements.txt, and set the deps to -r{toxinidir}requirements.txt

  9. Log in to comment