-
Notifications
You must be signed in to change notification settings - Fork 59
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
Ship a pytest plugin? #97
Comments
I'm not familiar with pytest entrypoint plugins. Can you explain what this would mean in a bit more detail? |
diff --git i/setup.py w/setup.py
index 7cc0d2f..554486f 100644
--- i/setup.py
+++ w/setup.py
@@ -20,7 +20,15 @@ def get_long_description():
platforms=['POSIX'],
packages=['pyannotate_runtime', 'pyannotate_tools',
'pyannotate_tools.annotations', 'pyannotate_tools.fixes'],
- entry_points={'console_scripts': ['pyannotate=pyannotate_tools.annotations.__main__:m>
+ modules=['pytest_pyannotate'],
+ entry_points={
+ "console_scripts": [
+ "pyannotate=pyannotate_tools.annotations.__main__:main",
+ ],
+ "pytest11": [
+ "pytest-pyannotate = pytest_pyannotate",
+ ],
+ },
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console', And then have the plugin in The main benefit of course it that it easily allows to use pyannotate with pytest-based projects (although having the example conftest is very good already - this would just make the integration more seemingly etc) |
If you're willing to contribute the code that sounds like a good idea to me. (Though I am no longer a Dropbox employee and I don't know if I can still merge PRs. I can definitely still review code though. :-) |
There's https://github.com/kensho-technologies/pytest-annotate at least. |
I guess I didn't see this, but I basically did this with #107 I didn't add it as an entry point since I doubt you actually want to run it any time it's installed to the system and instead you'll probably want to opt in via pytest's plugin config/argument https://docs.pytest.org/en/latest/plugins.html#installing-and-using-plugins. I updated the documentation to match. |
There's an example conftest (#11), but it would be possible to ship a pytest entrypoint plugin (via e.g. a
pytest_pyannotate
module), that could be used viapytest --pyannotate
then automatically.I'd be happy to add it, but wanted to ask for feedback first.
Just for reference: Instagram/MonkeyType#25
The text was updated successfully, but these errors were encountered: