Nacki
Nacki•13mo ago

curious about how do people handle

curious about how do people handle python dependencies when running python wmill scripts locally? struggling to figure out a good pattern in folders that have several python scripts
6 Replies
Alper
Alper•13mo ago
i use pdm to create a local venv and add all dependencies in there
rubenf
rubenf•13mo ago
^ I think local venv are the way to go
Nacki
Nacki•13mo ago
The difference here as I see is that the python script on wmill cloud has it's own self-contained dependencies to itself "as a script". Meaning, if you have two scripts in a folder in wmill, both of them can use different versions of the same package without impacting the other dependencies. This is not the case with venvs, at least not in the way that I understand they work, if I create a venv for a local folder, all python scripts in the local folder share the same dependencies and versions. Unless there is a way to create one venv per one script in the same folder and somehow configer them to use distinct dependency files like requirements.txt // pyproject.toml, but using poetry I don't see how to do that, is that what you mean PDM supports?
rubenf
rubenf•13mo ago
you are correct with respect to the dependencies, you would have to create one venv per script to be rigorously the same but in most case it doesn't matter to have exactly the same versions if you don't want the trouble
Alper
Alper•13mo ago
yes, you can activate different venvs in the same folder for different scripts manually. don't believe pdm is any better in that matter than other package managers
Nacki
Nacki•13mo ago
alright, thank you so much for the feedback 🙂