Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pytoxbot opened this issue Sep 17, 2016 · 15 comments
Closed

Comments

@pytoxbot
Copy link

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?

@pytoxbot
Copy link
Author

Original comment by @graingert

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

@pytoxbot
Copy link
Author

Original comment by @graingert

You also get the same problem if -r{toxinidir}requirements.txt is used

@pytoxbot
Copy link
Author

Original comment by @graingert

Might be an idea to use https://pypi.python.org/pypi/pip-accel

@pytoxbot
Copy link
Author

Original comment by @tkf

@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.

@pytoxbot
Copy link
Author

Original comment by @hpk42

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.

@pytoxbot
Copy link
Author

Original comment by @lukaszb

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.

@pytoxbot
Copy link
Author

Original comment by @hpk42

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.

@pytoxbot
Copy link
Author

Original comment by @tkf

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?

@pytoxbot
Copy link
Author

Original comment by @hpk42

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?

@pytoxbot
Copy link
Author

Original comment by @tkf

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

@obestwalter
Copy link
Member

Reading through this my impression is that the existing functionality is already enough and the opinions differ if and how this should be solved.

I would tend to close this as wontfix soonish - any objections?

@graingert
Copy link

Actually it's not too hard to inspect the requirements of a package via setuptools

@RonnyPfannschmidt
Copy link

@graingert actually its nondetermistic and broken to try and do so with just setuptools ^^

the amount of logic, sandboxing &more pip adds around to keep things sane is hard to copy

@Varriount
Copy link

@obestwalter I just ran into this issue recently, and it strikes me as very unexpected behavior.
When I run tox, I expect all my changes - documentation, code, etc - to be incorporated in the environments managed by tox. I tend to think of setup.py as just another python file in the project.

At the very least, the documentation needs to explicitly mention this behavior. Ideally python setup.py --requires would also print out the install_requires input, but it prints out packages fed into requires instead (is requires even used anymore?).

@obestwalter
Copy link
Member

At the very least, the documentation needs to explicitly mention this behavior.

I agree, that is the least we can do.

@gaborbernat gaborbernat removed the bug:normal affects many people or has quite an impact label Sep 13, 2018
@gaborbernat gaborbernat added this to the 3.5 milestone Sep 18, 2018
@helpr helpr bot added the pr-available label Oct 7, 2018
@helpr helpr bot added pr-merged and removed pr-available labels Oct 7, 2018
@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants