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

deprecate hook configuration via marks/attributes #9118

Conversation

RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Sep 23, 2021

fixes #4562

must be merged after #8508

@RonnyPfannschmidt RonnyPfannschmidt added the type: deprecation feature that will be removed in the future label Sep 23, 2021
@RonnyPfannschmidt RonnyPfannschmidt changed the title deprecate hook configuration via marks/attributes [WIP] deprecate hook configuration via marks/attributes Sep 23, 2021
nicoddemus added a commit to nicoddemus/pytest-xdist that referenced this pull request Sep 24, 2021
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.

Thanks @RonnyPfannschmidt, this issue wasn't even in my radar. 😁

Left some comments, please take a look.

changelog/4562.deprecation.rst Outdated Show resolved Hide resolved
changelog/4562.deprecation.rst Outdated Show resolved Hide resolved
doc/en/deprecations.rst Outdated Show resolved Hide resolved
src/_pytest/config/__init__.py Outdated Show resolved Hide resolved
src/_pytest/config/__init__.py Outdated Show resolved Hide resolved
src/_pytest/deprecated.py Outdated Show resolved Hide resolved
src/_pytest/deprecated.py Outdated Show resolved Hide resolved
testing/deprecated_test.py Outdated Show resolved Hide resolved
testing/deprecated_test.py Outdated Show resolved Hide resolved
nicoddemus added a commit to nicoddemus/pytest-xdist that referenced this pull request Sep 24, 2021
nicoddemus added a commit to nicoddemus/pytest-xdist that referenced this pull request Sep 24, 2021
@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Left some comments on the docs/texts. I haven't reviewed the code, will try to later.

doc/en/deprecations.rst Outdated Show resolved Hide resolved
doc/en/deprecations.rst Outdated Show resolved Hide resolved
doc/en/deprecations.rst Outdated Show resolved Hide resolved
src/_pytest/deprecated.py Outdated Show resolved Hide resolved
src/_pytest/deprecated.py Outdated Show resolved Hide resolved
changelog/4562.deprecation.rst Show resolved Hide resolved
doc/en/deprecations.rst Outdated Show resolved Hide resolved
doc/en/deprecations.rst Outdated Show resolved Hide resolved
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as draft February 27, 2022 07:33
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch 3 times, most recently from 2dabd1b to 38f4561 Compare March 8, 2022 08:51
@RonnyPfannschmidt RonnyPfannschmidt changed the title [WIP] deprecate hook configuration via marks/attributes deprecate hook configuration via marks/attributes Mar 8, 2022
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as ready for review May 15, 2022 21:00
@RonnyPfannschmidt RonnyPfannschmidt added this to the 7.2 milestone Jul 11, 2022
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch 2 times, most recently from 22a9238 to 4052ce6 Compare July 30, 2022 19:59
@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus i finally got around reiterating this, please have a look

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.

Great work!

@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus as far as i can tell, the only blocker is pytest-dev/pytest-cov#549

ionelmc pushed a commit to pytest-dev/pytest-cov that referenced this pull request Sep 22, 2022
The old way using marks is being deprecated in pytest 7.2:

pytest-dev/pytest#9118
@nicoddemus
Copy link
Member

That has just been merged. 👍

@The-Compiler
Copy link
Member

I'm afraid the error messages this generates for hookimpls are almost unusable due to having way too little information where the culprit is: #10342

@The-Compiler
Copy link
Member

Quick analysis of the impact of this:

FWIW, I submitted PRs to the affected plugins I use:

The-Compiler added a commit to The-Compiler/pytest that referenced this pull request Oct 7, 2022
@RonnyPfannschmidt
Copy link
Member Author

The impact is not surprising, this was intended to be deprecate back when the new decorators came up

Instead the old way was cargo culted all the way till now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: deprecation feature that will be removed in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deprecate marker based hook metadata
4 participants