Modern Python packaging#147
Conversation
behrmann
left a comment
There was a problem hiding this comment.
This is a very nice change! I gave it a quick go and it builds and works nicely.
Sorry, something went wrong.
|
Converted Makefile to Meson run targets. It requires me to introduce |
Sorry, something went wrong.
fcaab8e to
af80340
Compare
June 26, 2025 09:04
No longer wrap, because it creates circular reference: If we build the project with |
Sorry, something went wrong.
|
@behrmann I moved Makefile jobs to Meson "run target". It turns out to be not convenient for developers, because:
|
Sorry, something went wrong.
|
Sorry for the slow turnaround, but busy with other stuff
I've not run into this myself before, but looking at the systemd env = find_program('env')
# …
run_target(
'ctags',
command : [env, 'ctags', '--tag-relative=never', '-o', '@0@/tags'.format(meson.project_source_root())] + all_files)
)
I'm not quite sure I understand this, but I assume you are saying that you include meson in a |
Sorry, something went wrong.
|
@behrmann That "wrapping with |
Sorry, something went wrong.
keszybz
left a comment
There was a problem hiding this comment.
Thank you for working on this. I really like the idea of using meson / python-meson and modernizing the build infrastructure. Nevertheless, this series cannot be merged as is, because it does a lot of unrelated and unexplained changes. I see that you did a lot exploratory work, which is great, but in the end we need "finished" patches that do one thing at a time.
Some things to avoid:
- having whitespace formatting changes in the middle of the series. If you're adding new files, then add the format definitions first, and then add new files second.
- lock files. Committing lock files to git doesn't make sense.
- doing too many things in a single commit and not having any descriptions on the commits.
- adding some lines and then doing unexpected changes to them later. E.g. in one of the first patches you add some meson config, and then change the order in the file in a later patch. Or you introduce a command with
etagsfirst, and change that toctagslater. This creates noise in the diff and confusion in the reviewer.
As mentioned below, I think the attempt to provide tight integration with uv makes things unnecessarily complicated. Let's make things work with meson first, so that the project can be nicely built locally. We can than work on integration with wrappers like uv separately.
Sorry, something went wrong.
|
Thanks for commenting, @keszybz . I'm willing to redo this. Do we need to split to smaller PRs? |
Sorry, something went wrong.
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 new build way.