pip - Python requirements.txt use local git dependency -
i have small python flask app on centos-7 vm runs in docker, along nginx reverse proxy. requirements.txt
pulls in several external utilities using git+ssh such as:
git+ssh://path-to-our-repo/some-utility.git
i had make change utility, cloned locally, , need app use local version. cloned , modified utility in local directory:
/var/work/some-utility
in requirements.txt changed entry to:
git+file:///var/work/some-utility
but when try run app
sudo docker-compose
i error message
invalid requirement: 'git+file:///var/work/some-utility' looks path. exist ?
how can use local copy of "some-utility" ?
i tried:
git+file:///var/work/some-utility#egg=someutility
but produced same error.
i looked @ pip install local git repository.
this related question:
i suppose people why not check in development branch of some-utility corporate git repo, in case not have privileges that.
or maybe problem related docker, , need map some-utility folder docker container, , use path? docker noob.
--- edit ---
thank larsks answer. tried add some-utility folder docker-compose.yml:
volumes: - ./some-utility:/usr/local/some-utility
and changed requirements.txt to
git+file:///usr/local/some-utility
but our local git repo went down maintenance, have wait bit come try this.
=== edit 2 ===
after made above changes, following error when running docker-compose when tries build endpoint app:
cloning file:///usr/local/some-utility /tmp/pip-yj9xxtae-build fatal: '/usr/local/some-utility' not appear git repository
but /usr/local/some-utility folder contain cloned some-utility repo, , can go there , run git status.
if you're running pip install
inside container, of course /var/work/some-utility
needs available inside container.
you can expose directory inside container using host volume mount, this:
docker run -v /var/work/some-utility:/var/work/some-utility ...
Comments
Post a Comment