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

Fix required_plugins with prereleases #8469

Merged
merged 3 commits into from
Mar 21, 2021

Conversation

The-Compiler
Copy link
Member

Fixes #8456

@@ -1270,14 +1270,16 @@ def _validate_plugins(self) -> None:
missing_plugins = []
for required_plugin in required_plugins:
try:
spec = Requirement(required_plugin)
req = Requirement(required_plugin)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took the freedom to rename this, as spec is very close to specifier (another thing in packaging, see .specifier below) which I found confusing.

pytest.param(
"""
[pytest]
required_plugins = myplugin==1.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the two commits individually to get a better diff (also see the comment below).

testing/test_config.py Show resolved Hide resolved
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Left a small CHANGELOG suggestion.

changelog/8456.bugfix.rst Outdated Show resolved Hide resolved
testing/test_config.py Show resolved Hide resolved
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
@The-Compiler
Copy link
Member Author

Thanks @nicoddemus for the review, and @RonnyPfannschmidt @asottile for the suggestions in #8456!

@The-Compiler The-Compiler merged commit bc055e8 into pytest-dev:main Mar 21, 2021
@The-Compiler The-Compiler deleted the required-prereleases branch March 21, 2021 21:51
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.

required_plugins false-positive with prereleases of plugins
2 participants