Skip to content

Commit f0bb26d

Browse files
committed
Merge MicroPython 1.13 into CircuitPython
2 parents f5f18b2 + b0932fc commit f0bb26d

File tree

484 files changed

+13058
-5214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+13058
-5214
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,18 @@ jobs:
7171
run: make -C mpy-cross -j2
7272
- name: Build unix port
7373
run: |
74-
make -C ports/unix deplibs -j2
75-
make -C ports/unix -j2
76-
make -C ports/unix coverage -j2
74+
make -C ports/unix VARIANT=coverage -j2
7775
- name: Test all
78-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1
76+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-tests -j1
7977
working-directory: tests
80-
- name: Print failure info
81-
run: |
82-
shopt -s nullglob;
83-
for exp in *.exp;
84-
do testbase=$(basename $exp .exp);
85-
echo -e "\nFAILURE $testbase";
86-
diff -u $testbase.exp $testbase.out;
87-
done
88-
working-directory: tests
89-
if: failure()
9078
- name: Native Tests
91-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native
79+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-tests -j1 --emit native
9280
working-directory: tests
9381
- name: mpy Tests
94-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
82+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-tests -j1 --mpy-cross-flags='-mcache-lookup-bc' --via-mpy -d basics float micropython
83+
working-directory: tests
84+
- name: Native mpy Tests
85+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-tests -j1 --mpy-cross-flags='-mcache-lookup-bc' --via-mpy --emit native -d basics float micropython
9586
working-directory: tests
9687
- name: Build mpy-cross.static-raspbian
9788
run: make -C mpy-cross -j2 -f Makefile.static-raspbian

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ build-*/
3737

3838
# Test failure outputs
3939
######################
40-
tests/*.exp
41-
tests/*.out
40+
tests/results/*
4241

4342
# Python cache files
4443
######################

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2019 Damien P. George
3+
Copyright (c) 2013-2020 Damien P. George
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# You can set these variables from the command line.
99
PYTHON = python3
10-
SPHINXOPTS =
10+
SPHINXOPTS = -W --keep-going
1111
SPHINXBUILD = sphinx-build
1212
PAPER =
1313
# path to build the generated docs
@@ -223,7 +223,7 @@ pseudoxml:
223223
all-source:
224224

225225
locale/circuitpython.pot: all-source
226-
find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o - | sed -e '/"POT-Creation-Date: /d' > $@
226+
find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d' > $@
227227

228228
# Historically, `make translate` updated the .pot file and ran msgmerge.
229229
# However, this was a frequent source of merge conflicts. Weblate can perform
@@ -248,7 +248,7 @@ merge-translate:
248248

249249
.PHONY: check-translate
250250
check-translate:
251-
find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale
251+
find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate --keyword=MP_ERROR_TEXT -o circuitpython.pot.tmp -p locale
252252
$(PYTHON) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$?; rm -f locale/circuitpython.pot.tmp; exit $$status
253253

254254
stubs:

docs/design_guide.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ object instead of the pins themselves. This allows the calling code to provide
541541
any object with the appropriate methods such as an I2C expansion board.
542542

543543
Another example is to expect a :py:class:`~digitalio.DigitalInOut` for a pin to
544-
toggle instead of a :py:class:`~microcontroller.Pin` from `board`. Taking in the
545-
:py:class:`~microcontroller.Pin` object alone would limit the driver to pins on
546-
the actual microcontroller instead of pins provided by another driver such as an
547-
IO expander.
544+
toggle instead of a :py:class:`~microcontroller.Pin` from :py:mod:`board`.
545+
Taking in the :py:class:`~microcontroller.Pin` object alone would limit the
546+
driver to pins on the actual microcontroller instead of pins provided by another
547+
driver such as an IO expander.
548548

549549
Lots of small modules
550550
--------------------------------------------------------------------------------

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Full Table of Contents
3636
:caption: MicroPython specific
3737

3838
library/index.rst
39+
reference/glossary.rst
3940

4041
.. toctree::
4142
:maxdepth: 1

docs/library/btree.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Example::
7878
Functions
7979
---------
8080

81-
.. function:: open(stream, \*, flags=0, pagesize=0, cachesize=0, minkeypage=0)
81+
.. function:: open(stream, *, flags=0, pagesize=0, cachesize=0, minkeypage=0)
8282

8383
Open a database from a random-access ``stream`` (like an open file). All
8484
other parameters are optional and keyword-only, and allow to tweak advanced
@@ -118,7 +118,7 @@ Methods
118118
Flush any data in cache to the underlying stream.
119119

120120
.. method:: btree.__getitem__(key)
121-
btree.get(key, default=None)
121+
btree.get(key, default=None, /)
122122
btree.__setitem__(key, val)
123123
btree.__detitem__(key)
124124
btree.__contains__(key)

docs/library/errno.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
:mod:`errno` -- system error codes
1+
:mod:`uerrno` -- system error codes
22
===================================
33

4-
.. module:: errno
4+
.. module:: uerrno
55
:synopsis: system error codes
66

7-
|see_cpython_module| :mod:`cpython:errno`.
7+
|see_cpython_module| :mod:`python:errno`.
88

99
This module provides access to symbolic error codes for `OSError` exception.
10+
A particular inventory of codes depends on :term:`MicroPython port`.
1011

1112
Constants
1213
---------
1314

1415
.. data:: EEXIST, EAGAIN, etc.
1516

1617
Error codes, based on ANSI C/POSIX standard. All error codes start with
17-
"E". Errors are usually accessible as ``exc.args[0]``
18+
"E". As mentioned above, inventory of the codes depends on
19+
:term:`MicroPython port`. Errors are usually accessible as ``exc.args[0]``
1820
where ``exc`` is an instance of `OSError`. Usage example::
1921

2022
try:
21-
os.mkdir("my_dir")
23+
uos.mkdir("my_dir")
2224
except OSError as exc:
23-
if exc.args[0] == errno.EEXIST:
25+
if exc.args[0] == uerrno.EEXIST:
2426
print("Directory already exists")
2527

2628
.. data:: errorcode
2729

2830
Dictionary mapping numeric error codes to strings with symbolic error
2931
code (see above)::
3032

31-
>>> print(errno.errorcode[uerrno.EEXIST])
33+
>>> print(uerrno.errorcode[uerrno.EEXIST])
3234
EEXIST

docs/library/framebuf.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:mod:`framebuf` --- Frame buffer manipulation
1+
:mod:`framebuf` --- frame buffer manipulation
22
=============================================
33

44
.. include:: ../templates/unsupported_in_circuitpython.inc
@@ -30,7 +30,7 @@ For example::
3030
Constructors
3131
------------
3232

33-
.. class:: FrameBuffer(buffer, width, height, format, stride=width)
33+
.. class:: FrameBuffer(buffer, width, height, format, stride=width, /)
3434

3535
Construct a FrameBuffer object. The parameters are:
3636

@@ -132,7 +132,7 @@ Constants
132132

133133
Monochrome (1-bit) color format
134134
This defines a mapping where the bits in a byte are horizontally mapped.
135-
Each byte occupies 8 horizontal pixels with bit 0 being the leftmost.
135+
Each byte occupies 8 horizontal pixels with bit 7 being the leftmost.
136136
Subsequent bytes appear at successive horizontal locations until the
137137
rightmost edge is reached. Further bytes are rendered on the next row, one
138138
pixel lower.
@@ -141,7 +141,7 @@ Constants
141141

142142
Monochrome (1-bit) color format
143143
This defines a mapping where the bits in a byte are horizontally mapped.
144-
Each byte occupies 8 horizontal pixels with bit 7 being the leftmost.
144+
Each byte occupies 8 horizontal pixels with bit 0 being the leftmost.
145145
Subsequent bytes appear at successive horizontal locations until the
146146
rightmost edge is reached. Further bytes are rendered on the next row, one
147147
pixel lower.

docs/library/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ with the ``u`` prefix dropped:
3737
json.rst
3838
re.rst
3939
sys.rst
40+
uasyncio.rst
4041
uctypes.rst
4142
uselect.rst
4243
uzlib.rst

0 commit comments

Comments
 (0)