Skip to content

cicd: mypyc#29

Merged
madebr merged 1 commit intomadebr:masterfrom
romintomasetti:mypyc
Mar 26, 2026
Merged

cicd: mypyc#29
madebr merged 1 commit intomadebr:masterfrom
romintomasetti:mypyc

Conversation

@romintomasetti
Copy link
Copy Markdown
Contributor

@romintomasetti romintomasetti commented Mar 24, 2026

The goal of this PR is to add mypyc to speedup things "for free".

I had to change a bit the CMakeApiType protocol because mypyc does not like class variables in a dataclass:

@romintomasetti romintomasetti force-pushed the mypyc branch 6 times, most recently from c42f209 to a6be7b5 Compare March 26, 2026 11:29
@romintomasetti romintomasetti marked this pull request as ready for review March 26, 2026 11:31
@romintomasetti
Copy link
Copy Markdown
Contributor Author

@madebr Could you please have a look?

@romintomasetti romintomasetti force-pushed the mypyc branch 3 times, most recently from 9a81bee to ca42950 Compare March 26, 2026 11:41
Signed-off-by: romintomasetti <romin.tomasetti@gmail.com>
Copy link
Copy Markdown
Owner

@madebr madebr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks super! Thank you very much!

What kind of speed-up are you talking about with a project using cmake-file-api?

@madebr madebr merged commit 9bc2a55 into madebr:master Mar 26, 2026
22 checks passed
@romintomasetti romintomasetti deleted the mypyc branch March 26, 2026 17:04
@romintomasetti
Copy link
Copy Markdown
Contributor Author

I haven't made any measurement but I expect that:

will benefit. We use cmake_file_api quite extensively in the tests.

@romintomasetti
Copy link
Copy Markdown
Contributor Author

romintomasetti commented Mar 26, 2026

@madebr If you make a release, we'll be able to test if it behaves well in https://www.github.com/uliegecsm/reprospect 😉

@madebr
Copy link
Copy Markdown
Owner

madebr commented Mar 26, 2026

@madebr If you make a release, we'll be able to test if it behaves well in https://www.github.com/uliegecsm/reprospect 😉

I think the current release process is not correct and should be changed: it's failing.
It currently builds a source and binary wheel (sdist bdist_wheel).
mypyc causes the binary wheel to contain platform- and python version specific binaries, whereas before it was platform agnostic (aka plain python sources).

What do you suggest to do?

romintomasetti added a commit to romintomasetti/python-cmake-file-api that referenced this pull request Mar 26, 2026
@romintomasetti
Copy link
Copy Markdown
Contributor Author

I think it is fine to have many wheels. It will be handled nicely if I remember well...

I suggest to install the dev requirements, see #32 😉

@madebr
Copy link
Copy Markdown
Owner

madebr commented Mar 26, 2026

I think it is fine to have many wheels. It will be handled nicely if I remember well...

I suggest to install the dev requirements, see #32 😉

Haha, yes, that's a requirement I was missing :)
But running bdist_wheel on my dev machine, dist/cmake_file_api-0.0.8.7-cp314-cp314-linux_x86_64.whl is created.
This means it won't run on macOS, Windows and other python versions.

madebr pushed a commit that referenced this pull request Mar 26, 2026
This is a followup for #29.
@romintomasetti
Copy link
Copy Markdown
Contributor Author

My understanding is that you are not breaking anything because it will also produce the source-based wheel that will be uploaded alongside any mypyc-based wheel on PyPi. And pip install will figure out which one to pick.

See for instance https://pypi.org/project/reprospect/#files. Along with the sources, there are different compiled versions.

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