Minimal requirements.txt
if you also need a way to figure what to put in requirements.in , you can first use pip-chill to find the minimal set of required packages you have . By combining these tools, you can show the dependency reason why each package is installed. The full cycle looks like this:
- Create virtual environment:
$ python3 -m venv venv - Activate it:
$ . venv/bin/activate - Install newest version of pip, pip-tools and pip-chill:
(venv)$ pip install --upgrade pip
(venv)$ pip install pip-tools pip-chill - Build your project, install more pip packages, etc, until you want to save...
- Extract minimal set of packages (ie, top-level without dependencies):
(venv)$ pip-chill --no-version > requirements.in - Compile list of all required packages (showing dependency reasons):
(venv)$ pip-compile requirements.in - Make sure the current installation is synchronized with the list:
(venv)$ pip-sync
thanks to @krubo.
-------------------------
you can also have just . w/o -e inside requirements.txt . This method just delegates all the requirements to setup.py and you don't need to force anybody into the editable mode. Users can still do pip install -e . if they want to. β stason
From < https://stackoverflow.com/questions/43658870/requirements-txt-vs-setup-py >