Skip to content

Commit e47decb

Browse files
committed
improve travis fold status reporting; fix sphinx build; fix sphinx errors
1 parent 47a9d14 commit e47decb

7 files changed

Lines changed: 41 additions & 22 deletions

File tree

.travis.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ before_script:
7474
- sudo apt-get install -y python3-pip
7575
- pip3 install --user sh click
7676
- ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls)
77-
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user 'Sphinx<1.8.0' sphinx-rtd-theme recommonmark)
77+
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user 'Sphinx<1.8.0' sphinx-rtd-theme 'recommonmark<0.5.0')
7878
- (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib)
7979

8080
# report some good version numbers to the build
@@ -86,46 +86,46 @@ before_script:
8686
script:
8787
# Build mpy-cross first because other builds depend on it.
8888
- echo 'Building mpy-cross' && echo 'travis_fold:start:mpy-cross'
89-
- make -C mpy-cross -j2 ; echo status $? > status
90-
- echo 'travis_fold:end:mpy-cross' && cat status
89+
- make -C mpy-cross -j2 ; echo $? > status
90+
- echo 'travis_fold:end:mpy-cross' && tools/print_status.py status
9191

9292
# Use unbuffered output because building all the releases can take a long time.
9393
# Travis will cancel the job if it sees no output for >10 minutes.
9494
- cd tools && python3 -u build_release_files.py
9595
- cd ..
9696

9797
- echo 'Building unix' && echo 'travis_fold:start:unix'
98-
- (! var_search "${TRAVIS_TESTS-}" unix || (make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; echo status $? > status
99-
- echo 'travis_fold:end:unix' && cat status
98+
- (! var_search "${TRAVIS_TESTS-}" unix || (make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; echo $? > status
99+
- echo 'travis_fold:end:unix' && tools/print_status.py status
100100

101101
# run tests without coverage info
102102
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests -j1)
103103
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests -j1 --emit native)
104104

105105
# run tests with coverage info
106106
- echo 'Test all' && echo 'travis_fold:start:test_all'
107-
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1)) ; echo status $? > status
108-
- echo 'travis_fold:end:test_all' && cat status
107+
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1)) ; echo $? > status
108+
- echo 'travis_fold:end:test_all' && tools/print_status.py status
109109

110110
- echo 'Test threads' && echo 'travis_fold:start:test_threads'
111-
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 -d thread)) ; echo status $? >status
112-
- echo 'travis_fold:end:test_threads' && cat status
111+
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 -d thread)) ; echo $? >status
112+
- echo 'travis_fold:end:test_threads' && tools/print_status.py status
113113

114114
- echo 'Testing with native' && echo 'travis_fold:start:test_native'
115-
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native)) ; echo status $? >status
116-
- echo 'travis_fold:end:test_native' && cat status
115+
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native)) ; echo $? >status
116+
- echo 'travis_fold:end:test_native' && tools/print_status.py status
117117

118118
- (echo 'Testing with mpy' && echo 'travis_fold:start:test_mpy')
119119
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float)) ; echo "Testing with mpy status: $?" >status
120-
- echo 'travis_fold:end:test_mpy' && cat status
120+
- echo 'travis_fold:end:test_mpy' && tools/print_status.py status
121121

122122
- (echo 'Building docs' && echo 'travis_fold:start:build_docs')
123-
- (! var_search "${TRAVIS_TESTS-}" docs || sphinx-build -E -W -b html . _build/html) ; echo status $? >status
124-
- echo 'travis_fold:end:build_docs' && cat status
123+
- (! var_search "${TRAVIS_TESTS-}" docs || sphinx-build -E -W -b html . _build/html) ; echo $? >status
124+
- echo 'travis_fold:end:build_docs' && tools/print_status.py status
125125

126126
- (echo 'Building translations' && echo 'travis_fold:start:build_translations')
127-
- (! var_search "${TRAVIS_TESTS-}" translations || make check-translate) ; echo status $? >status
128-
- echo 'travis_fold:end:build_translations' && cat status
127+
- (! var_search "${TRAVIS_TESTS-}" translations || make check-translate) ; echo $? >status
128+
- echo 'travis_fold:end:build_translations' && tools/print_status.py status
129129

130130
# run coveralls coverage analysis (try to, even if some builds/tests failed)
131131
#- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Behavior
157157
API
158158
~~~
159159

160-
- Unified hardware APIs: `audioio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/audioio/__init__.html>`_, `analogio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/analogio/__init__.html>`_, `busio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/__init__.html>`_, `digitalio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/digitalio/__init__.html>`_, `pulseio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html>`_, `touchio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/__init__.html>`_, `microcontroller <https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/__init__.html>`_, `board <https://circuitpython.readthedocs.io/en/latest/shared-bindings/board/__init__.html>`_, `bitbangio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitbangio/__init__.html>`_
160+
- Unified hardware APIs: `audioio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/audioio/__init__.html>`_, `analogio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/analogio/__init__.html>`_, `bleio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bleio/__init__.html>`_, `busio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/__init__.html>`_, `digitalio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/digitalio/__init__.html>`_, `pulseio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html>`_, `touchio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/__init__.html>`_, `microcontroller <https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/__init__.html>`_, `board <https://circuitpython.readthedocs.io/en/latest/shared-bindings/board/__init__.html>`_, `bitbangio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitbangio/__init__.html>`_
161161
- No ``machine`` API on Atmel SAMD21 port.
162162

163163
Modules

shared-bindings/bleio/CharacteristicBuffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
//|
4343
//| :param bleio.Characteristic characteristic: The characteristic to monitor
4444
//| :param int buffer_size: Size of ring buffer that stores incoming data coming from client.
45-
//| Must be >= 1.
45+
//| Must be >= 1.
46+
//|
4647
STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
4748
mp_arg_check_num(n_args, n_kw, 1, 2, true);
4849
bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t);

shared-bindings/bleio/Device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
//| When a device is created without any parameter passed to the constructor,
5353
//| it will be set to the Peripheral role. If a address is passed, the device
5454
//| will be a Central. For a Peripheral you can set the `name`, add services
55-
//| via `add_service` and then start and stop advertising via `start_advertising`
56-
//| and `stop_advertising`. For the Central, you can `bleio.Device.connect` and `bleio.Device.disconnect`
55+
//| via `add_service` and then start and stop advertising via `bleio.Device.start_advertising`
56+
//| and `bleio.Device.stop_advertising`. For the Central, you can `bleio.Device.connect` and `bleio.Device.disconnect`
5757
//| to the device, once a connection is established, the device's services can
58-
//| be accessed using `services`.
58+
//| be accessed using `bleio.Device.services`.
5959
//|
6060
//| Usage::
6161
//|

shared-bindings/bleio/UUID.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//| - a buffer object (bytearray, bytes) of 16 bytes in little-endian order (128-bit UUID)
5151
//|
5252
//| :param int/buffer value: The uuid value to encapsulate
53-
53+
//|
5454
STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
5555
mp_arg_check_num(n_args, n_kw, 1, 1, false);
5656

shared-bindings/bleio/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@
5757
//| AddressType
5858
//| AdvertisementData
5959
//| Adapter
60+
//| Broadcaster
6061
//| Characteristic
62+
//| CharacteristicBuffer
6163
//| Descriptor
6264
//| Device
65+
//| Peripheral
6366
//| ScanEntry
6467
//| Scanner
6568
//| Service

tools/print_status.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
if len(sys.argv) != 2:
5+
print("""\
6+
Usage: print_status.py STATUS_FILENAME
7+
STATUS_FILENAME contains one line with an integer status."""
8+
)
9+
sys.exit(1)
10+
with open(sys.argv[1], 'r') as status_in:
11+
status = int(status_in.readline())
12+
13+
print('{} with status {}'.format(
14+
"\033[32msucceeded\033[0m" if status == 0 else "\033[31mfailed\033[0m",
15+
status))

0 commit comments

Comments
 (0)