forked from OpenMined/PyDP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_PyDP.sh
executable file
·22 lines (17 loc) · 716 Bytes
/
build_PyDP.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
## Set variables
PLATFORM=$(python scripts/get_platform.py)
# Search specific python bin and lib folders to compile against the poetry env
PYTHONHOME=$(which python)
PYTHONPATH=$(python -c 'import sys; print([x for x in sys.path if "site-packages" in x][0]);')
# Give user feedback
echo -e "Running bazel with:\n\tPLATFORM=$PLATFORM\n\tPYTHONHOME=$PYTHONHOME\n\tPYTHONPATH=$PYTHONPATH"
# Compile code
bazel coverage src/python:pydp \
--config $PLATFORM \
--verbose_failures \
--action_env=PYTHON_BIN_PATH=$PYTHONHOME \
--action_env=PYTHON_LIB_PATH=$PYTHONPATH
# Delete the previously compiled package and copy the new one
rm -f ./src/pydp/_pydp.so
cp -f ./bazel-bin/src/bindings/_pydp.so ./src/pydp