Skip to content

Adopt pyproject.toml and Meson to build Python extension #148

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hongquan
Copy link

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.

@hongquan hongquan mentioned this pull request Jun 30, 2025
@hongquan hongquan force-pushed the feature/meson-build-step-1 branch from 1605b3c to 31b17c0 Compare June 30, 2025 11:58
@hongquan
Copy link
Author

hongquan commented Jul 4, 2025

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

@behrmann
Copy link
Contributor

behrmann commented Jul 9, 2025

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

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

Sign up for free to 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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy