@@ -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+ )
0 commit comments