Skip to content

Commit 9d7f1d5

Browse files
committed
Require Lingua 4.16 or greater
The Lingua extractor plugin was repaired to work with the Lingua 4 API in 1.2.0, however the test suite continued to pin Lingua below 4, a cap added while that defect was outstanding. As the plugin is skipped when Lingua is not importable, the stale cap went unnoticed: Lingua 3 imports pkg_resources at startup, which is not present in current setuptools releases, so the pinned version could not be imported and the plugin was covered by no tests at all. Lingua 4.16 resolves entry points using importlib.metadata, falling back to pkg_resources only when that is unavailable, so no deprecated pkg_resources usage remains. Raising the pin to 4.16 restores coverage of the plugin, which passes against the current release unmodified. Fixes: #393 Change-Id: Ia88fc2ad137e96709bc4be24ebd756c0bea1cc1d
1 parent 21c11f3 commit 9d7f1d5

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎doc/build/unreleased/393.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. change::
2+
:tags: bug, ext
3+
:tickets: 393
4+
5+
The minimum Lingua version supported by :class:`.LinguaMakoExtractor` is
6+
now 4.16. The test suite had continued to pin Lingua below 4 long after
7+
the extractor itself was repaired to work with Lingua 4 in version 1.2.0,
8+
with the result that the plugin was no longer covered by tests at all; the
9+
pinned version additionally imports ``pkg_resources`` at startup, which is
10+
not present in current setuptools releases and left the package
11+
unimportable. Lingua 4.16 resolves entry points using
12+
``importlib.metadata``, so no deprecated ``pkg_resources`` usage remains.

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Documentation = "https://docs.makotemplates.org"
4040
[project.optional-dependencies]
4141
testing = ["pytest"]
4242
babel = ["Babel"]
43-
lingua = ["lingua"]
43+
lingua = ["lingua>=4.16"]
4444

4545
[dependency-groups]
4646
tests = [
@@ -50,7 +50,7 @@ tests = [
5050
"pygments",
5151
"babel",
5252
"dogpile.cache",
53-
"lingua<4",
53+
"lingua>=4.16",
5454
"junitparser",
5555
]
5656
coverage = [

‎tox.ini‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ deps=pytest>8
1212
pygments
1313
babel
1414
dogpile.cache
15-
lingua<4
15+
lingua>=4.16
1616
cov: pytest-cov
1717

1818
setenv=

0 commit comments

Comments
 (0)