Skip to content

Commit aace8e0

Browse files
committed
2 parents 3b514bc + 122a401 commit aace8e0

File tree

1,808 files changed

+43393
-15037
lines changed

Some content is hidden

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

1,808 files changed

+43393
-15037
lines changed

.codespell/exclude-file.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ USB_PRODUCT = "BLOK"
55
print(binascii.b2a_base64(b"fo"))
66
# again, neither will "there" or "wither", since they have "the"
77
i1Qb$TE"rl
8+
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"
9+
"arent",
10+
"youre",
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/sh
2+
# -----------------------------------------------------------------------------
3+
# This script is from: https://apt.kitware.com/kitware-archive.sh
4+
#
5+
# It installs key and repo for the kitware CMAKE-archive.
6+
#
7+
# Author: Bernhard Bablok
8+
#
9+
# -----------------------------------------------------------------------------
10+
11+
set -eu
12+
13+
help() {
14+
echo "Usage: $0 [--release <ubuntu-release>] [--rc]" > /dev/stderr
15+
}
16+
17+
doing=
18+
rc=
19+
release=
20+
help=
21+
for opt in "$@"
22+
do
23+
case "${doing}" in
24+
release)
25+
release="${opt}"
26+
doing=
27+
;;
28+
"")
29+
case "${opt}" in
30+
--rc)
31+
rc=1
32+
;;
33+
--release)
34+
doing=release
35+
;;
36+
--help)
37+
help=1
38+
;;
39+
esac
40+
;;
41+
esac
42+
done
43+
44+
if [ -n "${doing}" ]
45+
then
46+
echo "--${doing} option given no argument." > /dev/stderr
47+
echo > /dev/stderr
48+
help
49+
exit 1
50+
fi
51+
52+
if [ -n "${help}" ]
53+
then
54+
help
55+
exit
56+
fi
57+
58+
if [ -z "${release}" ]
59+
then
60+
unset UBUNTU_CODENAME
61+
. /etc/os-release
62+
63+
if [ -z "${UBUNTU_CODENAME+x}" ]
64+
then
65+
echo "This is not an Ubuntu system. Aborting." > /dev/stderr
66+
exit 1
67+
fi
68+
69+
release="${UBUNTU_CODENAME}"
70+
fi
71+
72+
case "${release}" in
73+
noble|jammy|focal)
74+
packages=
75+
keyring_packages="ca-certificates gpg wget"
76+
;;
77+
*)
78+
echo "Only Ubuntu Noble (24.04), Jammy (22.04), and Focal (20.04) are supported. Aborting." > /dev/stderr
79+
exit 1
80+
;;
81+
esac
82+
83+
get_keyring=
84+
if [ ! -f /usr/share/doc/kitware-archive-keyring/copyright ]
85+
then
86+
packages="${packages} ${keyring_packages}"
87+
get_keyring=1
88+
fi
89+
90+
# Start the real work
91+
set -x
92+
93+
apt-get update
94+
# shellcheck disable=SC2086
95+
apt-get install -y ${packages}
96+
97+
test -n "${get_keyring}" && (wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - > /usr/share/keyrings/kitware-archive-keyring.gpg)
98+
99+
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${release} main" > /etc/apt/sources.list.d/kitware.list
100+
if [ -n "${rc}" ]
101+
then
102+
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${release}-rc main" >> /etc/apt/sources.list.d/kitware.list
103+
fi
104+
105+
apt-get update
106+
test -n "${get_keyring}" && rm /usr/share/keyrings/kitware-archive-keyring.gpg
107+
apt-get install -y kitware-archive-keyring

.devcontainer/common_tools.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ cd "$REPO_ROOT"
1515

1616
# --- repositories and tools ------------------------------------------------
1717

18+
echo -e "[common_tools.sh] adding kitware-archive (for current CMAKE)"
19+
sudo .devcontainer/add_kitware_archive.sh
20+
echo -e "[common_tools.sh] installing current version of CMAKE"
21+
sudo apt-get -y install cmake
22+
1823
echo -e "[common_tools.sh] adding pybricks/ppa"
1924
sudo add-apt-repository -y ppa:pybricks/ppa
2025
echo -e "[common_tools.sh] installing uncrustify and mtools"

.git-blame-ignore-revs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# all: Prune trailing whitespace.
2+
dda9b9c6da5d3c31fa8769e581a753e95a270803
3+
4+
# all: Remove the "STATIC" macro and just use "static" instead.
5+
decf8e6a8bb940d5829ca3296790631fcece7b21
6+
7+
# renesas-ra: Fix spelling mistakes found by codespell.
8+
b3f2f18f927fa2fad10daf63d8c391331f5edf58
9+
10+
# all: Update Python formatting to ruff-format.
11+
bbd8760bd9a2302e5abee29db279102bb11d7732
12+
113
# all: Fix various spelling mistakes found by codespell 2.2.6.
214
cf490a70917a1b2d38ba9b58e763e0837d0f7ca7
315

.gitattributes

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
*.props text eol=crlf
1111
*.bat text eol=crlf
1212

13+
# CIRCUITPY-CHANGE: add some more binary types.
1314
# These are binary so should never be modified by git.
1415
*.a binary
16+
*.ico binary
1517
*.png binary
1618
*.jpg binary
1719
*.dxf binary
1820
*.mpy binary
21+
*.der binary
1922
*.deb binary
2023
*.zip binary
2124
*.pdf binary
@@ -24,11 +27,4 @@
2427
# These should also not be modified by git.
2528
tests/basics/string_cr_conversion.py -text
2629
tests/basics/string_crlf_conversion.py -text
27-
ports/stm32/pybcdc.inf_template -text
28-
ports/stm32/usbhost/** -text
29-
ports/cc3200/hal/aes.c -text
30-
ports/cc3200/hal/aes.h -text
31-
ports/cc3200/hal/des.c -text
32-
ports/cc3200/hal/i2s.c -text
33-
ports/cc3200/hal/i2s.h -text
34-
ports/cc3200/version.h -text
30+
# CIRCUITPY-CHANGE: remove non-CircuitPython tests

.github/actions/deps/submodules/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ inputs:
2222
- restore
2323

2424
version:
25-
description: 'Whether to generate CP version'
25+
description: 'Whether to fetch tags to identify CP version'
2626
required: false
2727
default: false
2828
type: boolean

.github/actions/upload_aws/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ runs:
2020
steps:
2121
- name: Upload to S3
2222
if: >-
23-
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') ||
24-
(github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
23+
(github.event_name == 'push' && github.repository_owner == 'adafruit') &&
24+
(github.ref == 'refs/heads/main' ||
25+
(startswith(github.ref, 'refs/heads/') && endswith(github.ref, '.x'))) ||
26+
(github.event_name == 'release' &&
27+
(github.event.action == 'published' || github.event.action == 'rerequested'))
2528
run: >-
2629
[ -z "$AWS_ACCESS_KEY_ID" ] ||
2730
aws s3 cp ${{ inputs.source }} s3://adafruit-circuit-python/bin/${{ inputs.destination }}
Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Custom board build
1+
name: Build board (custom)
22

33
on:
44
workflow_dispatch:
@@ -21,6 +21,11 @@ on:
2121
description: 'Flags: Build flags (e.g. CIRCUITPY_WIFI=1)'
2222
required: false
2323
type: string
24+
branch:
25+
description: 'Branch (only if Version="latest")'
26+
required: false
27+
default: 'main'
28+
type: string
2429
debug:
2530
description: 'Make a debug build'
2631
required: false
@@ -31,12 +36,35 @@ run-name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ in
3136

3237
jobs:
3338
build:
34-
runs-on: ubuntu-22.04
39+
runs-on: ubuntu-24.04
3540
steps:
3641
- name: Set up repository
3742
run: |
3843
git clone --filter=tree:0 https://github.com/adafruit/circuitpython.git $GITHUB_WORKSPACE
39-
git checkout ${{ inputs.version == 'latest' && 'HEAD' || inputs.version }}
44+
- name: Checkout head / tag
45+
env:
46+
TAG: ${{ inputs.version == 'latest' && 'HEAD' || inputs.version }}
47+
run: |
48+
git checkout "$TAG"
49+
- name: fork compatibility
50+
if: github.repository_owner != 'adafruit'
51+
env:
52+
REPO: ${{ github.repository }}
53+
run: |
54+
git remote add fork "https://github.com/$REPO.git"
55+
git fetch fork --filter=tree:0
56+
- name: branch compatibility
57+
if: inputs.branch != 'main' && inputs.version == 'latest' && github.repository_owner == 'adafruit'
58+
env:
59+
BRANCH: ${{ inputs.branch }}
60+
run: |
61+
git checkout "$BRANCH"
62+
- name: branch compatibility (fork)
63+
if: inputs.branch != '' && inputs.version == 'latest' && github.repository_owner != 'adafruit'
64+
env:
65+
BRANCH: ${{ inputs.branch }}
66+
run: |
67+
git checkout -b fork-branch "fork/$BRANCH"
4068
- name: Set up identifier
4169
if: inputs.debug || inputs.flags != ''
4270
run: |
@@ -81,7 +109,12 @@ jobs:
81109
riscv64-unknown-elf-gcc --version || true
82110
mkfs.fat --version || true
83111
- name: Build board
84-
run: make -j4 ${{ inputs.flags }} BOARD=${{ inputs.board }} DEBUG=${{ inputs.debug && '1' || '0' }} TRANSLATION=${{ inputs.language }}
112+
env:
113+
TRANSLATION: ${{ inputs.language }}
114+
BOARD: ${{ inputs.board }}
115+
FLAGS: ${{ inputs.flags }}
116+
DEBUG: ${{ inputs.debug && '1' || '0' }}
117+
run: make -j4 $FLAGS BOARD="$BOARD" DEBUG=$DEBUG TRANSLATION="$TRANSLATION"
85118
working-directory: ports/${{ steps.set-up-port.outputs.port }}
86119
- name: Upload artifact
87120
uses: actions/upload-artifact@v4

.github/workflows/build-boards.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
board:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121
env:
2222
CP_VERSION: ${{ inputs.cp-version }}
2323
strategy:
@@ -31,6 +31,7 @@ jobs:
3131
submodules: false
3232
show-progress: false
3333
fetch-depth: 1
34+
persist-credentials: false
3435

3536
- name: Set up python
3637
uses: actions/setup-python@v5

.github/workflows/build-mpy-cross.yml

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

1515
jobs:
1616
build:
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1818
strategy:
1919
fail-fast: false
2020
matrix:
@@ -33,6 +33,7 @@ jobs:
3333
submodules: false
3434
show-progress: false
3535
fetch-depth: 1
36+
persist-credentials: false
3637
- name: Set up python
3738
uses: actions/setup-python@v5
3839
with:
@@ -57,9 +58,12 @@ jobs:
5758
run: make -C mpy-cross -j4 -f Makefile.${{ matrix.mpy-cross }}
5859

5960
- name: Set output
61+
env:
62+
EX: ${{ env[format('EX_{0}', matrix.mpy-cross)] || matrix.mpy-cross }}
63+
OS: ${{ env[format('OS_{0}', matrix.mpy-cross)] }}"
6064
run: |
61-
echo >> $GITHUB_ENV "EX=${{ env[format('EX_{0}', matrix.mpy-cross)] || matrix.mpy-cross }}"
62-
echo >> $GITHUB_ENV "OS=${{ env[format('OS_{0}', matrix.mpy-cross)] }}"
65+
echo >> $GITHUB_ENV "EX=$EX"
66+
echo >> $GITHUB_ENV "OS=$OS"
6367
6468
- name: Upload artifact
6569
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)