Skip to content

Instantly share code, notes, and snippets.

@qwcode
Created July 11, 2012 05:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwcode/3088149 to your computer and use it in GitHub Desktop.
Save qwcode/3088149 to your computer and use it in GitHub Desktop.
non-recursive force upgrade

Upgrading a package, w/o upgrading dependencies that are already satisifed

suppose the following packages: a, b, c, d

with the following dependency relationships between their versioned distributions

  • a-1

  • b

  • c-1

  • c-1

    • d-1
  • a-2

    • b
    • c-2
  • c-2

    • d-2

and suppose the following distributions are available on the index: a-1, a-2, b-1, b-2, c-1, c-2, d-1, d-2

let's do the following in a virtualenv:

pip install b==1
pip install a==1
pip freeze

you'll have this:

a==1
b==1
c==1
d==1

now do this:

pip install -U --no-deps a
pip freeze

you'll have this:

a==2
b==1
c==1
d==1

now do this:

pip install a
pip freeze

you'll have this:

a==2
b==1
c==2
d==2

c and d are upgraded to fulfill requirements, but b is not upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment