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

support tracking changes in requirements.txt without full rebuild #296

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

support tracking changes in requirements.txt without full rebuild #296

pytoxbot opened this issue Sep 17, 2016 · 2 comments
Labels
area:testenv-creation feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. level:hard rought estimate that this might be quite hard to implement

Comments

@pytoxbot
Copy link

Use case

during the development, you often switch between new and old requirements.
This currently forces the user to run tox -r.
Sometimes it's not serious, but for automated tests in CI, using internet - it can be several minutes overhead of ~5 or even more minutes. This becomes problematic for short builds: test suite that runs 1 minutes is waiting for tox ~5 minutes.

scenarios I'd like to handle are:

  1. addition of new packages
  2. removal of currently installed packages
  3. upgrade of existing package(s)
  4. downgrade of existing package(s)

Scope

only handle 4 situations, nothing else

Implementation:

Use difflib module's functionality: it already has ndiff() seemingly very useful for this purpose.
based on that diff we should generate 2 lists:

  1. Packages_to_remove
  2. Packages_to_install

Testing should be done first on the function that properly detects what needs to be removed and what needs to be installed.

  1. Initially - just remove anything that is changed, and install it from scratch
  2. later - we might want to optimize:
    1. packages to remove - to contain packages that are supposed to be removed or downgraded
    2. packages to install - should contain packages that are supposed to be installed or upgraded with -I option (i.e. older will be uninstalled)

A relatively easy to implement approach would be to compare:
*. current pip freeze output (on the left)

  • requirements.txt (on the right)

As a result, if there are diffs (lines with "-" and lines with "+"), those with "-" can be uninstalled, and those with "+" - installed.

@pytoxbot
Copy link
Author

Original comment by @The-Compiler

This looks like something to be done after #149, right? It also doesn't seem to be specific to requirements.txt, e.g. when having the dependencies in tox.ini the same would apply as well.

@obestwalter obestwalter added area:testenv-creation feature:new something does not exist yet, but should level:hard rought estimate that this might be quite hard to implement and removed enhancement labels Sep 4, 2017
@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label May 2, 2019
@gaborbernat
Copy link
Member

This is now done in tox 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:testenv-creation feature:new something does not exist yet, but should help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. level:hard rought estimate that this might be quite hard to implement
Projects
None yet
Development

No branches or pull requests

3 participants