Skip to content

Commit

Permalink
feat: add python and venv to repo for upcoming custom scripts / hacks
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Sep 21, 2024
1 parent a37e9b6 commit 596108b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
export KUBECONFIG="$(expand_path ./kubernetes/main/kubeconfig)"
export SOPS_AGE_KEY_FILE="$(expand_path ./age.key)"
export TALOSCONFIG="$(expand_path ./kubernetes/main/talosconfig)"
# Python
PATH_add "$(expand_path ./.venv/bin)"
export VIRTUAL_ENV="$(expand_path ./.venv)"
# Taskfile
export TASK_X_MAP_VARIABLES=0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.private/
.task/
.venv/
scripts/
*.secret.env
*.secret.yaml
Expand Down
16 changes: 16 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ version: "3"

vars:
KUBERNETES_DIR: "{{.ROOT_DIR}}/kubernetes"
PIP_REQUIREMENTS_FILE: "{{.ROOT_DIR}}/requirements.txt"
PYTHON_BIN: python3

env:
KUBECONFIG: "{{.KUBERNETES_DIR}}/kubernetes/main/kubeconfig"
SOPS_AGE_KEY_FILE: "{{.ROOT_DIR}}/age.key"
VIRTUAL_ENV: "{{.ROOT_DIR}}/.venv"

includes:
bootstrap: .taskfiles/bootstrap
Expand All @@ -18,3 +21,16 @@ includes:
tasks:

default: task -l

venv:
desc: Set up virtual environment
cmds:
- "{{.PYTHON_BIN}} -m venv {{.VIRTUAL_ENV}}"
- '{{.VIRTUAL_ENV}}/bin/python3 -m pip install --upgrade pip setuptools wheel'
- '{{.VIRTUAL_ENV}}/bin/python3 -m pip install --upgrade --requirement "{{.PIP_REQUIREMENTS_FILE}}"'
sources:
- "{{.PIP_REQUIREMENTS_FILE}}"
generates:
- "{{.VIRTUAL_ENV}}/pyvenv.cfg"
preconditions:
- { msg: "Missing Pip requirements file", sh: "test -f {{.PIP_REQUIREMENTS_FILE}}" }
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests>1, <3

0 comments on commit 596108b

Please sign in to comment.