You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.0 KiB
Plaintext

set shell := ["zsh", "-cu"]
venv_root := justfile_directory() / ".venv"
requirements := justfile_directory() / "requirements.txt"
venv_bins := venv_root / "bin"
python := venv_bins / "python"
pip := venv_bins / "pip"
[private]
default:
@ just --list
# remove all the built stuff and caches and all that
clean:
#!/usr/bin/env bash
set -euo pipefail
rm -rf {{ venv_root }}
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf __pycache__
# creates a python virtualenv if one does not exist
venv:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -d {{ venv_root }} ] ; then
echo Creating Python virtualenv
python3 -m venv {{ venv_root }}
# ensure pip is up to date
{{ pip }} install -U pip
fi
# installs all our build dependencies
deps: venv
#!/usr/bin/env bash
set -euo pipefail
{{ pip }} install -r {{ requirements }}
# convenience method to forward to the pip in our virtualenv
pip +a="": venv
#!/usr/bin/env bash
set -euo pipefail
{{ pip }} {{ a }}
show-packages: venv
@ {{ python }} -m pip freeze