pypi_distribution_tox.sh 721 Bytes
Newer Older
1
multi_python_version=("3.8" "3.9" "3.10" "3.11" "3.12")
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
for python_version in "${multi_python_version[@]}"; do
    echo "Installing Python ${python_version}..."
    apt-get install -y python${python_version}
done

pip install -r requirements-build.txt

# if dist and build directories exist, remove them
if [ -d dist ]; then
    rm -r dist
fi

# Build source distribution (disabled for now)
# python setup.py sdist --formats=gztar,zip

# Build wheels for different Python versions
echo "Building wheels for multiple Python versions..."
tox -e py38-pypi,py39-pypi,py310-pypi,py311-pypi,py312-pypi

if [ $? -ne 0 ]; then
    echo "Error: Failed to build the wheels."
    exit 1
else
    echo "Wheels built successfully."
fi