Skip to content

Conversation

@kdestin
Copy link
Member

@kdestin kdestin commented Jan 9, 2026

Description

When running tox run -e latestdependency, tox does an e2e check to validate that
the actually installed packages match the computed upper range version.

Some packages, like ruamel.yaml, may appear under different names across the set of expected and
installed package sets (e.g. ruamel-yaml and ruamel.yaml) despite both names referring to the same package per PEP 503.

image

The verify package step partially applies the PEP 503 algorithm (just case normalization and substituting _ for -), which
misses cases like ruamel.yaml where the correct substitution would be . -> -.

This pull request resolves the above issue by applying the name normalization algorithm as described in PEP 503
https://peps.python.org/pep-0503/#normalized-names

Supersedes #44587

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings January 9, 2026 17:02
Copy link
Contributor

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 pull request fixes package verification in the latestdependency tox environment by properly implementing PEP 503 name normalization. The previous implementation only performed partial normalization (case normalization and _ to - substitution), missing cases like ruamel.yaml where . should also be normalized to -.

Key Changes

  • Adds a normalize_package_name() function that correctly implements PEP 503 name normalization using the regex r"[-_.]+"
  • Applies normalization consistently to both installed and expected package names during verification

    This resolves issues where packages, like ruamel.yaml, may
    appear under different names across the set of expected and
    installed package sets (e.g. `ruamel-yaml` and `ruamel.yaml`) despite
    both names referring to the same package per PEP 503.
@kdestin kdestin force-pushed the engsys/tests/fix-package-name-normalization-in-latest-packages branch from 0141139 to 944e6a0 Compare January 9, 2026 17:20
@kdestin kdestin enabled auto-merge (squash) January 9, 2026 17:31
@weshaggard weshaggard disabled auto-merge January 9, 2026 18:11
@weshaggard weshaggard merged commit 62e8876 into Azure:main Jan 9, 2026
15 checks passed
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.

3 participants