-
-
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 setuptools stubs #5762
Add setuptools stubs #5762
Conversation
Also ran these stubs through black and isort.
This reverts commit ebc7114.
The arguments for setup() are copied from distutils.setup().
I'm unclear why pytype fails, maybe @rchen152 has some ideas. |
Huh, pytype thinks SetuptoolsDeprecationWarning is a module - maybe because of how it's imported? Looking into it. |
Still trying to figure out how to fix this, but in the meantime, I did find a workaround: if you replace all |
stubtest crashes. Maybe @hauntsaninja has an idea. |
Looks like something in setuptools that looks like a function raises on inspect.signature. We could also just catch TypeError here: https://github.com/python/mypy/blob/6fd2dc2403889f7104648d8bfbb8df3f5e83b63f/mypy/stubtest.py#L670 |
Apparently stubtest has an instance of
|
Should fix the issue in python/typeshed#5762
Should fix the issue in python/typeshed#5762
Let's wait for the next mypy release: python/mypy#10884, also this requires updated distutils. |
Here's a fix in stubtest: python/mypy#10884 |
@srittau I pushed a workaround, so CI is now green if you want to merge. |
Should we merge this, though? It will not work with current mypy as it requires newer stdlib stubs. I'm 50/50 on merging now vs after the next mypy release. |
Well, I figured it's nice to have the option! :-) |
We made the (erroneous) assumption that "from . import X" can only import a module, which was causing trouble for typeshed. See python/typeshed#5762 (comment) for context. Fixing this exposed another bug where load_pytd.Module.is_package didn't work correctly for stubs that ship with pytype, which I also fixed. PiperOrigin-RevId: 388369899
I know you've already worked around the pytype issue, but anyway, pytype release 2021.08.03 should fix it ^^ |
I marked it as ready to merge if someone has time to review it and thinks we should merge now. |
Still work in progress: There are mypy failures.