|
15 | 15 | # limitations under the License.
|
16 | 16 | set -e -x
|
17 | 17 |
|
18 |
| -## 1. install python env |
19 |
| -dev/lint-python.sh -s py_env |
20 |
| - |
21 |
| -PY_ENV_DIR=`pwd`/dev/.uv/envs |
22 |
| -py_env=("3.9" "3.10" "3.11" "3.12") |
23 |
| -## 2. install dependency |
24 |
| -for ((i=0;i<${#py_env[@]};i++)) do |
25 |
| - source `pwd`/dev/.uv/envs/${py_env[i]}/bin/activate |
26 |
| - echo "Installing dependencies for environment: ${py_env[i]}" |
27 |
| - uv pip install --group dev |
28 |
| - deactivate |
29 |
| -done |
| 18 | +## 1. Setup virtual environment with uv |
| 19 | +dev/lint-python.sh -s basic |
| 20 | + |
| 21 | +python_versions=("3.9" "3.10" "3.11" "3.12") |
| 22 | + |
| 23 | +if [[ "$(uname)" != "Darwin" ]]; then |
| 24 | + # force the linker to use the older glibc version in Linux |
| 25 | + export CFLAGS="-I. -include dev/glibc_version_fix.h" |
| 26 | +fi |
| 27 | + |
| 28 | +source "$(pwd)"/dev/.uv/bin/activate |
30 | 29 |
|
31 |
| -## 3. build wheels |
32 |
| -for ((i=0;i<${#py_env[@]};i++)) do |
33 |
| - echo "Building wheel for environment: ${py_env[i]}" |
34 |
| - if [[ "$(uname)" != "Darwin" ]]; then |
35 |
| - # force the linker to use the older glibc version in Linux |
36 |
| - export CFLAGS="-I. -include dev/glibc_version_fix.h" |
37 |
| - fi |
38 |
| - ${PY_ENV_DIR}/${py_env[i]}/bin/python setup.py bdist_wheel |
| 30 | +## 2. Build wheels for each Python version |
| 31 | +for ((i=0;i<${#python_versions[@]};i++)) do |
| 32 | + echo "Building wheel for Python: ${python_versions[i]}" |
| 33 | + uv build --wheel --python "${python_versions[i]}" |
39 | 34 | done
|
40 | 35 |
|
41 |
| -## 4. convert linux_x86_64 wheel to manylinux1 wheel in Linux |
| 36 | +## 3. Convert linux_x86_64 wheel to manylinux1 wheel in Linux |
42 | 37 | if [[ "$(uname)" != "Darwin" ]]; then
|
43 | 38 | echo "Converting linux_x86_64 wheel to manylinux1"
|
44 |
| - source `pwd`/dev/.uv/bin/activate |
45 |
| - # 4.1 install patchelf and auditwheel |
46 |
| - uv pip install patchelf==0.17.2.1 auditwheel==3.2.0 |
47 |
| - # 4.2 convert Linux wheel |
48 | 39 | for wheel_file in dist/*.whl; do
|
49 |
| - auditwheel repair ${wheel_file} -w dist |
50 |
| - rm -f ${wheel_file} |
| 40 | + uv run --group auditwheel auditwheel repair "${wheel_file}" -w dist |
| 41 | + rm -f "${wheel_file}" |
51 | 42 | done
|
52 |
| - deactivate |
53 | 43 | fi
|
54 |
| -## see the result |
| 44 | + |
| 45 | +deactivate |
| 46 | + |
| 47 | +## 4. Output the result |
| 48 | +echo "Build finished - created the following wheels:" |
55 | 49 | ls -al dist/
|
0 commit comments