Hi I am looking for recommendations/best practices...
# general
b
Hi I am looking for recommendations/best practices approach for managing virtual environment and third party dependencies? I have a mono repo with multiple projects, each project has it's third party packages which I maintain in
requirements.txt
. In poly repo, I used to create virtual environments, but my understanding with pants tells me that I can achieve similar thing, if I maintain separate lock files for each project and I export the virtual environment using
pants export --py-resolve-format=mutable_virtualenv --export-resolve=python-default
. Is that the recommended way? Another follow up question is, when I add a new package to
requirements.txt
, do I have to update the lock file? And once I update the lock file is it exported to the pants virtual environment or I have to run the command
pants export ...
command again.
n
You need to update the lock file whenever you add/remove/change a dependency within it.. and yes, if you want to then update your venv, you need to re-export it.