SaltStack and multiple pip requirements files
Say you have requirements files that are setup like this:
Which is not only a very common setup, but also a best practice in the Python community.
Unfortunately, this doesn’t work out of the box with SaltStack. If you setup a managed virtual environment like this:
You get the following error:
Could not open requirements file: [Errno 2] No such file or directory: '/tmp/base.pip'
This happens because Salt ends up moving this file to /tmp to help with chowning the entire venv when it’s finished. To get around this issue you just need to add:
no_chown: True
to your Salt state like so:
Related GitHub issues:
Hope this helps!
Frank Wiles
Founder of REVSYS and former President of the Django Software Foundation . Expert in building, scaling and maintaining complex web applications. Want to reach out? Contact me here or use the social links below.