Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

69 changes: 69 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,72 @@ python.install_sources(
'systemd/test/test_id128.py',
subdir: 'systemd/test',
)

# Run target to generate TAGS file for Emacs
run_target(
'etags',
command: ['etags', '-R', '@SOURCE_ROOT@/systemd'],
Copy link
Member

Choose a reason for hiding this comment

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

The docs don't make this super clear, but I think @SOURCE_ROOT@ shouldn't be used. The docs do say that meson.source_root() is deprecated and meson.project_source_root()/meson.project_global_root() should be used instead. But what @SOURCE_ROOT@ is set to is not clearly documented. I think it is set to meson.source_root(), i.e. meson.global_source_root(). So meson.project_source_root() should be used here too, like below.

)

# Use 'uv run' to ensure Sphinx and its dependencies are installed before being run.
uv_prog = find_program('uv')
Copy link
Member

Choose a reason for hiding this comment

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

I don't agree with the premise that uv should be required to build the docs. meson by itself provides a build system, and calling things directly through meson is going to be superior to wrapping them through a python-specific tool. If the user tries to build the docs, and this fails because sphinx is not installed, that's is great. We only need a clear error message.


# The '--no-editable' option tells uv to install the systemd package so that Sphinx can import it and extract docstrings.
run_target(
'doc',
command: [
uv_prog,
'run',
'--group', 'docs',
'--no-editable',
'-m', 'sphinx',
'-b', 'html',
'-D', 'version=' + meson.project_version(),
'-D', 'release=' + meson.project_version(),
Comment on lines +53 to +54
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be the same string?

'@SOURCE_ROOT@/docs',
'html',
],
)

# The '--no-editable' option tells uv to install the systemd package so tests can import it.
test(
'pytest',
uv_prog,
args: [
'run',
'--group', 'test',
'--no-editable',
'-m', 'pytest',
'../systemd/test',
],
workdir: meson.project_build_root(),
)

# Sync built HTML docs to the remote server using rsync.
run_target(
'doc-sync',
command: [
'rsync',
'-rlv',
'--delete',
'--omit-dir-times', 'html/',
'www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd/',
],
)

# Upload distribution tarball and signature using twine-3.
version = meson.project_version()
archive = 'dist/systemd-python-' + version + '.tar.gz'
signature_filename = 'systemd-python-' + version + '.tar.gz.asc'

# Run target to sign the distribution tarball using GPG.
run_target(
'sign',
command: ['gpg', '--detach-sign', '-a', archive],
)

# NOTE: Run 'sign' target before 'upload' to ensure the signature file exists.
run_target(
'upload',
command: ['uvx', 'twine', 'upload', archive, signature_filename],
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ build-backend = "mesonpy"

[tool.coverage.run]
source = ["systemd"]
omit = ["systemd/test/*", "setup.py"]
omit = ["systemd/test/*"]

[tool.coverage.report]
exclude_lines = [
Expand Down
Loading