-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Support next types-setuptools update #14781
Conversation
setup.py
Outdated
# Use multi-file compilation mode on windows because without it | ||
# our Appveyor builds run out of memory sometimes. | ||
multi_file=sys.platform == "win32" or force_multifile, | ||
ext_modules = cast( |
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.
Why do we need the cast
here?
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.
setup
is imported from setuptools
, the ext_modules
param expects a Sequence[setuptools.Extension]
but mypycify
can return a list of either setuptools.Extension
or distutils.core.Extension
in python < 3.12.
Since setup.py
imports setuptools. We know mypycify
will always return list[setuptools.Extension]
, but the type system doesn't know that.
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.
I'd strongly prefer to avoid casts here, since they don't work well with mypyc. Can we use an assertion instead?
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.
I sure can. It's a list so I think I'd have to use a typeguard. Hopefully that's fine.
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.
I'd strongly prefer to avoid casts here, since they don't work well with mypyc.
Is the setup.py compiled by mypyc?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jelle Zijlstra <[email protected]>
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
(I just merged the typeshed PR) |
Hmm, looks like this hasn't fixed things unfortunately — tests are now failing on https://github.com/python/mypy/actions/runs/4275505309/jobs/7442902873 |
This reverts commit ab7b69a.
(I'm investigating now what's up) |
The latest release of `types-setuptools` is causing type-check errors (and, therefore, build errors) on the `master` branch: see, e.g. https://github.com/python/mypy/actions/runs/4275505309/jobs/7442902732. python#14781 addressed some of the new errors, but didn't quite fix the build.
- The latest release of `types-setuptools` started causing type-check errors (and, therefore, mypyc build errors) on the `master` branch: see, e.g. https://github.com/python/mypy/actions/runs/4275505309/jobs/7442902732. - #14781 addressed some of the new errors, but didn't quite fix the build. - #14788 then pinned the `types-setuptools` dependency as a temporary stopgap measure. - This PR now attempts to unpin `types-setuptools` and fix the build errors in a more principled way.
A simple type-only change since mypyc explicitely uses setuptools' monkeypatching. And `setup.py` imports from setuptools. Tests should stay the same. This should fix a sudden failure of tests once python/typeshed#9795 is merged.
- The latest release of `types-setuptools` started causing type-check errors (and, therefore, mypyc build errors) on the `master` branch: see, e.g. https://github.com/python/mypy/actions/runs/4275505309/jobs/7442902732. - python#14781 addressed some of the new errors, but didn't quite fix the build. - python#14788 then pinned the `types-setuptools` dependency as a temporary stopgap measure. - This PR now attempts to unpin `types-setuptools` and fix the build errors in a more principled way.
The mypyc build was recently broken by a new release of `types-setuptools`. This was fixed on `master` by the following two PRs: - #14781 - #14787 However, the mypyc build is still broken on the 1.1 branch: https://github.com/python/mypy/actions/runs/4311688115/jobs/7521345529. This PR cherry-picks the two PRs that fixed the build to the 1.1 branch. --------- Co-authored-by: Avasam <[email protected]>
A simple type-only change since mypyc explicitely uses setuptools' monkeypatching. And
setup.py
imports from setuptools.Tests should stay the same. This should fix a sudden failure of tests once python/typeshed#9795 is merged.