Skip to content

Conversation

@alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Nov 7, 2025

Description

Normalize package identifiers according to https://peps.python.org/pep-0503/#normalized-names when getting a package version.

Fixes the huggingface-hub test suite, which fails because the identifier returned by importlib.metadata changed. To confirm

pip install "huggingface-hub==1.0.1"

and then run

>>> from importlib import metadata
>>> [dist.metadata.get("Name", None) for dist in metadata.distributions()]

in the interpreter, you should have a huggingface-hub in the list. If you instead install "huggingface-hub==1.1.2" and follow the steps above, you instead see huggingface_hub.

Issues

Reminders

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.96%. Comparing base (43c16c4) to head (6b76b44).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5083   +/-   ##
=======================================
  Coverage   83.95%   83.96%           
=======================================
  Files         179      179           
  Lines       17948    17951    +3     
  Branches     3193     3194    +1     
=======================================
+ Hits        15069    15073    +4     
  Misses       1906     1906           
+ Partials      973      972    -1     
Files with missing lines Coverage Δ
sentry_sdk/utils.py 86.30% <100.00%> (+0.04%) ⬆️

... and 2 files with indirect coverage changes

@alexander-alderman-webb alexander-alderman-webb changed the title [do not merge]: generate tox tests(huggingface): Avoid None version Nov 7, 2025
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review November 10, 2025 07:19
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner November 10, 2025 07:19
@alexander-alderman-webb alexander-alderman-webb marked this pull request as draft November 10, 2025 07:34
Comment on lines +1763 to +1766
def _replace_hyphens_dots_and_underscores_with_dashes(name):
# type: (str) -> str
# https://peps.python.org/pep-0503/#normalized-names
return re.sub(r"[-_.]+", "-", name)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I changed _normalize_module_name, but I'm worried that could change the identifiers in the list set by the ModulesIntegration.

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review November 11, 2025 07:57
@alexander-alderman-webb alexander-alderman-webb merged commit 720440e into master Nov 11, 2025
130 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the webb/run-ci branch November 11, 2025 08:33
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