how does one pin the python dependencies
@Ask Inkeep how does one pin the python dependencies
3 Replies
Thanks for tagging me @rubenf. I'll look through relevant sources and get back to you shortly.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Dependencies in Python
* Jobs
* Python Quickstart
* python dependencies version
-----------------------------
Answer
To pin Python dependencies in Windmill, you can use the
#requirements:
or #extra_requirements:
comments at the top of your script. Here's how you can do it:
1. Using #requirements:
:
If you want to override the inferred imports or pin specific versions, you can use the #requirements:
comment. Here's an example:
(1)
2. Using #extra_requirements:
:
If you want to combine Windmill's automatic inference with pinned dependencies, use the #extra_requirements:
comment:
These methods allow you to specify exact versions of dependencies or add extra dependencies that might not be automatically inferred by Windmill.
It's worth noting that Windmill automatically manages dependencies for you in standard mode. When you import libraries in your Python script, Windmill parses these imports upon saving the script and automatically generates a list of dependencies. (2)
If you need to use a specific version of a library that's different from what Windmill infers, or if you're encountering conflicts between dependencies, these pinning methods can be particularly useful. (3)Feel free to tag @Ask Inkeep with additional questions.