Skip to content

Commit 91ebadd

Browse files
committed
Fix meson.build after moving source
1 parent 3a4e663 commit 91ebadd

File tree

8 files changed

+42
-9
lines changed

8 files changed

+42
-9
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
- name: Build (Python ${{ matrix.python }})
6060
run: |
6161
set -x
62-
uv build -C build-dir=_build
62+
uv build
63+
uv sync --no-editable
6364
cd _build
6465
uv run --no-editable --group docs -m sphinx -b html -W -v ../docs html

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# serve to show the default.
1313

1414
import sys, os
15+
print(sys.path)
16+
import systemd
1517

1618
# If extensions (or modules to document with autodoc) are in another directory,
1719
# add these directories to sys.path here. If the directory is relative to the

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ common_c_args = [
3232
'-DLIBSYSTEMD_VERSION=' + libsystemd_dep.version(),
3333
]
3434

35-
subdir('src/systemd')
35+
subdir('src')
3636

3737
run_target(
3838
'update-constants',

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,24 @@ Documentation = "https://www.freedesktop.org/software/systemd/python-systemd/"
3939
[dependency-groups]
4040
test = ["pytest", "pytest-cov"]
4141
docs = ["sphinx"]
42+
build = [
43+
"meson>=1.8.2",
44+
]
4245

4346
[build-system]
4447
requires = ["meson-python", "ninja", "meson"]
4548
build-backend = "mesonpy"
4649

50+
[tool.uv]
51+
package = true
52+
53+
[tool.uv.config-settings]
54+
build-dir = "_build"
55+
56+
[tool.uv.build-backend]
57+
module-name = "systemd"
58+
module-root = "src"
59+
4760
[tool.coverage.run]
4861
source = ["systemd"]
4962
omit = ["systemd/test/*"]

src/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
subdir('systemd')

src/systemd/meson.build

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ python.extension_module(
55
dependencies: [libsystemd_dep],
66
c_args: common_c_args,
77
install: true,
8+
subdir: 'systemd',
89
)
910

1011
# Build _reader extension module
@@ -14,6 +15,7 @@ python.extension_module(
1415
dependencies: [libsystemd_dep],
1516
c_args: common_c_args,
1617
install: true,
18+
subdir: 'systemd',
1719
)
1820

1921
# Build _daemon extension module
@@ -23,6 +25,7 @@ python.extension_module(
2325
dependencies: [libsystemd_dep],
2426
c_args: common_c_args,
2527
install: true,
28+
subdir: 'systemd',
2629
)
2730

2831
# Build id128 extension module
@@ -32,6 +35,7 @@ python.extension_module(
3235
dependencies: [libsystemd_dep],
3336
c_args: common_c_args,
3437
install: true,
38+
subdir: 'systemd',
3539
)
3640

3741
# Build login extension module
@@ -41,20 +45,17 @@ python.extension_module(
4145
dependencies: [libsystemd_dep],
4246
c_args: common_c_args,
4347
install: true,
48+
subdir: 'systemd',
4449
)
4550

4651
# Install Python modules (matching py_modules in setup.py)
47-
python.install_sources(
48-
'__init__.py',
49-
'journal.py',
50-
'daemon.py',
51-
)
52+
python.install_sources('__init__.py', 'journal.py', 'daemon.py', subdir: 'systemd')
5253

5354
# Install test modules
5455
python.install_sources(
5556
'test/test_daemon.py',
5657
'test/test_journal.py',
5758
'test/test_login.py',
5859
'test/test_id128.py',
59-
subdir: 'test',
60+
subdir: 'systemd/test',
6061
)

update-constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#/usr/bin/env python3
2+
13
"""
24
Read definitions from /usr/include/systemd/sd-messages.h and systemd/id128-defines.h files, convert to ones in systemd/id128-constants.h
35
"""

uv.lock

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)