-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Create recommended process for notifying 3rd party package maintainers #8
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
Comments
Can I suggest that this should be worked on before accepting further third-party stubs? As of right now I count more than 19 third-party type stubs, including requests (twice), of which I am one of the maintainers. I am not aware that any requests maintainer was contacted about type stubs being added for requests, despite the claims in PEP 484 (emphasis mine):
It's possible that I'm wrong and that one of the other maintainers was contacted, but it's my suspicion that we weren't. Given this, I suspect many, possibly all, of the third-party stubs are in the same boat. There's also been some troubling communication from the typeshed maintainers on this topic here:
This sentiment seems to be in complete opposition to PEP 484, which requires explicit consent: taking the submitters word for it is the very definition of implicit consent. To be clear, the requests project has no objection to type stubs being submitted to the typeshed, but other maintainers may object. I recommend putting this process in place now, rather than wait for this to blow up into something. |
I'll amend this a little. As another maintainer, I take objection since we were given no chance to check the quality of the stubs (and there are two different implementations?). Our API is complex enough (although seemingly simple) that I would want to be very certain the stubs are correct, not just close enough. |
Now that |
@o11c I think you're commenting on the wrong issue |
My take on what happened is that the stubs in typeshed were imported from the mypy repo, and we (the mypy developers) didn't check with the module owners, though perhaps we should have -- the PEP only talks about typeshed, not tool-specific repos. When the stub migration happened I guess everybody assumed that somebody else had checked if including the stubs is fine. I think that most of the third party stubs don't have many (or any) annotations so they should be reasonably safe from having bad annotations, but they might still get out of date and be incompatible with future API changes. I guess we could retroactively ask for permission, or delete third party stubs with an unconfirmed acceptance status, but I'd propose to wait a little and see if we can come up with a reasonable general policy first. Here are some potential issues:
|
My 2¢:
Generally speaking such a project will have a formal decision making process. I recommend using it in that case. These projects are actually easier to keep track of than smaller ones because their decision-making process is formal and likely to be public. Consider using mailing lists etc.
What about them? This isn't really typeshed's concern. In this instance, while typeshed has the right to do whatever you please, there appears to be a lot of consensus that maintainers should retain some degree of control over type stubs if possible. That means if a maintainer doesn't want any type stubs, you shouldn't create them. If another tool decides to ignore the maintainer, that antisocial behaviour is on them. Don't have typeshed abuse the wishes of a maintainer just because other tools will too.
It seems like this should be part of getting acceptance for new stubs. Here's an example policy:
This is relatively slow, which is a downside, but it ensures good communication throughout and a fairly documentable process.
You should really have something. How formal it is is a decision of typeshed, but at the very least it would be good to be able to open up a project stub and see who OKd the creation of it. |
It may also be worth keeping documentation around who that stub's author was, if they plan to maintain it, and who on the project itself serves as a point of contact for OK'ing updates to the stubs. This ideally makes the process for reviewing PRs with updates to those stubs easier. |
Semi-related question - if a third party package comes with stubs (or type hints in the actual code) does it eliminate the need to maintain a separate set of stubs in typeshed? (Assuming mypy is executed in an environment that has access to the installed stubs). |
@jstasiak It would be hard to maintain synchrony between the stubs in the release and the stubs in typeshed, so I think it would be better in that case to just use the stubs or annotations from the release. That's what MYPYPATH is for; and the --incremental flag should make it faster (it would avoid checking the annotated released code over and over). But the package owner has the last word (if they care -- most of them so far have just said "fine, do what you think is right"). It looks like Tornado might be adding annotations to a future release. I'm not sure what that means for the tornado stubs in typeshed, but surely pointing MYPYPATH at the tornado tree should force mypy to use the annotations from the tornado tree rather than from typeshed. The typeshed annotations might still be useful for folks stuck on an older tornado release; if the Tornado project asks us to remove them, I will do so, but I might first make a copy for my own use. :-) |
Cool, that's exactly what I thought. I'm asking because I'm interested in adding stubs/type hints to some libraries I'm responsible for to help move the static typing situation forward. :) |
It may still make sense to have stubs in typeshed even if the release is annotated if the module is both popular and has a very stable (and thus likely small) interface. |
I am closing this. We now have a documented process (https://github.com/python/typeshed#third_party) and we are following it. We accept proof of consent in the form of a response in the issue tracker for the 3rd party package. |
Fix misc errors
No description provided.
The text was updated successfully, but these errors were encountered: