Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into vectorio_is_colliding
Browse files Browse the repository at this point in the history
# Conflicts:
#	ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk
  • Loading branch information
FoamyGuy committed Aug 30, 2024
2 parents 2ba399d + d8b9f64 commit c9979ae
Show file tree
Hide file tree
Showing 702 changed files with 11,650 additions and 5,566 deletions.
3 changes: 3 additions & 0 deletions .codespell/exclude-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ USB_PRODUCT = "BLOK"
print(binascii.b2a_base64(b"fo"))
# again, neither will "there" or "wither", since they have "the"
i1Qb$TE"rl
ZEN = "the zen of python beautiful is better than ugly explicit is better than implicit simple is better than complex complex is better than complicated flat is better than nested sparse is better than dense readability counts special cases arent special enough to break the rules although practicality beats purity errors should never pass silently unless explicitly silenced in the face of ambiguity refuse the temptation to guess there should be one and preferably only one obvious way to do it although that way may not be obvious at first unless youre dutch now is better than never although never is often better than right now if the implementation is hard to explain its a bad idea if the implementation is easy to explain it may be a good idea namespaces are one honking great idea lets do more of those"
"arent",
"youre",
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# all: Update Python formatting to ruff-format.
bbd8760bd9a2302e5abee29db279102bb11d7732

# all: Fix various spelling mistakes found by codespell 2.2.6.
cf490a70917a1b2d38ba9b58e763e0837d0f7ca7

Expand Down
12 changes: 4 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
*.props text eol=crlf
*.bat text eol=crlf

# CIRCUITPY-CHANGE: add some more binary types.
# These are binary so should never be modified by git.
*.a binary
*.ico binary
*.png binary
*.jpg binary
*.dxf binary
*.mpy binary
*.der binary
*.deb binary
*.zip binary
*.pdf binary
Expand All @@ -24,11 +27,4 @@
# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
tests/basics/string_crlf_conversion.py -text
ports/stm32/pybcdc.inf_template -text
ports/stm32/usbhost/** -text
ports/cc3200/hal/aes.c -text
ports/cc3200/hal/aes.h -text
ports/cc3200/hal/des.c -text
ports/cc3200/hal/i2s.c -text
ports/cc3200/hal/i2s.h -text
ports/cc3200/version.h -text
# CIRCUITPY-CHANGE: remove non-CircuitPython tests
7 changes: 5 additions & 2 deletions .github/actions/upload_aws/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ runs:
steps:
- name: Upload to S3
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') ||
(github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
(github.event_name == 'push' && github.repository_owner == 'adafruit') &&
(github.ref == 'refs/heads/main' ||
(startswith(github.ref, 'refs/heads/') && endswith(github.ref, '.x'))) ||
(github.event_name == 'release' &&
(github.event.action == 'published' || github.event.action == 'rerequested'))
run: >-
[ -z "$AWS_ACCESS_KEY_ID" ] ||
aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,13 @@ jobs:
wget --no-verbose -O gcc-arm.zip https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip
unzip -q -d /tmp gcc-arm.zip
tar -C /tmp/arm-gnu-toolchain* -cf - . | tar -C /usr/local -xf -
pip install wheel
# requirements_dev.txt doesn't install on windows. (with msys2 python)
# We could use a venv instead, but that requires entering the venv on each run step
# that runs in its own shell. There are some actions that help with that, but not for msys2
# that I can find. (dhalbert)
pip install --break-system-packages wheel
# requirements-dev.txt doesn't install on windows. (with msys2 python)
# instead, pick a subset for what we want to do
pip install cascadetoml jinja2 typer click intelhex
pip install --break-system-packages cascadetoml jinja2 typer click intelhex
# check that installed packages work....?
which python; python --version; python -c "import cascadetoml"
which python3; python3 --version; python3 -c "import cascadetoml"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

jobs:
run:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
test: [all, mpy, native, native_mpy]
env:
CP_VERSION: ${{ inputs.cp-version }}
MICROPY_CPYTHON3: python3.8
MICROPY_CPYTHON3: python3.12
MICROPY_MICROPYTHON: ../ports/unix/build-coverage/micropython
TEST_all:
TEST_mpy: --via-mpy -d basics float micropython
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Set up submodules
uses: ./.github/actions/deps/submodules
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# CIRCUITPY-CHANGES: many additions

# Compiled Sources
###################
*.o
Expand Down
19 changes: 15 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
[submodule "ports/espressif/esp-idf"]
path = ports/espressif/esp-idf
url = https://github.com/adafruit/esp-idf.git
branch = circuitpython-v5.2.2
branch = circuitpython-v5.3
[submodule "ports/espressif/esp-protocols"]
path = ports/espressif/esp-protocols
url = https://github.com/espressif/esp-protocols.git
Expand Down Expand Up @@ -345,7 +345,6 @@
[submodule "ports/raspberrypi/lib/Pico-PIO-USB"]
path = ports/raspberrypi/lib/Pico-PIO-USB
url = https://github.com/sekigon-gonnoc/Pico-PIO-USB.git
branch = main
[submodule "lib/micropython-lib"]
path = lib/micropython-lib
url = https://github.com/micropython/micropython-lib.git
Expand All @@ -354,8 +353,8 @@
url = https://github.com/adafruit/certificates
[submodule "lib/tlsf"]
path = lib/tlsf
url = https://github.com/adafruit/tlsf.git
branch = circuitpython
url = https://github.com/espressif/tlsf.git
branch = idf
[submodule "frozen/CircuitPython_AXP313A"]
path = frozen/CircuitPython_AXP313A
url = https://github.com/bill88t/CircuitPython_AXP313A
Expand Down Expand Up @@ -395,3 +394,15 @@
[submodule "frozen/Adafruit_CircuitPython_LED_Animation"]
path = frozen/Adafruit_CircuitPython_LED_Animation
url = https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation
[submodule "frozen/CircuitPython_AXP2101"]
path = frozen/CircuitPython_AXP2101
url = https://github.com/CDarius/CircuitPython_AXP2101
[submodule "frozen/CircuitPython_BMA423"]
path = frozen/CircuitPython_BMA423
url = https://github.com/jposada202020/CircuitPython_BMA423
[submodule "frozen/Adafruit_CircuitPython_PCF8563"]
path = frozen/Adafruit_CircuitPython_PCF8563
url = https://github.com/adafruit/Adafruit_CircuitPython_PCF8563
[submodule "frozen/Adafruit_CircuitPython_Wiznet5k"]
path = frozen/Adafruit_CircuitPython_Wiznet5k
url = https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
#
# SPDX-License-Identifier: Unlicense

# CIRCUITPY-CHANGE: CircuitPython-specific.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)'
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/raspberrypi/sdk|lib/tinyusb)'
- id: trailing-whitespace
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff)'
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff|ports/raspberrypi/sdk|lib/tinyusb)'
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
Expand All @@ -22,7 +24,8 @@ repos:
lib/|
tests/unicode/data/utf-8_invalid.txt|
tests/extmod/data/qr.pgm|
tests/basics/bytearray_byte_operations.py
tests/basics/bytearray_byte_operations.py|
ports/raspberrypi/sdk
)
- repo: local
hooks:
Expand All @@ -37,3 +40,8 @@ repos:
entry: python3 tools/codeformat.py
types_or: [c, python]
language: system
exclude: |
(?x)^(
lib/tinyusb|
ports/raspberrypi/sdk
)
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "3"
jobs:
Expand Down
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ As CircuitPython grows, there are more and more ways to contribute. Here are som
* Contribute Python code to CircuitPython libraries that support new devices or features of an existing device.
* Contribute C code to CircuitPython which fixes an open issue or adds a new feature.

## Getting started with C
CircuitPython developer Dan Halbert (@dhalbert) has written up build instructions using native build
tools [here](https://learn.adafruit.com/building-circuitpython).
## Building CircuitPython: Getting started with C

For SAMD21 debugging workflow tips check out [this learn guide](https://learn.adafruit.com/debugging-the-samd21-with-gdb) from Scott (@tannewt).
The CircuitPython core is implemented mostly in C. If you want to add support
for new boards, add features to the core, fix bugs in the core, or compile with
special options (perhaps to make a debug build with UART logging), you will
need to install a development environment with build tools.

Build Documentation:

- [Building CircuitPython Learn Guide](https://learn.adafruit.com/building-circuitpython):
CircuitPython developer Dan Halbert (@dhalbert) wrote this guide with build
instructions for using native build tools. **This is the primary getting
started documentation for building CircuitPython.**

- For SAMD21 debugging workflow tips check out [this learn guide](https://learn.adafruit.com/debugging-the-samd21-with-gdb) from Scott (@tannewt).

## Developer contacts
Scott Shawcroft ([@tannewt](https://github.com/tannewt)) is the lead developer of CircuitPython
Expand Down
14 changes: 12 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

#CIRCUITPY-CHANGE:

Unless specified otherwise (see below), the above license and copyright applies
to all files derived from MicroPython in this repository.

Individual files may include additional copyright holders and specify other licenses.
See the comments and SPDX headers.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ check-stubs: stubs
@(cd $(STUBDIR) && set -- */__init__.pyi && mypy "$${@%/*}")
@tools/test-stubs.sh

.PHONY: update-frozen-libraries
update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
Expand Down Expand Up @@ -350,3 +351,16 @@ remove-all-submodules:
.PHONY: fetch-tags
fetch-tags:
git fetch --tags --recurse-submodules=no --shallow-since="2023-02-01" https://github.com/adafruit/circuitpython HEAD

.PHONY: coverage
coverage:
make -j -C ports/unix VARIANT=coverage

.PHONY: coverage-clean
coverage-fresh:
make -C ports/unix VARIANT=coverage clean
make -j -C ports/unix VARIANT=coverage

.PHONY: run-tests
run-tests:
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py
2 changes: 1 addition & 1 deletion docs/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Constants
.. data:: maxsize

Maximum value which a native integer type can hold on the current platform,
or maximum value representable by CircuitPython integer type, if it's smaller
or maximum value representable by the CircuitPython integer type, if it's smaller
than platform max value (that is the case for CircuitPython ports without
long int support).

Expand Down
7 changes: 4 additions & 3 deletions docs/readthedocs/settings/local_settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os

# Directory that the project lives in, aka ../..
SITE_ROOT = '/'.join(os.path.dirname(__file__).split('/')[0:-2])
SITE_ROOT = "/".join(os.path.dirname(__file__).split("/")[0:-2])

TEMPLATE_DIRS = (
"%s/templates/" % SITE_ROOT, # Your custom template directory, before the RTD one to override it.
"%s/readthedocs/templates/" % SITE_ROOT, # Default RTD template dir
"%s/templates/"
% SITE_ROOT, # Your custom template directory, before the RTD one to override it.
"%s/readthedocs/templates/" % SITE_ROOT, # Default RTD template dir
)
7 changes: 7 additions & 0 deletions examples/usercmodule/cppexample/example.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
extern "C" {
#include <examplemodule.h>
#include <py/objstr.h>

// Here we implement the function using C++ code, but since it's
// declaration has to be compatible with C everything goes in extern "C" scope.
mp_obj_t cppfunc(mp_obj_t a_obj, mp_obj_t b_obj) {
// The following no-ops are just here to verify the static assertions used in
// the public API all compile with C++.
MP_STATIC_ASSERT_STR_ARRAY_COMPATIBLE;
if (mp_obj_is_type(a_obj, &mp_type_BaseException)) {
}

// Prove we have (at least) C++11 features.
const auto a = mp_obj_get_int(a_obj);
const auto b = mp_obj_get_int(b_obj);
Expand Down
Loading

0 comments on commit c9979ae

Please sign in to comment.