Skip to content

Commit 173372a

Browse files
committed
fix: avoid using deprecated pkg_resources
1 parent 90062b3 commit 173372a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ languages-po/%.po: modules/cldr-json/cldr-json/cldr-localenames-full/main/en/lan
3333
l10n-guide.csv: modules/l10n-guide/docs/l10n/pluralforms.rst scripts/export-l10n-guide.py
3434
./scripts/export-l10n-guide.py
3535

36-
LANG_DATA = $(shell python -c 'from pkg_resources import Requirement, resource_filename; print(resource_filename(Requirement.parse("translate-toolkit"), "translate/lang/data.py"))')
36+
LANG_DATA = $(shell python ./scripts/get-lang-data-path.py)
3737

3838
translate.csv: $(LANG_DATA) scripts/export-translate.py
3939
./scripts/export-translate.py

scripts/get-lang-data-path.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/env python3
2+
3+
# Copyright © Michal Čihař <[email protected]>
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
from importlib.resources import as_file, files
8+
9+
ref = files("translate") / "lang" / "data.py"
10+
with as_file(ref) as path:
11+
print(path)

0 commit comments

Comments
 (0)