jterrace
jterrace

Reputation: 67073

pip source requirement versioning

I'm using pip requirements files to manage a virtualenv for a project. There are some modules that are either not regularly updated on PyPi or I require a development version. In this case, pip has a great feature to pull from source. I can place this in my requirements file:

hg+https://bitbucket.org/ubernostrum/django-registration@fad7080fe769

The problem with this is that it always downloads the package every time pip -r is run. Instead, I can specify an egg name so it will know it's already installed:

hg+https://bitbucket.org/ubernostrum/django-registration@fad7080fe769#egg=django-registration

The problem I'm having now is that if I update the hash in the URL, the module is not updated unless I force updating by passing -U to pip. This takes a long time because every package is updated in the requirements file.

Is there some way to bump a version number when the repository hash is updated so pip will know an update is required?

Upvotes: 4

Views: 319

Answers (1)

Malcolm Box
Malcolm Box

Reputation: 4036

I think the simplest thing to do is to add a version string to the egg name e.g.

hg+https://bitbucket.org/ubernostrum/django-registration@fad7080fe769#egg=django-registration-1.2

And then bump the version string whenever you change the hash

Upvotes: 3

Related Questions