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

Include location of bad METADATA files in errors #1664

Closed
pradyunsg opened this issue Jan 31, 2019 · 4 comments
Closed

Include location of bad METADATA files in errors #1664

pradyunsg opened this issue Jan 31, 2019 · 4 comments
Labels
enhancement Needs Investigation Issues which are likely in scope but need investigation to figure out the cause

Comments

@pradyunsg
Copy link
Member

pkg_resources should probably be including the location of the errant METADATA (e.g. path to the file) in the ValueError message to make troubleshooting easier. Maybe someone can file an issue there.

Originally posted by @cjerdonek in pypa/pip#6194 (comment)

@pganssle pganssle added enhancement Needs Investigation Issues which are likely in scope but need investigation to figure out the cause labels Jan 31, 2019
@cjerdonek
Copy link
Member

By the way, what is the purpose of this repo? https://github.com/pypa/pkg_resources Is it still being used?

@jaraco
Copy link
Member

jaraco commented Feb 4, 2019

What is the purpose of the pkg_resources repo?

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.

@cjerdonek
Copy link
Member

@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.

@cjerdonek
Copy link
Member

I posted PR #1706 to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Investigation Issues which are likely in scope but need investigation to figure out the cause
Projects
None yet
Development

No branches or pull requests

4 participants