Skip to main content

fish_functions/pip_sync.fish

1function pip_sync --description "Make a virtualenv dependencies look like requirements.txt"
3 # If there isn't a virtualenv already, create one
4 if test -z "$VIRTUAL_ENV"
5 venv
6 end
8 # If there are no `requirements.txt` files, run my `pip compile`
9 # script to create a set of version pins.
10 if not test -e requirements.txt; and not test -e dev_requirements.txt; or contains -- --compile $argv;
11 or contains -- --upgrade $argv
12 pip_compile $argv
14 echo ""
15 end
17 # Actually run the `uv pip sync` command.
18 run_pip_sync $argv
19end