Skip to content

Commit

Permalink
ci: 🎑 Add Install script to setup package build environment
Browse files Browse the repository at this point in the history
βœ… Closes: #371
  • Loading branch information
yashksaini-coder committed Nov 7, 2024
1 parent 85fad94 commit 1653529
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -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!"

0 comments on commit 1653529

Please sign in to comment.