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

Comments

Projects
None yet
4 participants
@pradyunsg
Copy link
Member

commented Jan 31, 2019

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)

@cjerdonek

This comment has been minimized.

Copy link
Member

commented Feb 2, 2019

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

@jaraco

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

@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

This comment has been minimized.

Copy link
Member

commented Feb 24, 2019

I posted PR #1706 to address this.

pganssle added a commit that referenced this issue Apr 3, 2019

Merge pull request #1706 from cjerdonek/issue-1664-include-metadata-l…
…ocation

Include path in error message when version is missing (Fixes #1664)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.