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

Use __contains__ to avoid KeyError with importlib_metadata==8.0.0 #384

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

kemzeb
Copy link
Collaborator

@kemzeb kemzeb commented Jun 26, 2024

We don't actually depend on the backport, but a pytest plugin that we are using, pytest-console-scripts, does.

importlib_metadata==8.0.0 now raises a KeyError when we try to get metadata that doesn't exist (where before it would return None).

When running the automated tests, we would fail because the backport would for some reason take precedence over the stdlib. To resolve this, the current impl is replaced with a contains() call.

We don't actually depend on the backport, but a pytest plugin that
we are using, pytest-console-scripts, does.

importlib_metadata==8.0.0 now raises a KeyError when we try to get
metadata that doesn't exist (where before it would return None).

When running the automated tests, we would fail because the backport
would for some reason take precedence over the stdlib. To resolve
this, the current impl is replaced with a __contains__() call.
@gaborbernat gaborbernat merged commit 5eabebe into tox-dev:main Jun 26, 2024
11 checks passed
@kemzeb kemzeb deleted the fix-discovery branch July 12, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants