Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

229
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda