Skip to content

Conversation

@hongquan
Copy link
Contributor

Motivation

I have a Django web project, which targets Linux server but some team members use MacOS for development. We use uv as Python package manager. In the "dependency resolution" phase, uv tried to find systemd-python metadata but couldn't get what it wanted from the setup.py file. It had to build systemd-python wheel 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 pip or 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:

  • Building project.
  • Install project.
  • Generate docs.
  • Running test.

I don't move the other jobs from Makefile to Meson.

I also move the "systemd" folder (containing C & Py sources) to src folder, to prevent importing by accident when standing at the top-level folder. This is also a common practice for many other Python projects.

@hongquanhongquan mentioned this pull request Jun 30, 2025
@hongquanhongquanforce-pushed the feature/meson-build-step-1 branch from 1605b3c to 31b17c0CompareJune 30, 2025 11:58
@hongquan
Copy link
ContributorAuthor

Hi, what more I need to do to get this PR merged?

@behrmann
Copy link
Contributor

Hi, what more I need to do to get this PR merged?

Just for somebody to find the time to review it again.

@hongquanhongquan mentioned this pull request Aug 11, 2025
@hongquan
Copy link
ContributorAuthor

Please allocate some time for this PR.

@keszybzkeszybz merged commit b0acce4 into systemd:mainOct 3, 2025
17 checks passed
@behrmann
Copy link
Contributor

@hongquan Thanks for your contribution (and patience).

@gene1wood
Copy link

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)

@behrmann
Copy link
Contributor

A new release is planned after the current PR are addressed.

@EVWorth
Copy link

@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

@behrmann
Copy link
Contributor

@EVWorth We started prepping a release in #165 and a release should come soon, but other work is currently higher on the todo list, e.g. systemd cut v259-rc1 yesterday.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@hongquan@behrmann@gene1wood@EVWorth@keszybz