-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add stubs for pluggy==1.2.0
#10473
Add stubs for pluggy==1.2.0
#10473
Conversation
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…s from `typing_extensions` Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks pretty good; a few remarks below.
Seems a bit unfortunate to add these stubs given how heavily typed the runtime package is, but if they don't want to add a py.typed
file, I guess I'm okay with adding these.
Signed-off-by: Oleg Hoefling <oleg.hoefling@gmail.com>
Signed-off-by: Oleg Hoefling <oleg.hoefling@gmail.com>
This comment has been minimized.
This comment has been minimized.
TBH I was expecting the package to expose type hints in 1.2.0, but since it is postponed, I'd rather have a Another (not so obvious and rather a personal) benefit from this PR is that thanks to you, I'm getting a great sync on the latest |
Signed-off-by: Oleg Hoefling <oleg.hoefling@gmail.com>
This comment has been minimized.
This comment has been minimized.
This reverts commit d97e5de.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there, I think!
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diff from mypy_primer, showing the effect of this PR on open source code: pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/config/__init__.py:471: error: Incompatible types in assignment (expression has type "dict[str, bool]", variable has type "_HookSpecOpts | None") [assignment]
+ src/_pytest/config/__init__.py:734: error: "PytestPluginManager" has no attribute "_name2plugin" [attr-defined]
+ src/_pytest/config/__init__.py:735: error: "PytestPluginManager" has no attribute "_name2plugin" [attr-defined]
+ src/_pytest/config/__init__.py:737: error: "PytestPluginManager" has no attribute "_name2plugin" [attr-defined]
+ src/_pytest/config/__init__.py:738: error: "PytestPluginManager" has no attribute "_name2plugin" [attr-defined]
+ src/_pytest/config/__init__.py:1069: error: Incompatible types in assignment (expression has type "Any | None", variable has type "TerminalReporter") [assignment]
+ src/_pytest/pytester.py:754: error: "PytestPluginManager" has no attribute "reprec" [attr-defined]
+ src/_pytest/logging.py:666: error: Argument 1 to "_LiveLoggingStreamHandler" has incompatible type "Any | None"; expected "TerminalReporter" [arg-type]
+ src/_pytest/helpconfig.py:165: error: Item "None" of "Any | None" has no attribute "_tw" [union-attr]
+ src/_pytest/helpconfig.py:230: error: Item "None" of "Any | None" has no attribute "stats" [union-attr]
+ testing/test_pluginmanager.py:245: error: Item "None" of "Any | None" has no attribute "__name__" [union-attr]
+ testing/test_pluginmanager.py:246: error: Item "None" of "Any | None" has no attribute "__name__" [union-attr]
+ testing/test_pluginmanager.py:339: error: Item "None" of "Any | None" has no attribute "__name__" [union-attr]
+ testing/test_pluginmanager.py:354: error: Item "None" of "Any | None" has no attribute "x" [union-attr]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
This PR suggests to add stubs for the
pluggy
package of the current version 1.2.0. The reason for this is that althoughpluggy
itself is (almost) completely typed, the package ships no PEP 561 marker yet, as there is no consensus about what types to expose, see pytest-dev/pluggy#414.