Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Versioning a virtualenv for a django deployment - pip output of requirements

I'm currently writing a deployment script for a django app using fabric. It seems necessary / useful to me to have a system for versioning the virtualenv that the app uses, in case a rollback is needed.

The most robust way I can think to do this is to create virtualenvs with the name equal to the md5 hash of the contents of the requirements file. this means that when the requirements change, the checksum will change and I can copy/update the virtualenv with a new hash and preserve the old hash virtualenv in case I need to rollback (then it's just a matter of switching a 'current' symlink).

Trouble is I'm using nested requirements file syntax in e.g. my production.txt requirements file (-r base.text) so the md5 hash isn't going to take into account base requirements changes etc.

Is there any output pip can provide to parse these files prior to installing them? I don't want to have to install them then pip freeze just to figure out if something has changed.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Instead of using nested requirements, why not just use simple unix tools like cat to calculate the md5. And just use multiple requirements files.

Or if you really want to us nested requirements, you will need to write a small shell script that grepped for -r file.txt and added it to your md5 calculation.

It's a neat idea though. Hashing the requirements.txt file and saving the env using that name. Makes for caching it easy and fast in distributed build systems too.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!