Skip to content
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 12 commits into from
May 4, 2023
9 changes: 9 additions & 0 deletions .ci/check_python_dists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ echo "checking Python package distributions in '${DIST_DIR}'"
pip install \
-qq \
check-wheel-contents \
pydistcheck \
twine || exit -1

echo "twine check..."
Expand All @@ -17,4 +18,12 @@ if { test "${TASK}" = "bdist" || test "${METHOD}" = "wheel"; }; then
check-wheel-contents ${DIST_DIR}/*.whl || exit -1
fi

echo "pydistcheck..."
pydistcheck \
--inspect \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This argument --inspect prints a summary like the following:

----- package inspection summary -----
file size
  * compressed size: 1.3M
  * uncompressed size: 4.3M
  * compression space saving: 69.5%
contents
  * directories: 0
  * files: 16 (1 compiled)
size by extension
  * .so - 3963.7K (90.5%)
  * .py - 396.7K (9.1%)
  * no-extension - 17.6K (0.4%)
  * .txt - 0.0K (0.0%)
  * .typed - 0.0K (0.0%)
------------ check results -----------
errors found while checking: 0

(macOS bdist build link)

Which I think would have been useful in situations like this: #5252 (review)

--max-allowed-size-compressed '5M' \
--max-allowed-size-uncompressed '15M' \
--max-allowed-files 800 \
${DIST_DIR}/* || exit -1

echo "done checking Python package distributions"