This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vggonzal
authored and
vggonzal
committed
Sep 27, 2023
1 parent
ff8f46b
commit 17cbd57
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
BUNDLE_PLUGIN_INSTALLED=$(poetry self show plugins | (grep 'poetry-plugin-bundle' || true) | wc -l) | ||
if [ "$BUNDLE_PLUGIN_INSTALLED" -ne 1 ]; then | ||
echo "Poetry bundle plugin missing! - https://github.com/python-poetry/poetry-plugin-bundle" | ||
echo "Install the poetry bundle plugin with: poetry self add poetry-plugin-bundle" | ||
exit 1 | ||
fi | ||
|
||
PACKAGE_NAME=$(awk -F' = ' '{gsub(/"/,"");if($1=="name")print $2}' pyproject.toml) | ||
VERSION=$(poetry version -s) | ||
|
||
ROOT_PATH="$PWD" | ||
ZIP_PATH="$ROOT_PATH/dist/$PACKAGE_NAME-$VERSION-test.zip" | ||
|
||
poetry bundle venv build --clear --without=dev | ||
|
||
cd build/lib/python3.*/site-packages | ||
touch hydrocronapi/__init__.py | ||
rm -rf *.dist-info _virtualenv.* | ||
find . -type d -name __pycache__ -exec rm -rf {} \+ | ||
|
||
mkdir -p "$ROOT_PATH/dist/" | ||
rm -f "$ZIP_PATH" | ||
zip -vr9 "$ZIP_PATH" . |