Initialize a Python project with dependency management tools.
- Create the project folder:
mkdir my-project && cd my-project
- Run the initialize script:
curl 'https://raw.githubusercontent.com/jjwong0915/pip-setup/main/main.py' | python3
- Enable the virtual environment:
source .venv/bin/activate
- Isolate application-specific dependencies with venv
- Generate fully-specified dependencies with pip-tools
- Add production and development dependency specifications into
requirements/base.in
andrequirements/dev.in
respectively. For example:Django ~= 4.0
. - Compile the dependency specifications into requirement files:
pip-compile -o requirements/base.txt requirements/base.in && pip-compile -o requirements/dev.txt requirements/dev.in
- Install the compiled requirement files:
pip-sync requirements/base.txt requirements/dev.txt