File size: 906 Bytes
4c6a68b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

echo "πŸš€ Starting the PIP package build & upload process..."

# Step 1: Ensure required tools are installed
echo "βœ… Installing required dependencies (setuptools, wheel, twine)..."
pip install --upgrade setuptools wheel twine

# Step 2: Remove old build directories
echo "πŸ—‘οΈ  Cleaning old builds..."
rm -rf dist build *.egg-info

# Step 3: Build the package
echo "πŸ“¦ Building the package..."
python setup.py sdist bdist_wheel

# Step 4: Ask user where to upload
read -p "Upload to (1) PyPI or (2) TestPyPI? [1/2]: " upload_option

if [ "$upload_option" == "2" ]; then
    echo "πŸš€ Uploading package to TestPyPI..."
    twine upload --repository testpypi dist/*
    echo "βœ… Package uploaded to TestPyPI!"
else
    echo "πŸš€ Uploading package to PyPI..."
    twine upload dist/*
    echo "βœ… Package uploaded to PyPI!"
fi

echo "πŸŽ‰ Done! Your package is now available online."