Skip to content

Resolve deprecated short unit identifiers through their replacements - #1408

Merged
akx merged 2 commits into
python-babel:masterfrom
jdotc1:fix/deprecated-short-unit-aliases-20261027
Oct 30, 2026
Merged

akx merged 2 commits into
python-babel:masterfrom
jdotc1:fix/deprecated-short-unit-aliases-20261027

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

The deprecated short unit identifiers permillion, portion, and portion-per-1e9 emit a deprecation warning but then fail lookup. The exact-name lookup uses the replacement ID, while the suffix lookup still uses the deprecated name.

Continue suffix matching with the replacement ID. Tests cover all six deprecated IDs through both format_unit and get_unit_name, check that each lookup emits exactly one warning, and compare results with the replacement IDs.

Validation: 30 unit tests passed; 40 tests passed when including the unit-module doctests. Ruff lint/format and git diff --check pass. The three short-alias cases fail against the original source.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.56%. Comparing base (0d2b263) to head (12392bb).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1408      +/-   ##
==========================================
+ Coverage   93.55%   93.56%   +0.01%     
==========================================
  Files          27       27              
  Lines        4931     4940       +9     
==========================================
+ Hits         4613     4622       +9     
  Misses        318      318              
Flag Coverage Δ
macos-14-3.10 92.65% <100.00%> (+0.01%) ⬆️
macos-14-3.11 92.59% <100.00%> (+0.01%) ⬆️
macos-14-3.12 92.79% <100.00%> (+0.01%) ⬆️
macos-14-3.13 92.79% <100.00%> (+0.01%) ⬆️
macos-14-3.14 92.77% <100.00%> (+0.01%) ⬆️
macos-14-3.15 92.77% <100.00%> (+0.01%) ⬆️
macos-14-3.8 92.52% <100.00%> (+0.01%) ⬆️
macos-14-3.9 92.58% <100.00%> (+0.01%) ⬆️
macos-14-pypy3.10 92.65% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.10 92.67% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.11 92.61% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.12 92.81% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.13 92.81% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.14 92.79% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.15 92.79% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.8 92.54% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-3.9 92.60% <100.00%> (+0.01%) ⬆️
ubuntu-24.04-pypy3.10 92.67% <100.00%> (+0.01%) ⬆️
windows-2022-3.10 92.66% <100.00%> (+0.01%) ⬆️
windows-2022-3.11 92.60% <100.00%> (+0.01%) ⬆️
windows-2022-3.12 92.80% <100.00%> (+0.01%) ⬆️
windows-2022-3.13 92.80% <100.00%> (+0.01%) ⬆️
windows-2022-3.14 92.78% <100.00%> (+0.01%) ⬆️
windows-2022-3.15 92.78% <100.00%> (+0.01%) ⬆️
windows-2022-3.8 92.63% <100.00%> (+0.01%) ⬆️
windows-2022-3.9 92.59% <100.00%> (+0.01%) ⬆️
windows-2022-pypy3.10 92.66% <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

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 88 untouched benchmarks


Comparing jdotc1:fix/deprecated-short-unit-aliases-20261027 (12392bb) with master (419a228)

Open in CodSpeed

@akx
akx force-pushed the fix/deprecated-short-unit-aliases-20261027 branch from 00ae4f1 to 12392bb Compare October 30, 2026 11:18

@akx akx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thank you. I simplified the test a bit.

@akx
akx enabled auto-merge (squash) October 30, 2026 11:19
@akx
akx merged commit ecf1da8 into python-babel:master Oct 30, 2026
36 checks passed
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