From 1653529e47e914b74d1e0f9a63864acc87c24e04 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Thu, 7 Nov 2024 22:28:45 +0530 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20Add=20Install=20script=20t?= =?UTF-8?q?o=20setup=20package=20build=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #371 --- scripts/install.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 scripts/install.sh diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..09cdd88 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Check if Python is installed +if ! command -v py &> /dev/null; then + echo "Python is not installed. Please install Python 3.10 or above." + exit 1 +fi + +# Check Python version +PYTHON_VERSION=$(py --version) +REQUIRED_VERSION=(3 10 0) +if [[ "$PYTHON_VERSION" < "${REQUIRED_VERSION[*]}" ]]; then + echo "Python version must be 3.10 or higher. Current version is $PYTHON_VERSION." + exit 1 +else + echo "Python version is $PYTHON_VERSION - OK" +fi + +# Check if pip is installed +if ! command -v pip3 &> /dev/null; then + echo "pip is not installed. Installing pip..." + python3 -m ensurepip --upgrade +else + echo "pip is already installed - OK" +fi + +# Prompt user for upgrading to the latest pip version +read -p "Do you want to upgrade to the latest pip version? (y/n): " answer +if [[ "$answer" == [Yy]* ]]; then + echo "Upgrading pip to the latest version..." + python3 -m pip install --upgrade pip +fi + +# Upgrade setuptools, pip, and wheel +echo "Upgrading setuptools, pip, and wheel..." +python3 -m pip install --upgrade setuptools pip wheel + +# Install tqdm +echo "Installing tqdm..." +python3 -m pip install tqdm + +# Install twine with the --user flag +echo "Installing twine with the --user flag..." +python3 -m pip install --user twine + +echo "Installation complete!"