Skip to content

Commit c6e3143

Browse files
committed
Convert tasks from Makefile to Meson
1 parent 58bad8c commit c6e3143

File tree

4 files changed

+1611
-9
lines changed

4 files changed

+1611
-9
lines changed

MANIFEST.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

meson.build

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,72 @@ python.install_sources(
9898
'systemd/test/test_id128.py',
9999
subdir: 'systemd/test',
100100
)
101+
102+
# Run target to generate TAGS file for Emacs
103+
run_target(
104+
'etags',
105+
command: ['etags', '-R', '@SOURCE_ROOT@/systemd'],
106+
)
107+
108+
# Use 'uv run' to ensure Sphinx and its dependencies are installed before being run.
109+
uv_prog = find_program('uv')
110+
111+
# The '--no-editable' option tells uv to install the systemd package so that Sphinx can import it and extract docstrings.
112+
run_target(
113+
'doc',
114+
command: [
115+
uv_prog,
116+
'run',
117+
'--group', 'docs',
118+
'--no-editable',
119+
'-m', 'sphinx',
120+
'-b', 'html',
121+
'-D', 'version=' + meson.project_version(),
122+
'-D', 'release=' + meson.project_version(),
123+
'@SOURCE_ROOT@/docs',
124+
'html',
125+
],
126+
)
127+
128+
# The '--no-editable' option tells uv to install the systemd package so tests can import it.
129+
test(
130+
'pytest',
131+
uv_prog,
132+
args: [
133+
'run',
134+
'--group', 'test',
135+
'--no-editable',
136+
'-m', 'pytest',
137+
'../systemd/test',
138+
],
139+
workdir: meson.project_build_root(),
140+
)
141+
142+
# Sync built HTML docs to the remote server using rsync.
143+
run_target(
144+
'doc-sync',
145+
command: [
146+
'rsync',
147+
'-rlv',
148+
'--delete',
149+
'--omit-dir-times', 'html/',
150+
'www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/python-systemd/',
151+
],
152+
)
153+
154+
# Upload distribution tarball and signature using twine-3.
155+
version = meson.project_version()
156+
archive = 'dist/systemd-python-' + version + '.tar.gz'
157+
signature_filename = 'systemd-python-' + version + '.tar.gz.asc'
158+
159+
# Run target to sign the distribution tarball using GPG.
160+
run_target(
161+
'sign',
162+
command: ['gpg', '--detach-sign', '-a', archive],
163+
)
164+
165+
# NOTE: Run 'sign' target before 'upload' to ensure the signature file exists.
166+
run_target(
167+
'upload',
168+
command: ['uvx', 'twine', 'upload', archive, signature_filename],
169+
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ build-backend = "mesonpy"
4646

4747
[tool.coverage.run]
4848
source = ["systemd"]
49-
omit = ["systemd/test/*", "setup.py"]
49+
omit = ["systemd/test/*"]
5050

5151
[tool.coverage.report]
5252
exclude_lines = [

0 commit comments

Comments
 (0)