-
Notifications
You must be signed in to change notification settings - Fork 460
Add babel.core.get_cldr_version()
#1242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
WDYT @bartfeenstra? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1242 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 27 27
Lines 4680 4682 +2
=======================================
+ Hits 4308 4310 +2
Misses 372 372
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new public API function babel.core.get_cldr_version() that returns the Unicode CLDR version used by the Babel installation. The implementation extracts the version from the CLDR DTD file during the import process and makes it accessible at runtime.
Key changes:
- Adds
get_cldr_version()function to return CLDR version as a string - Extracts CLDR version from
ldml.dtdfile during CLDR data import - Updates type definitions to include
cldr_versionas a valid global key
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
babel/core.py |
Adds the get_cldr_version() function and updates the _GLOBAL_KEY type alias to include "cldr_version" |
scripts/import_cldr.py |
Extracts CLDR version from DTD file using regex and stores it in global data |
docs/api/core.rst |
Adds documentation reference for the new function |
tests/test_core.py |
Adds test to verify the function returns the expected CLDR version "47" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2b0260b to
cb4fcf2
Compare
cb4fcf2 to
8809d57
Compare
There was a problem hiding this comment.
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 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def get_cldr_version() -> str: | ||
| """Return the Unicode CLDR version used by this Babel installation. | ||
| Generally, you should be able to assume that the return value of this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What other values can it have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm pre-planning for a downstream distro to do something weird here like "27+deb1". 😀
Fixes #1237
Closes #1238 (supersedes it)