Replacing custom forks dependencies with pip

I am creating an application that uses photologueseveral other packages with photologuelike dependency (for example, cmsplugin-photologue). However, I need to use a modified version photologuehosted on github. Then all this will be deployed to Heroku, which means that dependency installations are done exclusively through the file requirements.txt.

In principle, this is done quite simply: I can simply add the repository to the requirements file, as described here , and it will be installed. The problem is that the source is photologuealso installed and ends with the one that is being used.

So, the general question is: using pip, how can I replace an application that is a dependency of several applications with my own version of this application?

+4
source share
2 answers

just use the -Uor option --upgradeto replace the original package in your vein with your custom version:

cd myapp && venv/bin/pip install -U git+https://github.com/jcomeauictx/django-crispy-forms.git

then in your require.txt replace the line

django-crispy-forms==1.4.0

from

git+https://github.com/jcomeauictx/django-crispy-forms.git

when you click on your heroku instance you should see something like:

-----> Deleting 1 files matching .slugignore patterns.
-----> Python app detected
-----> Uninstalling stale dependencies
       Uninstalling django-crispy-forms-1.4.0:
         Successfully uninstalled django-crispy-forms-1.4.0
-----> Installing dependencies with pip
       Collecting git+https://github.com/jcomeauictx/django-crispy-forms.git (from -r requirements.txt (line 6))
         Cloning https://github.com/jcomeauictx/django-crispy-forms.git to /tmp/pip-AlSPnZ-build
       Installing collected packages: django-crispy-forms
         Running setup.py install for django-crispy-forms
       Successfully installed django-crispy-forms-1.5.0
+4
source

PIP , PIP (, --extra-index-url --find-links), . , , .

, - :

...
django-photologue
...

--find-links https://github.com/jdriscoll/django-photologue
0

All Articles