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

Sync typeshed #15165

Merged
merged 6 commits into from
May 1, 2023
Merged

Conversation

AlexWaygood
Copy link
Member

Source commit:
python/typeshed@d208d5a

Changes in ctypes and functools caused merge conflicts with the cherry picks, and also broke the ctypes plugin (I hope the last commit in this PR fixes the plugin).

⚠️ Remember to use "rebase and merge" rather than "squash and merge" for this PR, so that we can easily update the commit hashes to cherry-pick in the misc/sync-typeshed.py script.

AlexWaygood and others added 6 commits May 1, 2023 20:31
This is allegedly causing large performance problems, see 13821

typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing
to undo. Patching this in typeshed also feels weird, since there's a
more general soundness issue. If a typevar has a bound or constraint, we
might not want to solve it to a Literal.

If we can confirm the performance regression or fix the unsoundness
within mypy, I might pursue upstreaming this in typeshed.

(Reminder: add this to the sync_typeshed script once merged)
Since the plugin provides superior type checking: python#13987 (comment)
A manual cherry-pick of e437cdf.
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/formats/xml.py:411: error: Incompatible return value type (got "str", expected "bytes")  [return-value]

@hauntsaninja
Copy link
Collaborator

Thanks for doing this! Looks great.

I was hopeful when we added the cherry picking that it would be rare that we'd have conflicts. This doesn't seem to have been borne out. I wonder if we'd be better served by just including the diffs in the repo and using git apply.

@AlexWaygood
Copy link
Member Author

I was hopeful when we added the cherry picking that it would be rare that we'd have conflicts. This doesn't seem to have been borne out.

Yeah -- tbf, there has been a perhaps-unusual amount of churn in the stdlib stubs over recent months due to the "Let's add defaults everywhere!" project. Also, we now have 5 commits to cherry-pick each typeshed sync, which makes it much more likely there'll be a merge conflict somewhere than it was when we only had one commit to cherry-pick.

FWIW, I think the current system is still much better than the system we had before we introduced the automated workflow! I find the new script much easier to use, and it's nice to have an expectation of when the next typeshed sync is "due".

I wonder if we'd be better served by just including the diffs in the repo and using git apply.

My git skills are fairly rudimentary, so I don't feel like I can comment on which will be better there really :p

@JelleZijlstra
Copy link
Member

I don't really like that we're doing these typeshed patches at all. It would be better if we could improve mypy so it works well with vanilla typeshed. However, that's a harder change to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants