Skip to content

Switch to PEP517 build with Hatch - #1226

Merged
akx merged 2 commits into
masterfrom
modern-build
Nov 9, 2026
Merged

akx merged 2 commits into
masterfrom
modern-build

Conversation

@akx

@akx akx commented Sep 8, 2025 •

Copy link
Copy Markdown
Member

Refs #850 (since builds will always be PEP517).

I'm not sure if the build hook should automatically run import_cldr, since it's not completely free in terms of compute and bandwidth, but at least the hook will complain if the package-to-be-built will be broken. 🤔

@akx
akx force-pushed the modern-build branch 2 times, most recently from d241584 to 4be08f3 Compare September 8, 2025 17:21
@codecov

codecov Bot commented Sep 8, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.67%. Comparing base (dc80d4c) to head (1aaea5a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1226      +/-   ##
==========================================
+ Coverage   93.64%   93.67%   +0.03%     
==========================================
  Files          27       27              
  Lines        4986     4983       -3     
==========================================
- Hits         4669     4668       -1     
+ Misses        317      315       -2     
Flag Coverage Δ
macos-15-3.10 ?
macos-15-3.11 92.69% <100.00%> (+0.03%) ⬆️
macos-15-3.12 92.95% <100.00%> (?)
macos-15-3.13 ?
macos-15-3.14 92.93% <100.00%> (+0.03%) ⬆️
macos-15-3.15 92.93% <100.00%> (+0.03%) ⬆️
macos-15-3.9 92.69% <100.00%> (+0.03%) ⬆️
macos-15-pypy3.10 ?
ubuntu-24.04-3.10 92.77% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.11 92.71% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.12 92.97% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.13 92.97% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.14 92.95% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.15 92.95% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-3.9 92.71% <100.00%> (+0.03%) ⬆️
ubuntu-24.04-pypy3.10 92.77% <100.00%> (+0.03%) ⬆️
windows-2022-3.10 92.76% <100.00%> (+0.03%) ⬆️
windows-2022-3.11 92.70% <100.00%> (+0.03%) ⬆️
windows-2022-3.12 92.96% <100.00%> (+0.03%) ⬆️
windows-2022-3.13 92.96% <100.00%> (+0.03%) ⬆️
windows-2022-3.14 92.94% <100.00%> (+0.03%) ⬆️
windows-2022-3.15 92.94% <100.00%> (+0.03%) ⬆️
windows-2022-3.9 92.70% <100.00%> (+0.03%) ⬆️
windows-2022-pypy3.10 92.76% <100.00%> (+0.03%) ⬆️

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.

@akx akx added this to the Babel 2.19 milestone Sep 8, 2025
@codspeed

codspeed Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 88 untouched benchmarks


Comparing modern-build (1aaea5a) with master (dc80d4c)

Open in CodSpeed

@tomasr8 tomasr8 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.

👍 for hatch, I've been using it in all my projects and it works great!

Comment thread pyproject.toml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
@akx
akx force-pushed the modern-build branch 4 times, most recently from 186f7e2 to 164cc49 Compare November 6, 2026 12:04
@akx
akx marked this pull request as ready for review November 6, 2026 12:10
@akx
akx requested a review from tomasr8 November 6, 2026 12:25
@akx

akx commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Okay, I think this is good to review now.

Did a last-minute double-check and found that global.dat was missing from the packages, which would have been unpleasant.

@akx
akx requested a balanced review from Copilot November 6, 2026 12:26

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.

🟡 Changes recommended

The replacement directs users to README.rst, which lacks CLDR import instructions, removing the actionable recovery guidance.

1 open issue
What changed in this PR

This PR migrates Babel from setuptools to Hatch-based PEP 517 builds and adds artifact checks to catch missing CLDR data, addressing the packaging problem described in #850.

Changes:

  • Move package metadata, entry points, and distribution configuration into pyproject.toml.
  • Validate CLDR data in built distributions while allowing editable installs before data generation.
  • Update development instructions, CI configuration, and compatibility code for Python 3.9+.
File Description
tox.ini Use editable packaging before CLDR import.
tests/​test_support_translations.py Remove obsolete deprecated-gettext tests and filtering branches.
tests/​conftest.py Import standard-library zoneinfo directly.
setup.py Remove legacy setuptools configuration and import command.
setup.cfg Remove migrated license configuration.
pyproject.toml Configure Hatch builds, metadata, dependencies, and entry points.
MANIFEST.in Remove the superseded distribution manifest.
hatch_build.py Check built archives for CLDR data files.
docs/​installation.rst Replace legacy import commands with make import-cldr.
conftest.py Remove the deleted setup script from collection exclusions.
babel/​localtime/​_win32.py Use the built-in generic dict type.
babel/​localtime/​_helpers.py Remove the optional zoneinfo import fallback.
babel/​core.py Revise missing-data recovery guidance.
.github/​workflows/​ci.yml Key dependency caches on pyproject.toml.

Review effort: Balanced

Comment thread babel/core.py Resolved

@tomasr8 tomasr8 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.

I checked the sdist/wheel before and after and almost everything is identical (except for the expected differences) so LGTM :)

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.

🟡 Changes recommended

The recovery message names a nonexistent Makefile target, and the artifact pattern omits the Unicode license notice from both distributions.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread babel/core.py Resolved
Comment thread pyproject.toml Resolved

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.

🟢 Approval recommended

No active review issues are identified for the Hatchling build migration and CLDR artifact validation changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@akx
akx merged commit cb0c7a7 into master Nov 9, 2026
36 of 39 checks passed
@akx
akx deleted the modern-build branch November 9, 2026 14:38
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