File: cross-platform.just

package info (click to toggle)
rust-just 1.43.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,140 kB
  • sloc: sh: 300; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 796 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# use with https://github.com/casey/just
#
# Example cross-platform Python project
#

python_dir := if os_family() == "windows" { "./.venv/Scripts" } else { "./.venv/bin" }
python := python_dir + if os_family() == "windows" { "/python.exe" } else { "/python3" }
system_python := if os_family() == "windows" { "py.exe -3.9" } else { "python3.9" }

# Set up development environment
bootstrap:
    if test ! -e .venv; then {{ system_python }} -m venv .venv; fi
    {{ python }} -m pip install --upgrade pip wheel pip-tools
    {{ python_dir }}/pip-sync

# Upgrade Python dependencies
upgrade-deps: && bootstrap
    {{ python_dir }}/pip-compile --upgrade

# Sample project script 1
script1:
    {{ python }} script1.py

# Sample project script 2
script2 *ARGS:
    {{ python }} script2.py {{ ARGS }}