| Somewhat convoluted but I have started experimenting with treating my venv as immutable. So I do this: - Manually created requirements.txt with top level production requirements - Manually created requirements-dev.txt with top level dev requirements. - pip freeze > requirements-lock.txt (with no dev dependencies) When installing a new requirement: 1. Delete old venv and create new empty one. 2. pip install -r requirements.txt 3. pip freeze > requirements-lock.txt 4. pip install -r requirements-dev.txt This ensures your requirements-freeze.txt doesn’t include dev dependencies. With most packages that have binaries now releasing wheels the install isn’t too slow. Technically you could just save a copy of the venv after step 2 to speed up the process of installing new requirements. |