python - Maintaining different requirements files for virtualenv and pip -
python - Maintaining different requirements files for virtualenv and pip -
i know can utilize pip freeze
assist in creating list of requirements virtual environment, i'm having bit of difficulty managing of different packages.
i want maintain packages separate development , production, , unwieldy have production , development requirement files since using many packages (many of mutual each other.) how can more efficiently maintain production , development packages separate?
not hard @ all.
let's have 1 requirements file production: production.txt
, 1 development: development.txt
. create 3rd file, shared.txt
, has of dependencies in common. then, in each respective requirements file, list dependencies exclusive desired environment. @ head of development.txt
, production.txt
, link shared.txt
using -r shared.txt
. each file load mutual dependencies before loading exclusive dependencies.
example:
shared.txt
sharedexamplepackage1 sharedexamplepackage2 sharedexamplepackage3 sharedexamplepackage4 sharedexamplepackage5
development.txt
-r shared.txt devexamplepackage1 devexamplepackage2
production.txt
-r shared.txt productionexamplepackage1 productionexamplepackage2 productionexamplepackage3
python bash pip virtualenv
Comments
Post a Comment