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] enforce 'twine check' and 'check-wheel-contents' on Python distributions #5707

Merged
merged 4 commits into from
Feb 14, 2023

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 11, 2023

Contributes to #5061.

This PR proposes introducing two new linters that check the contents of Python package distributions (sdists and wheels) for common issues.

  • twine check: checks that distributions bundled README will render correctly on PyPI
  • check-wheel-contents: catches problems like accidentally bundling .pyc files into the distribution, or including multiple files with identical content

Notes for Reviewers

I think these checks are generically useful in the way that all linters are...putting shared agreements into CI to reduce the scope of things that maintainers and contributors need to remember to check.

But in addition, it contributes to #5061 because these checks will help detect problems accidentally, newly introduced by changes to how LightGBM builds wheels.

How I tested this

The first commit on this PR adds the checks but doesn't fix any of the issues they found.

And you can see in the logs that they ran successfully and failed builds 🎉

Checking /Users/runner/work/1/s/python-package/dist/lightgbm-3.3.5.99-py3-none-macosx.whl:
FAILED due to warnings
WARNING  `long_description_content_type` missing. defaulting to `text/x-rst`. 

@jameslamb jameslamb changed the title WIP: [ci] enforce 'twine check' and 'check-wheel-contents' on Python distributions WIP: [ci] [python-package] enforce 'twine check' and 'check-wheel-contents' on Python distributions Feb 11, 2023
@jameslamb jameslamb changed the title WIP: [ci] [python-package] enforce 'twine check' and 'check-wheel-contents' on Python distributions [ci] [python-package] enforce 'twine check' and 'check-wheel-contents' on Python distributions Feb 11, 2023
@jameslamb jameslamb marked this pull request as ready for review February 11, 2023 07:07
@jameslamb jameslamb merged commit 885ea3a into master Feb 14, 2023
@jameslamb jameslamb deleted the ci/check-wheels branch February 14, 2023 03:14
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants