Skip to content

Conversation

swathipil
Copy link
Member

@swathipil swathipil commented Aug 20, 2025

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.

@swathipil swathipil requested a review from Copilot August 21, 2025 19:09
Copy link
Contributor

@Copilot Copilot AI left a 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):
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@scbedd scbedd left a 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 👍 :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants