Skip to content

Commit b5d687b

Browse files
committed
fix doc build issues; improve doc build error reporting
1 parent 2cf5f37 commit b5d687b

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from sphinx.transforms import SphinxTransform
3131
from docutils import nodes
3232
from sphinx import addnodes
33+
from sphinx.errors import ConfigError
3334
from sphinx.ext import intersphinx
3435

3536
# If extensions (or modules to document with autodoc) are in another directory,
@@ -46,7 +47,12 @@
4647
# in 'shared-bindings/index.rst'
4748

4849
# The stubs must be built before we calculate the shared bindings matrix
49-
subprocess.check_output(["make", "stubs"])
50+
make_stubs = subprocess.run(["make", "stubs"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
51+
if make_stubs.returncode != 0:
52+
print("'ERROR: make stubs' failed with output:", file=sys.stderr)
53+
print(make_stubs.stdout.decode("utf-8"))
54+
raise ConfigError("'make stubs' failed in conf.py")
55+
5056

5157
# modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
5258
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
@@ -164,7 +170,7 @@ def autoapi_prepare_jinja_env(jinja_env):
164170
if git_version:
165171
final_version = git_version[0]
166172
else:
167-
print("Failed to retrieve git version:", git_describe.stdout)
173+
print("Failed to retrieve git version:", git_describe.stdout, file=sys.stderr)
168174

169175
version = release = final_version
170176

shared-bindings/audiofreeverb/Freeverb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static mp_obj_t audiofreeverb_freeverb_make_new(const mp_obj_type_t *type, size_
9090
if (args[ARG_samples_signed].u_bool != true) {
9191
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q must be %q"), MP_QSTR_samples_signed, MP_QSTR_true);
9292
}
93-
mp_int_t bits_per_sample = mp_arg_validate_int(args[ARG_bits_per_sample].u_int, 16);
93+
mp_int_t bits_per_sample = mp_arg_validate_int(args[ARG_bits_per_sample].u_int, 16, MP_QSTR_bits_per_sample);
9494

9595
audiofreeverb_freeverb_obj_t *self = mp_obj_malloc(audiofreeverb_freeverb_obj_t, &audiofreeverb_freeverb_type);
9696
common_hal_audiofreeverb_freeverb_construct(self, args[ARG_roomsize].u_obj, args[ARG_damp].u_obj, args[ARG_mix].u_obj, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate);

shared-bindings/usb/util/__init__.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
//| This is a subset of the PyUSB util module.
2121
//| """
2222
//|
23-
//| SPEED_LOW: int = ...
23+
//| SPEED_LOW: int
2424
//| """A low speed, 1.5 Mbit/s device."""
2525
//|
26-
//| SPEED_FULL: int = ...
26+
//| SPEED_FULL: int
2727
//| """A full speed, 12 Mbit/s device."""
2828
//|
29-
//| SPEED_HIGH: int = ...
29+
//| SPEED_HIGH: int
3030
//| """A high speed, 480 Mbit/s device."""
3131
//|
3232

shared-bindings/wifi/Radio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ static void validate_hex_password(const uint8_t *buf, size_t len) {
6868
//|
6969
//| This class manages the station and access point functionality of the native
7070
//| Wifi radio.
71-
//|
7271
//| """
7372
//|
7473

@@ -95,6 +94,8 @@ static void validate_hex_password(const uint8_t *buf, size_t len) {
9594
//| :param digitalio.DigitalInOut reset: Reset pin
9695
//| :param digitalio.DigitalInOut gpio0: Optional GPIO0 pin for boot mode control
9796
//| """
97+
//| ...
98+
//|
9899
static mp_obj_t wifi_radio_init_airlift(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
99100
#if CIRCUITPY_WIFI_AIRLIFT
100101
enum { ARG_spi, ARG_cs, ARG_ready, ARG_reset, ARG_gpio0, };
@@ -165,7 +166,7 @@ static void check_for_deinit(wifi_radio_obj_t *self) {
165166
//| def __exit__(self) -> None:
166167
//| """Automatically deinitializes the hardware when exiting a context. See
167168
//| :ref:`lifetime-and-contextmanagers` for more info.
168-
//| Only useful on boards that support AirLift `wifi`."""
169+
//| Only useful on boards that support AirLift `wifi`.
169170
//| """
170171
//| ...
171172
//|
@@ -605,7 +606,6 @@ MP_PROPERTY_GETTER(wifi_radio_ap_active_obj,
605606
//| **Limitations**: On AirLift, ``channel`` is ignored.
606607
//| On AirLift and on raspberrypi CYW43, ``bssid` is not implemented.
607608
//| On AirLift and on raspberrypi CYW43, ``timeout`` is 8 seconds if set to ``None`` or 0.
608-
//|
609609
//| """
610610
//| ...
611611
//|

0 commit comments

Comments
 (0)