Skip to content

Commit

Permalink
Added initial functionality to build wheels
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Saucedo <[email protected]>
  • Loading branch information
axsaucedo committed Jan 20, 2024
1 parent c1d5a39 commit b229f13
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ else
endif
endif

PYTHON_BIN := "python3"


####### Main Target Rules #######

Expand Down Expand Up @@ -147,10 +149,16 @@ vs_run_tests: vs_build_tests
./build/test/$(VS_BUILD_TYPE)/bin/kompute_tests.exe --gtest_filter=$(FILTER_TESTS)


#### PYTHONG ####
#### PYTHON ####

test_python:
python3 -m pytest -s --log-cli-level=DEBUG -v python/test/
$(PYTHON_BIN) -m pytest -s --log-cli-level=DEBUG -v python/test/

build_wheels:
docker run --rm -it \
-e PLAT=manylinux_2_28_x86_64 \
-v $(pwd):/io quay.io/pypa/manylinux_2_28_x86_64 \
/io/build_wheels.sh

####### Run CI Commands #######

Expand Down
38 changes: 38 additions & 0 deletions build_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -e -u -x

function repair_wheel {
wheel="$1"
if ! auditwheel show "$wheel"; then
echo "Skipping non-platform wheel $wheel"
else
auditwheel repair "$wheel" --plat "$PLAT" -w /io/dist/
fi
}

# System package required for library
yum install -y vulkan
yum install -y vulkan-devel

# Create folder
mkdir -p /io/dist_tmp/
mkdir -p /io/dist/


# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" wheel --verbose /io/ --no-deps -w /io/dist_tmp/
done

# Bundle external shared libraries into the wheels
for whl in /io/dist_tmp/*.whl; do
repair_wheel "$whl" && echo "Continuing"
done

# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install -r /io/python/test/requirements-dev.txt
"${PYBIN}/pip" install kp -f /io/dist
make -C /io/ test_python PYTHON_BIN="${PYBIN}/python"
done

0 comments on commit b229f13

Please sign in to comment.