Skip to content

Commit

Permalink
python: ttfautohint: Python 3.12 support
Browse files Browse the repository at this point in the history
Since python 3.12, pkg_resources has been moved to setuptools. Also, it is deprecated.

- Kozea/Radicale#1184
- mu-editor/mu#2485
- python/cpython#95299

Signed-off-by: Shohei Maruyama <cheat.sc.linux@outlook.com>
  • Loading branch information
cheat-sc committed Jun 15, 2024
1 parent 5b66ad2 commit 0cb089c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/python/ttfautohint/_version.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
try:
from pkg_resources import get_distribution, DistributionNotFound
__version__ = get_distribution("ttfautohint-py").version
except (ImportError, DistributionNotFound):
# either pkg_resources is missing or package is not installed
import warnings
warnings.warn(
"'ttfautohint-py' is missing the required distribution metadata. "
"Please make sure it was installed correctly.", UserWarning,
stacklevel=2)
__version__ = "0.0.0"
from importlib import metadata

__version__ = metadata.version("ttfautohint-py")

0 comments on commit 0cb089c

Please sign in to comment.