python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.34k stars 448 forks source link

Allow use of importlib.metadata for finding entrypoints #1102

Closed akx closed 4 months ago

akx commented 4 months ago

Closes #1093 (supersedes it, based on it). Refs #861.

This PR makes Babel attempt to use importlib.metadata instead of pkg_resources where available.

It also adds a test that proves the Jinja2 extractor also works on Python 3.12; this is ran in CI as well.

akx commented 4 months ago

cc @tomasr8 @podgorniy94

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.21%. Comparing base (42d793c) to head (7a029e0).

Files Patch % Lines
babel/messages/_compat.py 78.94% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1102 +/- ## ========================================== - Coverage 91.29% 91.21% -0.08% ========================================== Files 26 27 +1 Lines 4479 4496 +17 ========================================== + Hits 4089 4101 +12 - Misses 390 395 +5 ``` | [Flag](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | Coverage Δ | | |---|---|---| | [macos-12-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.99% <75.00%> (-0.06%)` | :arrow_down: | | [macos-12-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.99% <75.00%> (-0.06%)` | :arrow_down: | | [macos-12-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.16% <75.00%> (-0.17%)` | :arrow_down: | | [macos-12-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.91% <65.62%> (-0.12%)` | :arrow_down: | | [macos-12-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.91% <65.62%> (-0.12%)` | :arrow_down: | | [macos-12-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.99% <75.00%> (-0.06%)` | :arrow_down: | | [ubuntu-22.04-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.01% <75.00%> (-0.06%)` | :arrow_down: | | [ubuntu-22.04-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.01% <75.00%> (-0.06%)` | :arrow_down: | | [ubuntu-22.04-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.19% <75.00%> (-0.17%)` | :arrow_down: | | [ubuntu-22.04-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.93% <65.62%> (-0.12%)` | :arrow_down: | | [ubuntu-22.04-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.93% <65.62%> (-0.12%)` | :arrow_down: | | [ubuntu-22.04-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.01% <75.00%> (-0.06%)` | :arrow_down: | | [windows-2022-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.13% <75.00%> (-0.06%)` | :arrow_down: | | [windows-2022-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.13% <75.00%> (-0.06%)` | :arrow_down: | | [windows-2022-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.31% <75.00%> (-0.17%)` | :arrow_down: | | [windows-2022-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.06% <65.62%> (-0.12%)` | :arrow_down: | | [windows-2022-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.06% <65.62%> (-0.12%)` | :arrow_down: | | [windows-2022-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1102/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.13% <75.00%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.