Skip to content
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

python: ttfautohint: Python 3.12 support #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cheat-sc
Copy link

@cheat-sc cheat-sc commented Jun 15, 2024

Since python 3.12, pkg_resources has been moved to setuptools. Also, it is deprecated.

$ python -m ttfautohint --help
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/ttfautohint/_version.py", line 2, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/usr/lib/python3.12/site-packages/ttfautohint/__init__.py", line 12, in <module>
    from ttfautohint._version import __version__
  File "/usr/lib/python3.12/site-packages/ttfautohint/_version.py", line 4, in <module>
    except (ImportError, DistributionNotFound):
                         ^^^^^^^^^^^^^^^^^^^^
NameError: name 'DistributionNotFound' is not defined

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

$ python -m ttfautohint --help
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/ttfautohint/_version.py", line 2, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/usr/lib/python3.12/site-packages/ttfautohint/__init__.py", line 12, in <module>
    from ttfautohint._version import __version__
  File "/usr/lib/python3.12/site-packages/ttfautohint/_version.py", line 4, in <module>
    except (ImportError, DistributionNotFound):
                         ^^^^^^^^^^^^^^^^^^^^
NameError: name 'DistributionNotFound' is not defined

Signed-off-by: Shohei Maruyama <cheat.sc.linux@outlook.com>
@cheat-sc cheat-sc force-pushed the python-3.12-support branch from 0cb089c to a77001a Compare June 15, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant