From d08590645b9cb7082fdcaf33daaf18e6246d0c25 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Fri, 26 Jul 2024 20:27:29 -0400 Subject: [PATCH] refactor: remove support scripts, use pipx instead --- README.md | 3 +-- backup-podman-volumes.py | 7 +++++++ bootstrap.sh | 15 --------------- lock-deps.sh | 3 --- pyproject.toml | 8 -------- requirements.txt | 34 ---------------------------------- 6 files changed, 8 insertions(+), 62 deletions(-) delete mode 100644 bootstrap.sh delete mode 100755 lock-deps.sh delete mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/README.md b/README.md index 3c1796e..70ccaac 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ _Utilities to manage the machine Spadinastan runs on._ ## Setup -Python dependencies associated with the scripts can be installed via `./bootstrap.sh`, which provides a venv to run the -scripts in. +Scripts present in this repository are meant to be run via `pipx`. ## Usage diff --git a/backup-podman-volumes.py b/backup-podman-volumes.py index e0eb012..97f932b 100644 --- a/backup-podman-volumes.py +++ b/backup-podman-volumes.py @@ -7,6 +7,13 @@ S3 and to a local path. Usage: python /backup-podman-volumes.py """ +# /// script +# dependencies = [ +# "pydantic", +# "boto3" +# ] +# /// + import subprocess import json import sys diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100644 index a8dae7e..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -python -m venv scripts.venv - -. scripts.venv/bin/activate - -python -m pip install pip~=24.0 pip-tools~=7.4 - -if [[ ! -f requirements.txt ]]; then - touch requirements.txt -fi - -pip-sync requirements.txt - -pip install -e . diff --git a/lock-deps.sh b/lock-deps.sh deleted file mode 100755 index 15f1fbc..0000000 --- a/lock-deps.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -pip-compile -o requirements.txt pyproject.toml diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index c3fa64a..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,8 +0,0 @@ -[project] -name = "scripts" -version = "0" -dependencies = [ - "boto3", - "pydantic", -] -requires-python = "~= 3.12" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 30997bc..0000000 --- a/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --output-file=requirements.txt pyproject.toml -# -annotated-types==0.7.0 - # via pydantic -boto3==1.34.140 - # via scripts (pyproject.toml) -botocore==1.34.140 - # via - # boto3 - # s3transfer -jmespath==1.0.1 - # via - # boto3 - # botocore -pydantic==2.8.2 - # via scripts (pyproject.toml) -pydantic-core==2.20.1 - # via pydantic -python-dateutil==2.9.0.post0 - # via botocore -s3transfer==0.10.2 - # via boto3 -six==1.16.0 - # via python-dateutil -typing-extensions==4.12.2 - # via - # pydantic - # pydantic-core -urllib3==2.2.2 - # via botocore