diff --git a/build.sh b/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..b6f48a417d7b7caef5f9c0e8ae9f94e9e9e8080e --- /dev/null +++ b/build.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -euo pipefail + +# 导入通用函数 +git clone https://gitee.com/src-anolis-whl/build-common.git +. build-common/common.sh + +# =======构建前准备,可以安装一些构建依赖等========== +setup_py310 # for Python 3.10, default +#setup_py38 # for Python 3.8 +#setup_py312 # for Python 3.12 +## 其他系统依赖 +#yum install -y +# =================================================== + +prepare_source +apply_patches + +# 对于每个Python版本,构建相应的whl +for pybin in "${PYTHON_BINS[@]}"; do + get_build_env $pybin + + # 构建Python环境准备 + #$PIPBIN install -i https://pypi.openanolis.cn/prod/simple + + # ==========构建环境变量========== + export BUILD_WHEEL_FLAGS= + #export CUDA_C_FLAGS= + # ================================ + build_wheel $pybin + + # 测试Python环境准备 + $PIPBIN install pytest-cov "setuptools_rust==1.10.2" + # ==========测试环境变量========== + export PYTEST_FLAGS= + export SETUPPYTEST_FLAGS= + # ================================ + pushd setuptools_rust*/ + export PATH="/opt/_internal/cpython-3.10.13/bin:$PATH" + pytest tests/ + popd + +done + +# 调用auditwheel将运行依赖捆绑至whl中 +# 使用 --exclude xxx.so 来跳过加入某些动态链接库 +bundle_libs + +# 构建产物收集 +output_whls diff --git a/buildspec.yaml b/buildspec.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9c4b8474e75963c1ff2d641433b1b0663a8f175 --- /dev/null +++ b/buildspec.yaml @@ -0,0 +1,7 @@ +wheel: + region: cn-hangzhou # Optional, default [cn-hangzhou]. One of [cn-hangzhou, cn-hongkong]. + device_type: cpu # Optional, default [cpu]. One of [cpu, gpu, cpu-large]. + script: # Required, at least have one of + generic: build.sh # [generic, x86_64, aarch64] key. + #x86_64: build-x86_64.sh + #aarch64: build-aarch64.sh diff --git a/setuptools_rust-1.10.2.tar.gz b/setuptools_rust-1.10.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2763abb1193aa9d865e8a95c99cf66118513a4c7 Binary files /dev/null and b/setuptools_rust-1.10.2.tar.gz differ diff --git a/source b/source new file mode 100644 index 0000000000000000000000000000000000000000..535dfb4b9346f49dbb96ccc244a5a01d25a19024 --- /dev/null +++ b/source @@ -0,0 +1 @@ +https://files.pythonhosted.org/packages/d3/6b/99a1588d826ceb108694ba00f78bc6afda10ed5d72d550ae8f256af1f7b4/setuptools_rust-1.10.2.tar.gz