From d1e3db3b1cbceef6d55c33700f74f5c6681172db Mon Sep 17 00:00:00 2001 From: adebert Date: Mon, 9 Dec 2024 02:09:08 -0300 Subject: [PATCH] Refactor setup scripts: remove deprecated pycache cleanup, reorganize virtual environment setup, and streamline dependency installation --- pyproject.toml | 1 - scripts/{ => prflow}/close-gflow | 0 scripts/{ => prflow}/create-gflow | 0 scripts/{ => prflow}/gitprflow.sh | 0 scripts/py-remove-pycache | 1 - scripts/setup::all | 10 ++++++++++ scripts/{setup => setup::deps} | 4 ++-- scripts/setup::venv | 5 +++++ 8 files changed, 17 insertions(+), 4 deletions(-) rename scripts/{ => prflow}/close-gflow (100%) rename scripts/{ => prflow}/create-gflow (100%) rename scripts/{ => prflow}/gitprflow.sh (100%) delete mode 100755 scripts/py-remove-pycache create mode 100755 scripts/setup::all rename scripts/{setup => setup::deps} (79%) create mode 100755 scripts/setup::venv diff --git a/pyproject.toml b/pyproject.toml index 5608c5d..8c4dad0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ classifiers = [ urls = { "Homepage" = "https://github.com/arthur-debert/rangy" } dependencies = [ - "dateutils==0.6.12", "toml>=0.10.2", ] diff --git a/scripts/close-gflow b/scripts/prflow/close-gflow similarity index 100% rename from scripts/close-gflow rename to scripts/prflow/close-gflow diff --git a/scripts/create-gflow b/scripts/prflow/create-gflow similarity index 100% rename from scripts/create-gflow rename to scripts/prflow/create-gflow diff --git a/scripts/gitprflow.sh b/scripts/prflow/gitprflow.sh similarity index 100% rename from scripts/gitprflow.sh rename to scripts/prflow/gitprflow.sh diff --git a/scripts/py-remove-pycache b/scripts/py-remove-pycache deleted file mode 100755 index e66703a..0000000 --- a/scripts/py-remove-pycache +++ /dev/null @@ -1 +0,0 @@ -find . -type d -name "__pycache__" -exec rm -r {} + \ No newline at end of file diff --git a/scripts/setup::all b/scripts/setup::all new file mode 100755 index 0000000..cbfd406 --- /dev/null +++ b/scripts/setup::all @@ -0,0 +1,10 @@ +#! /usr/bin/env bash + +# calls the setup::venv and setup::requirements scripts + +script_dir=$(dirname "$0") +"$script_dir/setup::venv" || exit 1 +"$script_dir/setup::deps" + +source .venv/bin/activate || { echo "Virtual environment activation failed!"; exit 1; } +"$@" # Execute any command passed as arguments diff --git a/scripts/setup b/scripts/setup::deps similarity index 79% rename from scripts/setup rename to scripts/setup::deps index c6e5f5e..b2a45c8 100755 --- a/scripts/setup +++ b/scripts/setup::deps @@ -1,6 +1,6 @@ if [ ! -d .venv ]; then - echo "Creating virtual environment .venv" - python3 -m venv .venv + echo "Venv should be created, see setup::venv.sh" + exit 1 fi source .venv/bin/activate &&\ diff --git a/scripts/setup::venv b/scripts/setup::venv new file mode 100755 index 0000000..b34b9d2 --- /dev/null +++ b/scripts/setup::venv @@ -0,0 +1,5 @@ +if [ ! -d .venv ]; then + echo "Creating virtual environment .venv" + python3 -m venv .venv + +fi