Skip to content

Commit

Permalink
hooks: update pkg_resources hook for setuptools >= 70.0.0
Browse files Browse the repository at this point in the history
As of setuptools 70.0.0, we need to add `pkg_resources.extern` to
hidden imports.
  • Loading branch information
rokm committed May 21, 2024
1 parent 6765848 commit a8da1a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PyInstaller/hooks/hook-pkg_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@
'pkg_resources._vendor.jaraco.context',
'pkg_resources._vendor.jaraco.text',
]

# As of setuptools 70.0.0, we need pkg_resources.extern added to hidden imports.
if check_requirement("setuptools >= 70.0.0"):
hiddenimports += [
'pkg_resources.extern',
]
2 changes: 2 additions & 0 deletions news/8554.hooks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update ``pkg_resources`` hook for compatibility with ``setuptools`` v70.0.0
and later (fix ``ModuleNotFoundError: No module named 'pkg_resources.extern'``).

0 comments on commit a8da1a7

Please sign in to comment.