N.b., Sometimes the order of installation is meaningful, e.g., in la-metro-councilmatic. If you install a dependency directly with pip, and it breaks the app, try replacing the relevant line in requirements.txt with -e /container/path/to/dependency, then reinstalling all the dependencies: docker-compose up -d && docker-compose exec app pip install -r requirements.txt.
Restart the containers (so Python will reload libs)
~If you make changes to library you need to restart containers~ This is actually not necessary!
This comes up for Dedupe, as well as for django-councilmatic not infrequently. Let's add this strategy to the local development with Docker documentation.
Documentation request
@fgregg figured out how to hack on local Python packages using containerized application setups. (Copied from https://github.com/dedupeio/dedupe-service/pull/1500#issuecomment-538135818.)
Notes on working developing a library dependency.
N.b., Sometimes the order of installation is meaningful, e.g., in
la-metro-councilmatic
. If you install a dependency directly withpip
, and it breaks the app, try replacing the relevant line inrequirements.txt
with-e /container/path/to/dependency
, then reinstalling all the dependencies:docker-compose up -d && docker-compose exec app pip install -r requirements.txt
.This comes up for Dedupe, as well as for
django-councilmatic
not infrequently. Let's add this strategy to the local development with Docker documentation.