From 8fa97234e481d62755cefed1b8aedc1a92cac9a3 Mon Sep 17 00:00:00 2001 From: Sage Date: Wed, 21 Jan 2026 13:24:28 +0000 Subject: [PATCH] Add freeze command --- modules/home/terminal/hr/hr.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/home/terminal/hr/hr.sh b/modules/home/terminal/hr/hr.sh index cefeded..14ee834 100644 --- a/modules/home/terminal/hr/hr.sh +++ b/modules/home/terminal/hr/hr.sh @@ -2,7 +2,7 @@ set -e -if [ "$1" = "py" ] && [ "$2" = "init" ]; then +if [ "$1" = "init" ] && [ "$2" = "py" ]; then echo "Initializing python devenv..." # 1. Init devenv @@ -94,8 +94,23 @@ EOF exit 1 fi +elif [ "$1" = "freeze" ]; then + extra_index_url="https://europe-west1-python.pkg.dev/mk2-prod/python-packages/simple/" + + # Install the auth plugin and keyring CLI + uv pip install keyrings.google-artifactregistry-auth==1.1.2 keyring + + # Install project dependencies using the subprocess keyring provider + uv pip install --no-cache -e .[test] --extra-index-url "${extra_index_url}" --keyring-provider subprocess + + # Generate requirements.txt + echo "--extra-index-url ${extra_index_url}" > requirements.txt + uv pip freeze --exclude-editable >> requirements.txt + else - echo "Usage: hr py init" - echo " py init Initialize a python devenv environment (git-ignored)" + echo "Usage: hr " + echo "Commands:" + echo " init py Initialize a python devenv environment (git-ignored)" + echo " freeze Freeze dependencies to requirements.txt" exit 1 fi