Repository navigation
Switch to PEP517 build with Hatch - #1226
Conversation
d241584 to
4be08f3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tomasr8
left a comment
There was a problem hiding this comment.
👍 for hatch, I've been using it in all my projects and it works great!
186f7e2 to
164cc49
Compare
|
Okay, I think this is good to review now. Did a last-minute double-check and found that |
There was a problem hiding this comment.
🟡 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
tomasr8
left a comment
There was a problem hiding this comment.
I checked the sdist/wheel before and after and almost everything is identical (except for the expected differences) so LGTM :)


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. 🤔