-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `prebuilt_wheel` hook complements the `post_build` hook. While the post build hook runs after a wheel has been built, the prebuilt wheel hook runs after a wheel has been downloaded. The new hook makes it possible to upload prebuilt wheels to an internal Python index. Fixes: #535 Signed-off-by: Christian Heimes <[email protected]>
- Loading branch information
Showing
12 changed files
with
151 additions
and
3 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
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
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
File renamed without changes.
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
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
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,3 @@ | ||
variants: | ||
cpu: | ||
pre_built: True |
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
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
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,65 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Test build-sequence prebuilt-wheel hook | ||
|
||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source "$SCRIPTDIR/common.sh" | ||
|
||
# What are we building? | ||
DIST="setuptools" | ||
VERSION="75.8.0" | ||
|
||
# Install hook for test | ||
pip install e2e/fromager_hooks | ||
|
||
# Bootstrap the test project | ||
fromager \ | ||
--sdists-repo="$OUTDIR/sdists-repo" \ | ||
--wheels-repo="$OUTDIR/wheels-repo" \ | ||
--work-dir="$OUTDIR/work-dir" \ | ||
--settings-dir="$SCRIPTDIR/prebuilt_settings" \ | ||
bootstrap "${DIST}==${VERSION}" | ||
|
||
# Save the build order file but remove everything else. | ||
cp "$OUTDIR/work-dir/build-order.json" "$OUTDIR/" | ||
|
||
# Remove downloaded wheels to trigger hook | ||
rm -rf "$OUTDIR/wheels-repo" | ||
|
||
log="$OUTDIR/build-logs/${DIST}-build.log" | ||
fromager \ | ||
--log-file "$log" \ | ||
--work-dir "$OUTDIR/work-dir" \ | ||
--sdists-repo "$OUTDIR/sdists-repo" \ | ||
--wheels-repo "$OUTDIR/wheels-repo" \ | ||
--settings-dir="$SCRIPTDIR/prebuilt_settings" \ | ||
build-sequence "$OUTDIR/build-order.json" | ||
|
||
if ! grep -q "downloading prebuilt wheel ${DIST}==${VERSION}" "$log"; then | ||
echo "Lack of message indicating download of prebuilt wheel" 1>&2 | ||
pass=false | ||
fi | ||
|
||
|
||
EXPECTED_FILES=" | ||
wheels-repo/simple/${DIST}/${DIST}-${VERSION}-py3-none-any.whl | ||
work-dir/test-prebuilt.txt | ||
" | ||
|
||
pass=true | ||
for f in $EXPECTED_FILES; do | ||
if [ ! -f "$OUTDIR/$f" ]; then | ||
echo "FAIL: Did not find $OUTDIR/$f" 1>&2 | ||
pass=false | ||
fi | ||
done | ||
|
||
if $pass; then | ||
if ! grep -q "${DIST}==${VERSION}" $OUTDIR/work-dir/test-prebuilt.txt; then | ||
echo "FAIL: Did not find content in post-build hook output file" 1>&2 | ||
pass=false | ||
fi | ||
fi | ||
|
||
$pass |
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
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