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 RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from a445d0f to 430ac90 Compare October 1, 2021 19:57
@RonnyPfannschmidt

This comment has been minimized.

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from 430ac90 to 985bd3e Compare October 2, 2021 05:27
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
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from d2e9fd5 to c53e07c Compare October 3, 2021 14:02
doc/en/deprecations.rst Outdated Show resolved Hide resolved
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from e7d30c9 to df09799 Compare October 10, 2021 14:46
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from df09799 to 34665e7 Compare November 17, 2021 13:39
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from 34665e7 to 825dae2 Compare February 27, 2022 07:30
@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 force-pushed the fix-4562-deprecate-hookmarkers branch from 3417054 to ee7c8bf Compare March 8, 2022 09:13
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from ee7c8bf to 92bf2ee Compare May 15, 2022 20:59
@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

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from 83ca2ce to 807e287 Compare September 20, 2022 14:23
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-4562-deprecate-hookmarkers branch from 807e287 to ae9dbf5 Compare September 20, 2022 14:24
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