Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
tests/basics/string_crlf_conversion.py -text
tests/micropython/test_normalize_newlines.py.exp -text
# CIRCUITPY-CHANGE: remove non-CircuitPython tests
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand Down Expand Up @@ -55,14 +55,14 @@ repos:
language: python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.4
rev: v0.15.7
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
rev: "v2.21.0"
hooks:
- id: pyproject-fmt
2 changes: 1 addition & 1 deletion LICENSE_MicroPython
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2024 Damien P. George
Copyright (c) 2013-2025 Damien P. George

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -375,5 +375,6 @@ coverage-fresh:
make -j -C ports/unix VARIANT=coverage

.PHONY: run-tests
# If TESTS="abc.py def.py" is specified as an arg, run only those tests. Otherwise, run all tests.
run-tests:
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py $(TESTS)
16 changes: 16 additions & 0 deletions docs/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,19 @@ Classes
a 2
w 5
b 3

.. method:: OrderedDict.popitem()

Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order.

.. admonition:: Difference to CPython
:class: attention

``OrderedDict.popitem()`` does not support the ``last=False`` argument and
will always remove and return the last item if present.

A workaround for this is to use ``pop(<first_key>)`` to remove the first item::

first_key = next(iter(d))
d.pop(first_key)
8 changes: 8 additions & 0 deletions docs/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ Functions
Returns a tuple of strings *(lib, version)*, where *lib* is the name of the
libc that MicroPython is linked to, and *version* the corresponding version
of this libc.

.. function:: processor()

Returns a string with a detailed name of the processor, if one is available.
If no name for the processor is known, it will return an empty string
instead.

This is currently available only on RISC-V targets (both 32 and 64 bits).
14 changes: 12 additions & 2 deletions docs/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,25 @@ Regex objects
Compiled regular expression. Instances of this class are created using
`re.compile()`.

.. method:: regex.match(string)
regex.search(string)
.. method:: regex.match(string, [pos, [endpos]])
regex.search(string, [pos, [endpos]])
regex.sub(replace, string, count=0, flags=0, /)

Similar to the module-level functions :meth:`match`, :meth:`search`
and :meth:`sub`.
Using methods is (much) more efficient if the same regex is applied to
multiple strings.

The optional second parameter *pos* gives an index in the string where the
search is to start; it defaults to ``0``. This is not completely equivalent
to slicing the string; the ``'^'`` pattern character matches at the real
beginning of the string and at positions just after a newline, but not
necessarily at the index where the search is to start.

The optional parameter *endpos* limits how far the string will be searched;
it will be as if the string is *endpos* characters long, so only the
characters from *pos* to ``endpos - 1`` will be searched for a match.

.. method:: regex.split(string, max_split=-1, /)

Split a *string* using regex. If *max_split* is given, it specifies
Expand Down
18 changes: 6 additions & 12 deletions docs/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ Functions
.. function:: exit(retval=0, /)

Terminate current program with a given exit code. Underlyingly, this
function raise as `SystemExit` exception. If an argument is given, its
function raises a `SystemExit` exception. If an argument is given, its
value given as an argument to `SystemExit`.

.. function:: print_exception(exc, file=sys.stdout, /)

This function is deprecated and will be removed starting in
CircuitPython 10.x, `traceback.print_exception()` should be used instead.

Print exception with a traceback to a file-like object *file* (or
`sys.stdout` by default).

.. admonition:: Difference to CPython
:class: attention

Expand Down Expand Up @@ -52,6 +44,8 @@ Constants
* *version* - tuple (major, minor, micro), e.g. (1, 7, 0)
* *_machine* - string describing the underlying machine
* *_mpy* - supported mpy file-format version (optional attribute)
* *_build* - string that can help identify the configuration that
MicroPython was built with

This object is the recommended way to distinguish CircuitPython from other
Python implementations (note that it still may not exist in the very
Expand Down Expand Up @@ -116,15 +110,15 @@ Constants

.. data:: stderr

Standard error ``stream``.
Standard error `stream`.

.. data:: stdin

Standard input ``stream``.
Standard input `stream`.

.. data:: stdout

Standard output ``stream``.
Standard output `stream`.

.. data:: version

Expand Down
7 changes: 7 additions & 0 deletions docs/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ Glossary
Most MicroPython boards make a REPL available over a UART, and this is
typically accessible on a host PC via USB.

small integer
MicroPython optimises the internal representation of integers such that
"small" values do not take up space on the heap, and calculations with
them do not require heap allocation. On most 32-bit ports, this
corresponds to values in the interval ``-2**30 <= x < 2**30``, but this
should be considered an implementation detail and not relied upon.

stream
Also known as a "file-like object". A Python object which provides
sequential read-write access to the underlying data. A stream object
Expand Down
4 changes: 2 additions & 2 deletions extmod/extmod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ endif

ifeq ($(MICROPY_VFS_LFS2),1)
CFLAGS_EXTMOD += -DMICROPY_VFS_LFS2=1
CFLAGS_THIRDPARTY += -DLFS2_NO_MALLOC -DLFS2_NO_DEBUG -DLFS2_NO_WARN -DLFS2_NO_ERROR -DLFS2_NO_ASSERT
CFLAGS_THIRDPARTY += -DLFS2_NO_MALLOC -DLFS2_NO_DEBUG -DLFS2_NO_WARN -DLFS2_NO_ERROR -DLFS2_NO_ASSERT -DLFS2_DEFINES=extmod/littlefs-include/lfs2_defines.h
SRC_THIRDPARTY_C += $(addprefix $(LITTLEFS_DIR)/,\
lfs2.c \
lfs2_util.c \
Expand Down Expand Up @@ -461,7 +461,7 @@ ESP_HOSTED_SRC_C = $(addprefix $(ESP_HOSTED_DIR)/,\
)

ifeq ($(MICROPY_PY_BLUETOOTH),1)
ESP_HOSTED_SRC_C += $(ESP_HOSTED_DIR)/esp_hosted_bthci.c
ESP_HOSTED_SRC_C += $(ESP_HOSTED_DIR)/esp_hosted_bthci_uart.c
endif

# Include the protobuf-c support functions
Expand Down
41 changes: 0 additions & 41 deletions extmod/lwip-include/arch/cc.h

This file was deleted.

7 changes: 0 additions & 7 deletions extmod/lwip-include/arch/perf.h

This file was deleted.

36 changes: 0 additions & 36 deletions extmod/lwip-include/lwipopts.h

This file was deleted.

111 changes: 0 additions & 111 deletions extmod/lwip-include/lwipopts_common.h

This file was deleted.

3 changes: 2 additions & 1 deletion extmod/modjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ static mp_obj_t _mod_json_load(mp_obj_t stream_obj, bool return_first_json) {
for (;;) {
cont:
if (S_END(s)) {
break;
// Input finished abruptly in the middle of a composite entity.
goto fail;
}
mp_obj_t next = MP_OBJ_NULL;
bool enter = false;
Expand Down
Loading
Loading