I'm building a small Python package with a friend.
.
├── __init__.py
└── memoized.py
During the development process, I want to test the installed package - for example, to make sure that some __init__.py code runs as expected.
The current way to achieve this is:
- Create a virtualenv on
/tmp - Activate it
cdto the repo dirpython setup.py installcdelsewhere (to avoid importing from the directory instead of importing from the installed package)- Test the import
pip uninstall memoized- Repeat steps 3-7
This is long and cumbersome, and I vaguely remember there's a way to install a package in a way that does not copy its code to the virtualenv, but links to it instead. This way changing the code would be reflected at the next import, without re-installing.
I've searched for "Dynamic importing" and alike but it refers to a different feature.
How can I install a local Python package so that changes to the package code would be immediately reflected?
setup.pyfile ? Working in development mode is done withpython setup.py develop