-
Notifications
You must be signed in to change notification settings - Fork 38
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
pkg_resources doesn't find entry_points when metadata is in zip folder #413
Comments
The easiest way I found to reproduce this: Add the following code before starting the runloop in examples/Tkinter/hello_tk/hello.py: import humanfriendly
import pkg_resources
for ep in pkg_resources.iter_entry_points("console_scripts"):
if ep.dist.project_name == "humanfriendly":
break
else:
raise RuntimeError("EP for humanfriendly not found") This fails even though the required files are present in python310.zip:
|
The problem is that pkg_resources isn't expecting to find a zipped-up folder with site-packages on sys.path, the initialiser for I've filed an issue with setuptools and am looking for a workaround on my side. |
This is a workaround for #413, hopefully this will get fixed in setuptools.
aa56a19 contains a workaround for this issue, it monkey patches |
Closing this issue because I have a workaround in py2app, I'll reconsider if/when this gets fixed in pkg_resources. |
I use
py2app
in the spyder-ide/spyder project to bundle its macOS application, and recently updated the use ofpy2app
from 0.22 to 0.27. I now see thatpkg_resources
included in its application does not find entry points for packages included in the application bundle if the metadata (egg/dist-info) is located in thepythonXX.zip
directory.This may be a bug/feature of
pkg_resources
, since for 0.22 I copied the metadata to thepythonX.X
directory after app bundle creation; I may have been inadvertently avoiding this issue.@ronaldoussoren, now that
py2app
handles the metadata, what is the best way to resolve this issue?For example, the entry points found for
pkg_resources.iter_entry_points('console_scripts')
are['keyring', 'watchmedo']
. However, after extracting the zip archive in the bundle app and renaming topythonXX.zip
(so not a real archive directory, but insys.path
), the found entry points are['keyring', 'black', 'black-primer', 'blackd', 'coloredlogs', 'humanfriendly', 'iptest', 'iptest3', 'ipython', 'ipython3', 'jupyter-kernel', 'jupyter-kernelspec', 'jupyter-run', 'jupyter-dejavu', 'jupyter-nbconvert', 'pydocstyle', 'pylupdate5', 'pyrcc5', 'pyuic5', 'isort', 'isort-identify-imports', 'jupyter-trust', 'fonttools', 'pyftmerge', 'pyftsubset', 'ttx', 'jupyter', 'jupyter-migrate', 'jupyter-troubleshoot', 'sphinx-apidoc', 'sphinx-autogen', 'sphinx-build', 'sphinx-quickstart', 'jsonschema', 'flake8', 'chardetect', 'epylint', 'pylint', 'pyreverse', 'symilar', 'pygmentize', 'pybabel', 'pycodestyle', 'pyflakes', 'watchmedo', 'normalizer', 'f2py', 'f2py3', 'f2py3.9', 'isympy', 'cookiecutter', 'autopep8', 'qta-browser', 'yapf', 'yapf-diff', 'cygdb', 'cython', 'cythonize', 'jupyter-execute']
The text was updated successfully, but these errors were encountered: