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

add support for cpython-mingw #4

Merged
merged 2 commits into from
Feb 24, 2022
Merged

add support for cpython-mingw #4

merged 2 commits into from
Feb 24, 2022

Conversation

mhkline
Copy link
Contributor

@mhkline mhkline commented Feb 15, 2022

I'm adding support for cpython-mingw since there was no wheel available in PyPI. According to the MSYS2 doc:

C extensions are not compatible with the official CPython, which means pip can't use binary wheels from PyPI and packages have to be build when installing them.

The source build did not work in mingw because it wasn't expecting to use gcc from a windows environment.

There is one ugly hack due to cpython-mingw butchering the path names in a windows-posix conversion. This is only necessary if building from a mingw shell using os.name=nt python. If using os.name=posix python (like that installed by MSYS2 with pacman -S python), the hack is unnecessary (and also won't be applied).

@flit
Copy link
Member

flit commented Feb 21, 2022

Thank you! 🙏🏽

Do you know how/if wheels for mingw can be built with cibuildwheel? I'd like to be able to release mingw wheels straight from CI.

@mhkline
Copy link
Contributor Author

mhkline commented Feb 22, 2022

You're welcome!

Do you know how/if wheels for mingw can be built with cibuildwheel? I'd like to be able to release mingw wheels straight from CI.

I've never used cibuildwheel before, but I did take a quick look. It's not obvious that mingw_x86_64 is a supported platform.

I think in order to build a compatible wheel for mingw64, you need an environment with cpython-mingw, gcc, etc. I don't know the exact capabilities of cibuildwheel. Maybe it's possible to specify some custom dependencies or a docker container?

@flit
Copy link
Member

flit commented Feb 22, 2022

pypa/cibuildwheel#459 might have some useful hints?

Doesn't look like you can specify a docker image for Windows builds with cibuildwheel.

Anyway, for now at least building at install time will work for mingw. 😄

@flit
Copy link
Member

flit commented Feb 22, 2022

Just noticed: could you please add you copyright to the top of setup.py?

@mhkline
Copy link
Contributor Author

mhkline commented Feb 22, 2022

Added my copyright notice. Honestly not sure how this is normally done, but hopefully this is ok.

pypa/cibuildwheel#459 might have some useful hints?

Good find. Maybe when I have a minute I can try to understand what's going on there.

@flit
Copy link
Member

flit commented Feb 22, 2022

Your copyright looks perfect. Thanks for adding. 😄

@flit flit merged commit f7e3868 into pyocd:main Feb 24, 2022
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.

2 participants