Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Include location of bad METADATA files in errors #1664
referenced this issue
Jan 31, 2019
I was planning to extract pkg_resources as a separate package and vendor it in setuptools (#863), but my work stalled on that and that repo is now stale. Presumably it wouldn't take much to merge it with recent changes found authoritatively in the setuptools repo. The one thing I want to avoid is maintaining the functionality in two places, so any transition should be clear-cut.
Instead, I've been focusing my energy on importlib_resources, which promises to obviate many if not most of the use-cases of pkg_resources... and is planned to become part of the stdlib in Python 3.8.
Funny (not funny) how my goal not to maintain the functionality in two places led me to just that approach.
@zooba had a good suggestion here pypa/pip#6251 (comment) to make a custom type for these errors. That would let callers like pip provide more information to the user without having to expose an exception object or traceback. The exception could have as attributes the expected path of the METADATA file and, if applicable, the name of the attribute being accessed.