-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This PR checks the wheel content and asserts that: - all of `libtorchcodec[4567].so` are present in the wheel - libtorchcodec.so is not in the wheel - none of libavfilter.so, libavcodec.so etc. are present in the wheel - none of the doc, test or benchmarks folders are present in the wheel This adds more reassurance that we won't be publishing broken wheel and thus preserve the user's experience. Pull Request resolved: #33 Reviewed By: ahmadsharif1 Differential Revision: D58646828 Pulled By: NicolasHug fbshipit-source-id: 05df551cf455cc519d27619726bae169a52028cc
- Loading branch information
1 parent
e1e0352
commit 736a57c
Showing
2 changed files
with
44 additions
and
5 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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
_list_wheel_files() { | ||
unzip -l "$1" | awk '{print $4}' | ||
} | ||
|
||
# $1 = path to wheel | ||
# $2 = pattern to grep for in wheel files | ||
# If files matching $2 are found in the wheel, the function errors. | ||
assert_not_in_wheel() { | ||
wheel_files=$(_list_wheel_files "$1") | ||
if grep -q "$2" <<< "$wheel_files" | ||
then | ||
echo "Found files in $1 that start with $2. Exiting!!" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# See assert_not_in_wheel | ||
assert_in_wheel() { | ||
wheel_files=$(_list_wheel_files "$1") | ||
if ! grep -q "$2" <<< "$wheel_files" | ||
then | ||
echo "Did not find files in $1 that start with $2. Exiting!!" | ||
exit 1 | ||
fi | ||
} |
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