-
-
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 building mypycified mypy with PEP517 interface #13445
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
Ah, we kinda require type requirements to be installed in the environment at test time for linting ourselves, so they will need to be included outside of |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
### Description This PR tweaks two things about how mypyc generates and builds C code to better support WebAssembly. First, we search `sysconfig` for the size of `size_t`, which works much better for cross-compiling. Second, newer versions of clang have `-Wno-unused-but-set-variable` and so it is added to the default list of arguments (this should probably land regardless the decision on merging this PR). ## Test Plan This PR depends on #13445. To test this PR, you can do the following: *assuming mypy checkout with both PRs applied, must be on Python 3.10(!)* ``` $ pip install pyodide-build $ pyodide build --exports pyinit backend-args --global-option=--use-mypyc ``` Note: you will get a warning about using `--global-option`, you can ignore it for now. I'm trying to find out why `--build-option` isn't working... Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
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.
Could you add the "keep in sync" comment to build-requirements.txt as well?
Have you tried adding cibw 2.10’s new config setting support? |
Thanks for the tip! When we use cibuildwheel, we get cibuildwheel to set the MYPY_USE_MYPYC env var. See: |
I kind of want to make sure the new feature works ;). Could it be tested in a PR? just (Also, pyproject.toml or other toml file static configuration support was added after |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
This will not work until python/mypy#13445 is merged.
Yeah, would be nice to have https://github.com/mypyc/mypy_mypyc-wheels use cibuildwheel's new configuration stuff. If you want to make a PR to that repo, I'll review it. Otherwise it might take me a little bit of time to get to this :-) |
Description
This is part one of 2 PRs which enable building wheels for WebAssembly, specifically using
pyodide build
. That tool just wrapsbuild
which is a PEP 517 package builder.This allows you to use
build
orpip
and pass--use-mypyc
so the wheel is built with compiled mypy.Test Plan
Examples of how to test this:
(The way to parse the above, for the curious,
--config-settings
is a pip argument,--build-option
goes to setuptools...)The downside of this PR is that we have to move things from
build-requirements.txt
topyproject.toml
, but I don't think that is an issue? A few extra packages (that are all small) shouldn't be a big problem.