I have a Python script, with several external dependencies, that I wish to distribute to colleagues. However, we will need to modify this script regularly so I don't want to install it per-se (i.e. copy to site-packages
). From what I've seen setuptools
seems to do this implicitly.
Is there a recommended approach to installing dependencies without installing the application/script itself?
You probably want to make sure that you and your colleagues use the same dependencies during development.
I think I would try to use virtualenv for this. If you and your collegues install it, it will give you a python environment for this project only, and dependencies for this project only.
So the steps would be:
Everybody installs virtualenv on their computers so they get an isolated environment to use for development of this project only.
One of you determine the current dependencies and installs them in your virtualenv.
You export a list of your used dependencies using this command:
(inside virtual environment) pip freeze > requirements.txt
You then share this text file with the others. They use this command to import the exact same packages and versions into their virtual environment:
(inside virtual environent) pip install -r requirements.txt
Just make sure that everybody enters their virtual environment before issuing these commands, otherwise the text file will contain their normal python environment installed packages.