Skip to content

Commit 5880155

Browse files
committed
doc: adapt RTD for direct sphinx-build instead of setuptools
1 parent 820094f commit 5880155

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

.readthedocs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ build:
44
os: "ubuntu-22.04"
55
tools:
66
python: "3.10"
7+
jobs:
8+
pre_build:
9+
- 'sudo apt update'
10+
- 'sudo apt install meson'
11+
build:
12+
html:
13+
- 'meson setup build_dir -Dreadthedocs_build=true -Dinit_system=systemd'
14+
- 'meson compile -C build_dir'
15+
- 'python3 -m sphinx -T -b html -d doc/rtd -D language=en . $READTHEDOCS_OUTPUT/html'
716

17+
18+
sphinx:
19+
configuration: doc/rtd/conf.py
820
formats: all
921

1022
python:

doc-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
-r requirements.txt
22
doc8
33
furo
4+
meson
45
m2r2
56
pyyaml
6-
setuptools
77
sphinx==7.1.2
88
sphinx-design
99
sphinx-copybutton

meson.build

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,10 @@ project(
77
'python.install_env=auto'
88
]
99
)
10-
completions = dependency('bash-completion')
11-
systemd = dependency('systemd')
1210
system = host_machine.system()
1311
sysconfdir = get_option('sysconfdir')
1412
INIT_SYSTEM = get_option('init_system')
15-
VALID_INIT_SYSTEMS = [
16-
'systemd', 'sysvinit', 'sysvinit_deb', 'sysvinit_dragonfly',
17-
'sysvinit_freebsd', 'sysvinit_netbsd', 'sysvinit_openbsd'
18-
]
13+
VALID_INIT_SYSTEMS = ['systemd']
1914
if not VALID_INIT_SYSTEMS.contains(INIT_SYSTEM)
2015
error(
2116
'Invalid init_system supplied: "@0@". Must be one of: @1@'.format(
@@ -24,6 +19,7 @@ if not VALID_INIT_SYSTEMS.contains(INIT_SYSTEM)
2419
endif
2520

2621

22+
2723
lib_exec_dir = join_paths('/usr', get_option('libexecdir'), 'cloud-init')
2824

2925
pymod = import('python')
@@ -39,14 +35,19 @@ install_subdir(
3935
)
4036

4137
# Binaries and script entrypoints
42-
bash_completions_dir = completions.get_variable(
43-
pkgconfig: 'completionsdir',
44-
default_value: '/etc/bash_completion.d'
45-
)
46-
install_data(
47-
'bash_completion/cloud-init',
48-
install_dir: bash_completions_dir, install_tag: 'scripts'
49-
)
38+
readthedocs = get_option('readthedocs_build')
39+
if not readthedocs
40+
completions = dependency('bash-completion')
41+
bash_completions_dir = completions.get_variable(
42+
pkgconfig: 'completionsdir',
43+
default_value: '/etc/bash_completion.d'
44+
)
45+
install_data(
46+
'bash_completion/cloud-init',
47+
install_dir: bash_completions_dir,
48+
install_tag: 'scripts'
49+
)
50+
endif
5051

5152
install_data(
5253
['tools/ds-identify', 'tools/hook-hotplug','tools/uncloud-init', 'tools/write-ssh-key-fingerprints' ],
@@ -81,6 +82,7 @@ install_data(
8182
)
8283

8384
if INIT_SYSTEM == 'systemd'
85+
systemd = dependency('systemd')
8486
udev = dependency('udev')
8587
systemd_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
8688
systemd_generator_dir = systemd.get_variable(

0 commit comments

Comments
 (0)