Skip to content

CLDR 48.2 - #1302

Merged
akx merged 3 commits into
masterfrom
cldr-48.2
Jul 30, 2026
Merged

CLDR 48.2#1302
akx merged 3 commits into
masterfrom
cldr-48.2

Conversation

@akx

@akx akx commented Jul 30, 2026

Copy link
Copy Markdown
Member

I had apparently implemented this in the spring but forgor about it? Well.

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.19%. Comparing base (dddfc94) to head (f42ed4e).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1302   +/-   ##
=======================================
  Coverage   92.18%   92.19%           
=======================================
  Files          27       27           
  Lines        4758     4764    +6     
=======================================
+ Hits         4386     4392    +6     
  Misses        372      372           
Flag Coverage Δ
macos-14-3.10 91.24% <100.00%> (+0.01%) ⬆️
macos-14-3.11 91.18% <100.00%> (+0.01%) ⬆️
macos-14-3.12 91.39% <100.00%> (+0.01%) ⬆️
macos-14-3.13 91.39% <100.00%> (+0.01%) ⬆️
macos-14-3.14 91.37% <100.00%> (+0.01%) ⬆️
macos-14-3.15 91.37% <100.00%> (+0.01%) ⬆️
macos-14-3.8 91.11% <100.00%> (+0.01%) ⬆️
macos-14-3.9 91.17% <100.00%> (+0.01%) ⬆️
macos-14-pypy3.10 91.24% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.10 91.26% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.11 91.20% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.12 91.41% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.13 91.41% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.14 91.39% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.15 91.39% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.8 91.13% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.9 91.19% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-pypy3.10 91.26% <100.00%> (+0.01%) ⬆️
windows-2022-3.10 91.25% <100.00%> (+0.01%) ⬆️
windows-2022-3.11 91.19% <100.00%> (+0.01%) ⬆️
windows-2022-3.12 91.40% <100.00%> (+0.01%) ⬆️
windows-2022-3.13 91.40% <100.00%> (+0.01%) ⬆️
windows-2022-3.14 91.38% <100.00%> (+0.01%) ⬆️
windows-2022-3.15 91.38% <100.00%> (+0.01%) ⬆️
windows-2022-3.8 91.23% <100.00%> (+0.01%) ⬆️
windows-2022-3.9 91.19% <100.00%> (+0.01%) ⬆️
windows-2022-pypy3.10 91.25% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 12.57%

❌ 4 regressed benchmarks
✅ 84 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_get_unit_name[cached] 261.8 µs 304.8 µs -14.11%
test_format_compound_unit_predefined[cached] 893.3 µs 1,028.4 µs -13.14%
test_format_compound_unit_predefined[fresh] 971 µs 1,107.5 µs -12.32%
test_get_unit_name[fresh] 347.3 µs 388.9 µs -10.68%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cldr-48.2 (f42ed4e) with master (dddfc94)

Open in CodSpeed

@akx
akx force-pushed the cldr-48.2 branch 3 times, most recently from 01cc785 to a007691 Compare July 30, 2026 10:51
@akx

akx commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Good catch by codspeed: we don't need to slow down all unit operations, just those that would fail due to deprecated aliases.

We'll just have to accept some degradation here.

@akx
akx force-pushed the cldr-48.2 branch 2 times, most recently from f6b02a7 to 9d7c063 Compare July 30, 2026 12:33
@akx
akx requested a review from Copilot July 30, 2026 12:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates Babel’s bundled CLDR baseline to 48.2, aligning formatting behavior and tests with upstream CLDR changes and adding compatibility handling for newly-deprecated unit identifiers.

Changes:

  • Bump reported CLDR version to 48 and update CLDR download/import scripts to target CLDR 48.2.
  • Adjust tests for CLDR-driven output changes (currency/compact currency bidi marks, list formatting, Thai skeleton output, timezone name, currency counts).
  • Add deprecated unit-id remapping with DeprecationWarning emission for CLDR 48 unit identifier deprecations.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_units.py Updates a unit ID expectation and adds a new test asserting deprecation warnings for deprecated unit identifiers.
tests/test_support_format.py Updates expected bidi-mark placement for Arabic (Egypt) compact currency formatting.
tests/test_numbers.py Updates expected currency list size and CLDR-driven formatting outputs (currency + compact currency).
tests/test_lists.py Updates Nepali list formatting expectations (spacing/punctuation).
tests/test_dates.py Updates Thai skeleton formatting expectations and a timezone display name expectation.
tests/test_core.py Updates the asserted CLDR major version returned by get_cldr_version().
scripts/import_cldr.py Removes “up-to-date” short-circuiting and makes conversion always run; keeps legacy --force flag semantics.
scripts/download_import_cldr.py Points the downloader at CLDR 48.2 and updates the expected SHA-512 checksum.
babel/units.py Introduces deprecated unit-id remapping + deprecation warnings before falling back to fuzzy matching.
babel/numbers.py Updates format_currency doctest output to reflect CLDR 48 behavior for COP rounding/formatting.
babel/core.py Updates get_cldr_version() doctest from 47 to 48.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_units.py
Comment thread babel/units.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

babel/units.py:90

  • The deprecated-unit mapping is only applied for exact key matches (new_id in unit_patterns). If new_id is not an exact key (e.g. when mapping from an unqualified ID like "portion" -> "part"), the code falls through to fuzzy matching using the deprecated unit_id, so the mapping may not take effect and can still raise UnknownUnitError.

After warning, update unit_id to new_id so that the subsequent fuzzy matching resolves the replacement ID instead of the deprecated one.

    new_id = _DEPRECATED_UNIT_IDS.get(unit_id)
    if new_id is not None:
        warnings.warn(
            f"Unit identifier {unit_id!r} is deprecated; use {new_id!r} instead.",
            DeprecationWarning,

@akx
akx merged commit 95d2f60 into master Jul 30, 2026
40 of 41 checks passed
@akx akx added this to the Babel 2.19 milestone Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants