Debian Codegraph @

tests/inputs/cross-platform.just

raw
1 # https://github.com/casey/just/blob/master/examples/cross-platform.just
2 # use with https://github.com/casey/just
3 #
4 # Example cross-platform Python project
5 #
6
7 python_dir := if os_family() == "windows" { "./.venv/Scripts" } else { "./.venv/bin" }
8 python := python_dir + if os_family() == "windows" { "/python.exe" } else { "/python3" }
9 system_python := if os_family() == "windows" { "py.exe -3.9" } else { "python3.9" }
10
11 # Set up development environment
12 bootstrap:
13 if test ! -e .venv; then {{ system_python }} -m venv .venv; fi
14 {{ python }} -m pip install --upgrade pip wheel pip-tools
15 {{ python_dir }}/pip-sync
16
17 # Upgrade Python dependencies
18 upgrade-deps: && bootstrap
19 {{ python_dir }}/pip-compile --upgrade
20
21 # Sample project script 1
22 script1:
23 {{ python }} script1.py
24
25 # Sample project script 2
26 script2 *ARGS:
27 {{ python }} script2.py {{ ARGS }}