aboutsummaryrefslogtreecommitdiff
path: root/Python/setup.sh
diff options
context:
space:
mode:
authorOxbian <oxbian@mailbox.org>2025-02-08 14:56:35 -0500
committerOxbian <oxbian@mailbox.org>2025-02-08 14:56:35 -0500
commit27564303b4c0e0b569141afcf6c6513c74b17ff7 (patch)
tree2e8c4dc58abda7d603567fda5b52e539230942f6 /Python/setup.sh
parentece2583cee34ad19e3b3458e9c884638c8f8b73c (diff)
downloadcoding-style-main.tar.gz
coding-style-main.zip
feat: improving C setup, adding Python setupmain
Diffstat (limited to 'Python/setup.sh')
-rwxr-xr-xPython/setup.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/Python/setup.sh b/Python/setup.sh
new file mode 100755
index 0000000..f094e00
--- /dev/null
+++ b/Python/setup.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env sh
+# Setup a Python environment using ArKa coding style
+
+vcs=true
+project_name="$1"
+script_dir="$(cd "$(dirname "$0")" && pwd)"
+
+# Parsing args
+for arg in "$@"; do
+ if [ "$arg" = "--no-vcs" ]; then
+ vcs=false
+ else
+ project_name="$arg"
+ fi
+done
+
+if [ -n "$project_name" ]; then
+ printf "Installing your environment...\n"
+ mkdir -p "$project_name" || exit
+ cd "$project_name"
+
+ # If vcs is true, init git in the project
+ if [ "$vcs" = true ]; then
+ printf "Setting up git in %s\n" "$project_name"
+ git init
+ cp "$script_dir"/.gitignore .gitignore
+ fi
+
+ printf "Setting up Python virtual environment + needed dev requirements\n"
+ python3 -m venv .venv
+ source .venv/bin/activate
+ cp "$script_dir"/requirements_dev.txt requirements_dev.txt
+ pip install -r requirements_dev.txt
+ # copy linters, formatters config
+ printf "Your python environment is now ready, enjoy :)\n"
+else
+ printf "Usage:\n\t%s [--no-vcs] {dirname}\n\n\t--no-vcs: git vcs not added to the project\n" "$0"
+fi
+
+
ArKa projects. All rights to me, and your next child right arm.