The get, set and del item methods didn't correctly lookup the value
from the parent native instance because the functions took the type
from the instance.
Fixes#8758
bitmapfilter.morph is taken from openmv's imlib.
It is substantially faster than blur/sharpen implemented in ulab,
by up to 10x. It also avoids making many allocations.
We mark all protocols with their type using MP_PROTO_IMPLEMENT,
and checking in mp_get_stream{,_raise}.
This was not turning up as a problem in tests until a (new, not yet
commited) change to jpegio caused a segfault because a type implementing
a different protocol was passed in to mp_get_stream.
By using 0 (instead of MP_QSTR_protocol_stream) as the marker for
objects implementing the standard micropython stream protocol, the
number of CIRCUITPY-CHANGEs is minimized.
Some qstrs like those representing binary ops such as __add__ must have
qstr numbers that fit in 8 bits. Replace the former ad-hoc method,
which sorted *other* dunder-identifiers early with a list of all
the qstrs that have this requirement.
Before this, the unix coverage build was failing when I added certain
qstrs like "<input>" for a codeop filename default value.
This function in standard Python is a building block for custom REPLs:
```python
from codeop import compile_command
print("Repl in (Circuit-)Python")
ns = {}
PS1="<<< "
PS2=",,, "
command = ""
while True:
line = input(PS2 if command else PS1)
if command:
command = command + "\n" + line
else:
command = line
try:
if (code := compile_command(command)):
command = ""
exec(code, ns)
except Exception as e:
command = ""
print(e)
```
When a frozen module was added or updated, a build error would occur
during CI: `KeyError: 'FROZEN_MPY_DIRS'`.
In e40abda1bc I decided that it should be an error if all the expected
keys were not defined in the board settings dict. I made this change
and all seemed to be well; however, my testing did not exercise the
case that a frozen module was changed.
It turns out that FROZEN_MPY_DIRS was not being set in the board settings
dict because the output of print-FROZEN_MPY_DIRS was "FROZEN_MPY_DIRS ="
(which does not match the regular expression) instead of
"FROZEN_MPY_DIRS = " (with a trailing space).
This change fixes the problem by ensuring that an undefined or empty
variable still prints with a space character after the equal character.
Tested by running locally:
```
python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])'
```
(prints a blank line, expected)
as well as simulating a change to the asyncio frozen submodule:
```
python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])'
```
(which will build the elecfreaks_picoed board)
This returns the localization of the running CircuitPython, such as
en_US, fr, etc.
Additional changes are needed in build infrastructure since the
string "en_US" should not appear to be translated in weblate, ever;
instead the value comes from the translation metadata.
Closes: #8602
* teach ci_fetch_deps about --filter=blob:none
* change logic ensuring tags in frozen/ are fetched
* since check=True was all the time, remove unused kwarg
* add fetch-board-submodules
Closes: #8588
This simplifies allocating outside of the VM because the VM doesn't
take up all remaining memory by default.
On ESP we delegate to the IDF for allocations. For all other ports,
we use TLSF to manage an outer "port" heap. The IDF uses TLSF
internally and we use their fork for the other ports.
This also removes the dynamic C stack sizing. It wasn't often used
and is not possible with a fixed outer heap.
Fixes#8512. Fixes#7334.