-
Notifications
You must be signed in to change notification settings - Fork 3.1k
update parsed verifysdist and verifywhl to check metadata #42619
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
base: main
Are you sure you want to change the base?
update parsed verifysdist and verifywhl to check metadata #42619
Conversation
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.
Pull Request Overview
This PR updates the parsed verification tools (verifysdist
and verifywhl
) to check metadata compatibility between the current version and the most recent prior version of a package. The update ensures that required metadata fields from previous versions are not accidentally dropped during package builds.
- Adds comprehensive package metadata extraction with PEP 566/621 normalization
- Implements metadata compatibility validation by comparing current version metadata against prior published versions
- Extends both sdist and wheel verification to include metadata checks alongside existing directory structure validation
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tools/azure-sdk-tools/pypi_tools/pypi.py |
Adds function to retrieve version lists from PyPI for metadata comparison |
tools/azure-sdk-tools/ci_tools/parsing/parse_functions.py |
Implements comprehensive metadata extraction with PEP normalization and updates ParsedSetup class |
tools/azure-sdk-tools/ci_tools/parsing/__init__.py |
Exports new extract_package_metadata function |
eng/tox/verify_whl.py |
Enhances wheel verification to include metadata compatibility checks |
eng/tox/verify_sdist.py |
Enhances sdist verification to include metadata compatibility checks |
eng/tox/tox.ini |
Adds pkginfo dependency for metadata extraction |
@@ -45,7 +50,15 @@ def extract_whl(dist_dir, version): | |||
return extract_location | |||
|
|||
|
|||
def verify_whl_root_directory(dist_dir, expected_top_level_module, version): | |||
def verify_whl_root_directory(dist_dir, expected_top_level_module, parsed_pkg): |
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.
Please add type annotations
@@ -50,20 +50,177 @@ | |||
} | |||
|
|||
|
|||
def extract_package_metadata(package_path: str) -> Dict[str, Any]: | |||
"""Extract package metadata from a built package or source directory with comprehensive PEP 566/621 normalization.""" | |||
from pkginfo import get_metadata |
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.
👍
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.
I'll do another review pass when you feel this isn't draft anymore. Looking good no real notes 👍
Updating the verifysdist and verifywhl steps to verify that all metadata from previous version (last stable if it exists, otherwise last preview) still exists.
We are NOT checking that the values are the same, since the pyproject.toml codegen changes include a modified homepage url. Value checks can be added in the future when we're confident that the values should very rarely change.
In the rare case that metadata is intentionally removed, verifysdist and verifywhl checks can be skipped during runs OR set to False in the pyproject.toml [tool.azure-sdk-build] section and removed after the release.