Skip to content

Commit

Permalink
fix: better package structure for python lib
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Sutula <[email protected]>
  • Loading branch information
asutula committed Jul 16, 2020
1 parent 99cd7bb commit 780d6c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/gen-py-protos.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
LIB_VERSION=$1
PROTOS_PATH=$2
OUT_PATH=$3
SRC_PATH=$OUT_PATH/pow

if [ -d "$OUT_PATH" ]
then
rm -rf $OUT_PATH
fi

mkdir -p $OUT_PATH
mkdir -p $SRC_PATH

cat << EOF > $OUT_PATH/setup.py
import setuptools
Expand All @@ -25,9 +26,9 @@ setuptools.setup(
)
EOF

./scripts/protoc_gen_plugin.bash --proto_path=$PROTOS_PATH --plugin_name=python --plugin_out=$OUT_PATH
./scripts/protoc_gen_plugin.bash --proto_path=$PROTOS_PATH --plugin_name=python --plugin_out=$SRC_PATH

find $OUT_PATH -type d -exec touch {}/__init__.py \;
find $SRC_PATH -type d -exec touch {}/__init__.py \;

python3 -m pip install --user --upgrade setuptools wheel
cd $OUT_PATH && python3 setup.py sdist bdist_wheel
Expand Down

0 comments on commit 780d6c5

Please sign in to comment.