Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda