-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Better identification of broken Distribution objects #508
Comments
I believe this issue is fixed in Add another line to the repro, I am able to reproduce the issue.
And with the issue reproduced, I still see the TypeError under importlib_metadata 8.5.0. |
Unfortunately, the repro doesn't provide a very good understanding of the factors that lead to the missed expectation, as I did find that
|
Oh, right. I remember now - the issue stems from some other provider producing In #486, we're working on addressing that concern (where older interfaces are inadequate for newer behaviors). I'm still not sure that issue would address the concern reported here, which is that the implicated distribution (bad metadata) isn't apparent. Even after a KeyError is (more correctly) raised, it won't include which Dist was impacted. There is, however, there is an We could as you suggest wrap the
I'm disinclined to go that route. A lot of the interfaces are working from the assumption that the dists are valid. I'd like to continue to rely on that assumption and not create another space for "null" distributions (or names or similar). Another option could be to emit a warning whenever a broken distribution is encountered. Maybe it's opt-in so the warnings are only emitted on demand (for performance reasons). |
Currently, I'm getting an error on Python 3.8 and 3.9 in pypa/build#820:
docker run --rm -it python:3.9 bash pip install tox git clone https://github.com/pypa/build cd build tox -e py39 -- -k test_metadata_path_no_prepare -v
The problem is
dist.__dict__={'_path': PosixPath('/build/tests/packages/test-no-prepare/test_no_prepare.egg-info')}
. I think this is tripping up ontests/packages/test-no-prepare/test_no_prepare.egg-info/
and the local backend. But I don't know what updated to cause this to start happening.Regardless of the solution, though, I think the handling here for a missing name should be better, there wasn't any useful info in the error message to tell me about the
dist
that was failing. I had to addprint(f"{dist.__dict__=}")
to see it. Or maybe the normalize name could return None, and let the failure happen elsewhere.The text was updated successfully, but these errors were encountered: