-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] [python-package] check distributions with pydistcheck #5838
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a0f53fc
[ci] [python-package] check distributions with pydistcheck
jameslamb d4349bb
add limits on size and files
jameslamb b7cce12
ensure failures fail CI
jameslamb 93462df
skip on Python 3.7
jameslamb 8449ff4
more Python 3.7 fixes
jameslamb ce8e430
add exceptions for CUDA and QEMU builds
jameslamb a0c10fe
lowercase cuda
jameslamb a0f0556
fix conditions
jameslamb 497ed7c
fix conditions
jameslamb 8bb51b0
sh not bash-style syntax
jameslamb f0f382a
fix condition
jameslamb a26123b
Merge branch 'master' into ci/use-pydistcheck
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -17,4 +17,35 @@ if { test "${TASK}" = "bdist" || test "${METHOD}" = "wheel"; }; then | |
check-wheel-contents ${DIST_DIR}/*.whl || exit -1 | ||
fi | ||
|
||
PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") | ||
if [ $PY_MINOR_VER -gt 7 ]; then | ||
echo "pydistcheck..." | ||
pip install pydistcheck | ||
if [ $TASK == "CUDA" ] && [ $METHOD == "wheel" ]; then | ||
pydistcheck \ | ||
--inspect \ | ||
--ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ | ||
--max-allowed-size-uncompressed '60M' \ | ||
--max-allowed-files 800 \ | ||
${DIST_DIR}/* || exit -1 | ||
elif [ $ARCH == "aarch64" ]; then | ||
pydistcheck \ | ||
--inspect \ | ||
--ignore 'compiled-objects-have-debug-symbols' \ | ||
--max-allowed-size-compressed '5M' \ | ||
--max-allowed-size-uncompressed '15M' \ | ||
--max-allowed-files 800 \ | ||
${DIST_DIR}/* || exit -1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The aarch64 wheel we produces one error from
I'm not sure where those are coming from, but I'm proposing ignoring them for now. The aarch64 linux integrated OpenCL wheel has a very similar compressed size (2.3MB) to the arm64 linux wheels (1.6M). |
||
else | ||
pydistcheck \ | ||
--inspect \ | ||
--max-allowed-size-compressed '5M' \ | ||
--max-allowed-size-uncompressed '15M' \ | ||
--max-allowed-files 800 \ | ||
${DIST_DIR}/* || exit -1 | ||
fi | ||
else | ||
echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})" | ||
fi | ||
|
||
echo "done checking Python package distributions" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
if
branch accounts for the fact that the CUDA 11.x wheel currently has the following warnings frompydistcheck
:(build link)
I'm not sure why the CUDA build is so much larger than the non-CUDA one or where those debug symbols are coming from...maybe we are statically linking to CUDA libraries? Maybe those debug symbols are coming from the use off
-lineinfo
compiler flag?LightGBM/CMakeLists.txt
Line 218 in f74875e
Either way, I'm proposing not spending time investigating that right now, and instead just at least adding this check to detect if future changes in this project make the wheel significantly larger (which could be a problem in storage-sensitive environments like AWS Lambda).