forked from python-poetry/poetry
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from replit/th-bundle-script
Added build-bundle.sh script
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -40,4 +40,6 @@ pip-wheel-metadata | |
|
||
poetry/core/* | ||
|
||
.pythonlibs | ||
.pythonlibs | ||
|
||
poetry-*-bundle.tgz |
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,22 @@ | ||
# Generate a bundle containing poetry + dependencies | ||
# for use by Nix using pip's download command to allow offline installs as | ||
# described here: https://stackoverflow.com/a/36730026 | ||
|
||
# The generated file is to be uploaded to the poetry-bundles bucket on gcs, available at | ||
# https://storage.googleapis.com/poetry-bundles/poetry-x.y.z-bundle.tgz | ||
|
||
# You may use `nix develop` to gain access the tools used by this script. | ||
|
||
set -x | ||
|
||
BUILD_DIR=poetry-bundle | ||
|
||
rm -fr $BUILD_DIR | ||
mkdir -p $BUILD_DIR | ||
VERSION=$(toml2json pyproject.toml | jq '.tool.poetry.version' --raw-output) | ||
POETRY_TAR_FILE="poetry-${VERSION}.tgz" | ||
tar cz --sort=name --mtime='@1' --exclude="$BUILD_DIR" --exclude="$POETRY_TAR_FILE" --owner=0 --group=0 --numeric-owner -P -f "$POETRY_TAR_FILE" . | ||
pip download "$POETRY_TAR_FILE" -d $BUILD_DIR | ||
tar czf poetry-${VERSION}-bundle.tgz $BUILD_DIR | ||
rm "$POETRY_TAR_FILE" | ||
rm -fr "$BUILD_DIR" |
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,6 @@ | ||
{ pkgs }: { | ||
deps = [ | ||
pkgs.toml2json | ||
pkgs.jq.bin | ||
]; | ||
} |