Closed chris-martin closed 1 month ago
@chris-martin it's been a long time, but I'm doing an old issue sweep and saw this. With the fix to your project here: https://github.com/jsirois/pex-resources-demo/commit/c7805b46066bb05c1c7f521cbd42af2fb1c60880 modern Pex works fine:
:; pex demo@git+https://github.com/jsirois/pex-resources-demo setuptools -odemo.pex
:; ./demo.pex -c 'from demo.version import get_version; print(get_version())'
0.0.1
Let me know if you have further questions. The packaging world has certainly moved on as has the stdlib with pkgutil
(which was always an alternative to pkg_resources
) -> importlib.resources
.
I set up a simple example project that uses
pkg_resources.resource_string
to read from a file in itssetup.py
to set the version number.python setup.py sdist
to verify that thesetup.py
works.pex . --no-wheel
and have that work as well. Instead I get:Oddly, it seems to have worked a little bit, because it did end up pulling the version number
0.0.1
out of the file at some point.I've always been rather fuzzy on exactly how python packaging works, so apologies if this is a foolish or non-pex-related question.