File: cross-platform.just

package info (click to toggle)
cloc 2.08-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,304 kB
  • sloc: perl: 30,693; cpp: 1,219; python: 623; ansic: 334; asm: 267; makefile: 244; sh: 186; sql: 144; java: 136; ruby: 111; cs: 104; xml: 61; pascal: 52; lisp: 50; cobol: 35; haskell: 35; f90: 35; objc: 25; php: 22; javascript: 15; fortran: 9; ml: 8; tcl: 2
file content (27 lines) | stat: -rw-r--r-- 869 bytes parent folder | download
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
27
# https://github.com/casey/just/blob/master/examples/cross-platform.just
# 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 }}