Skip to content

Commit

Permalink
clarify specifiers allowed for the requirements comment (#727)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Huang <[email protected]>
  • Loading branch information
mhuang74 and mhuang-marin authored Oct 7, 2024
1 parent ee9115c commit 7802816
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/advanced/15_dependencies_in_python/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,18 @@ scripts locally and on Windmill. See [Developing scripts locally](../4_local_dev
### Pinning Dependencies and Requirements

If the imports are not properly analyzed, there exists an escape hatch to
override the inferred imports. One needs to head the Script with the following comment:
override the inferred imports. One needs to head the Script with the `requirements` comment followed by dependencies.
The standard pip [requirement specifiers](https://pip.pypa.io/en/stable/reference/requirement-specifiers/) are supported. Some examples:

```python
#requirements:
#dependency
#version_pinned_dependency==0.4
#dependency1[optional_module]
#dependency2>=0.40
#dependency3@git+https://github.com/myrepo/dependency3.git

import dependency
import dependency1
import dependency2
import dependency3

def main(...):
...
Expand Down

0 comments on commit 7802816

Please sign in to comment.