local_distribution_tox.sh 783 Bytes
Newer Older
1
2
3
4
5
#!/bin/bash

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

6
multi_python_version=("3.8" "3.9" "3.10" "3.11" "3.12")
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
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,py39,py310,py311,py312

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