Adopt pyproject.toml and Meson to build Python extension#148
Merged
keszybz merged 2 commits intosystemd:mainfrom Oct 3, 2025
Merged
Adopt pyproject.toml and Meson to build Python extension#148keszybz merged 2 commits intosystemd:mainfrom
keszybz merged 2 commits intosystemd:mainfrom
Conversation
Closed
1605b3c to
31b17c0
Compare
behrmann
reviewed
Jun 30, 2025
Contributor
Author
|
Hi, what more I need to do to get this PR merged? |
Contributor
Just for somebody to find the time to review it again. |
Closed
Contributor
Author
|
Please allocate some time for this PR. |
behrmann
approved these changes
Oct 3, 2025
Contributor
|
@hongquan Thanks for your contribution (and patience). |
|
This looks great! Hopefully there'll be a new release cut and deployed to PyPi with this PR now merged so the PyPi project has a project description (readme) |
Contributor
|
A new release is planned after the current PR are addressed. |
|
@behrmann Any planned release upcoming? I'm hitting the same issue trying to install this package using UV on non-linux dev machines. I think the next release that includes this merged PR will solve the problem |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I have a Django web project, which targets Linux server but some team members use MacOS for development. We use
uvas Python package manager. In the "dependency resolution" phase,uvtried to findsystemd-pythonmetadata but couldn't get what it wanted from the setup.py file. It had to buildsystemd-pythonwheel to get the metadata, then failed on MacOS machines.What this PR does
Adopt new pyproject.toml file, in place of setup.py. For building C code, I adopt Meson, which has meson-python as a build backend so that
pipor any other modern Python package manager can know how to build the C-based extensions.Because this new build process is done in an isolated environment and leave no *.so files, the Makefile is also updated to work with this new build method.
This is the rework of #147, but split to smaller steps.
At this step, I only make these 4 jobs work:
I don't move the other jobs from Makefile to Meson.
I also move the "systemd" folder (containing C & Py sources) to
srcfolder, to prevent importing by accident when standing at the top-level folder. This is also a common practice for many other Python projects.