Skip to content

Commit 28b3bd3

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # lib/lwip # lib/mbedtls # lib/stm32lib # lib/tinyusb
2 parents 4324265 + 813d559 commit 28b3bd3

2,832 files changed

Lines changed: 119107 additions & 66628 deletions

File tree

Some content is hidden

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

.git-blame-ignore-revs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# all: Fix spelling mistakes based on codespell check.
2+
b1229efbd1509654dec6053865ab828d769e29db
3+
4+
# top: Update Python formatting to black "2023 stable style".
5+
8b2748269244304854b3462cb8902952b4dcb892
6+
7+
# all: Reformat remaining C code that doesn't have a space after a comma.
8+
5b700b0af90591d6b1a2c087bb8de6b7f1bfdd2d
9+
10+
# ports: Reformat more C and Python source code.
11+
5c32111fa0e31e451b0f1666bdf926be2fdfd82c
12+
113
# all: Update Python formatting to latest Black version 22.1.0.
214
ab2923dfa1174dc177f0a90cb00a7e4ff87958d2
315

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Report an issue
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab or raise a documentation request instead.
11+
12+
* In your issue, please include a clear and concise description of what the bug is, the expected output, and how to replicate it.
13+
14+
* If this issue involves external hardware, please include links to relevant datasheets and schematics.
15+
16+
* If you are seeing code being executed incorrectly, please provide a minimal example and expected output (e.g. comparison to CPython).
17+
18+
* For build issues, please include full details of your environment, compiler versions, command lines, and build output.
19+
20+
* Please provide as much information as possible about the version of MicroPython you're running, such as:
21+
- firmware file name
22+
- git commit hash and port/board
23+
- version information shown in the REPL (hit Ctrl-B to see the startup message)
24+
25+
* Remove all placeholder text above before submitting.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: MicroPython GitHub Discussions
4+
url: https://github.com/orgs/micropython/discussions
5+
about: Community discussion about all things MicroPython. This is the best place to start if you have questions about using MicroPython or getting started with MicroPython development.
6+
- name: MicroPython Documentation
7+
url: https://docs.micropython.org/
8+
about: Documentation for using and working with MicroPython and libraries.
9+
- name: MicroPython Downloads
10+
url: https://micropython.org/download/
11+
about: Pre-built firmware and information for most supported boards.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Documentation issue
3+
about: Report areas of the documentation or examples that need improvement
4+
title: 'docs: '
5+
labels: documentation
6+
assignees: ''
7+
8+
---
9+
10+
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab instead.
11+
12+
* Describe what was missing from the documentation and/or what was incorrect/incomplete.
13+
14+
* If possible, please link to the relevant page on https://docs.micropython.org/
15+
16+
* Remove all placeholder text above before submitting.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Request a feature or improvement
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab or raise a documentation request instead.
11+
12+
* Describe the feature you'd like to see added to MicroPython. In particular, what does this feature enable and why is it useful. MicroPython aims to strike a balance between functionality and code size, so please consider whether this feature can be optionally enabled and whether it can be provided in other ways (e.g. pure-Python library).
13+
14+
* For core Python features, where possible please include a link to the relevant PEP.
15+
16+
* For new architectures / ports / boards, please provide links to relevant documentation, specifications, and toolchains. Any information about the popularity and unique features about this hardware would also be useful.
17+
18+
* For features for existing ports (e.g. new peripherals or microcontroller features), please describe which port(s) it applies too, and whether this is could be an extension to the machine API or a port-specific module?
19+
20+
* For drivers (e.g. for external hardware), please link to datasheets and/or existing drivers from other sources.
21+
22+
* Who do you expect will implement the feature you are requesting? Would you be willing to sponsor this work?
23+
24+
* Remove all placeholder text above before submitting.

.github/ISSUE_TEMPLATE/security.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Security report
3+
about: Report a security issue or vulnerability in MicroPython
4+
title: ''
5+
labels: security
6+
assignees: ''
7+
8+
---
9+
10+
* If you need to raise this issue privately with the MicroPython team, please email contact@micropython.org instead.
11+
12+
* Include a clear and concise description of what the security issue is.
13+
14+
* What does this issue allow an attacker to do?
15+
16+
* Remove all placeholder text above before submitting.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/code_formatting.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,29 @@ name: Check code formatting
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
6-
build:
7-
runs-on: ubuntu-latest
10+
code-formatting:
11+
runs-on: ubuntu-22.04
812
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-python@v1
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v4
1115
- name: Install packages
1216
run: source tools/ci.sh && ci_code_formatting_setup
1317
- name: Run code formatting
1418
run: source tools/ci.sh && ci_code_formatting_run
1519
- name: Check code formatting
1620
run: git diff --exit-code
21+
22+
code-spelling:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-python@v4
27+
- name: Install packages
28+
run: source tools/ci.sh && ci_code_spell_setup
29+
- name: Run spell checker
30+
run: source tools/ci.sh && ci_code_spell_run

.github/workflows/code_size.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,34 @@ on:
1212
- 'ports/bare-arm/**'
1313
- 'ports/minimal/**'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
build:
1721
runs-on: ubuntu-20.04
1822
steps:
19-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2024
with:
2125
fetch-depth: 100
2226
- name: Install packages
2327
run: source tools/ci.sh && ci_code_size_setup
2428
- name: Build
2529
run: source tools/ci.sh && ci_code_size_build
2630
- name: Compute code size difference
27-
run: tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
31+
run: tools/metrics.py diff ~/size0 ~/size1 | tee diff
32+
- name: Save PR number
33+
if: github.event_name == 'pull_request'
34+
env:
35+
PR_NUMBER: ${{ github.event.number }}
36+
run: echo $PR_NUMBER > pr_number
37+
- name: Upload diff
38+
if: github.event_name == 'pull_request'
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: code-size-report
42+
path: |
43+
diff
44+
pr_number
45+
retention-days: 1
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Code size comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Check code size]
6+
types: [completed]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
comment:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- name: 'Download artifact'
17+
id: download-artifact
18+
uses: actions/github-script@v6
19+
with:
20+
result-encoding: string
21+
script: |
22+
const fs = require('fs');
23+
24+
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
run_id: context.payload.workflow_run.id,
28+
});
29+
30+
const matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
31+
return artifact.name == "code-size-report"
32+
});
33+
34+
if (matchArtifact.length === 0) {
35+
console.log('no matching artifact found');
36+
console.log('result: "skip"');
37+
38+
return 'skip';
39+
}
40+
41+
const download = await github.rest.actions.downloadArtifact({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
artifact_id: matchArtifact[0].id,
45+
archive_format: 'zip',
46+
});
47+
48+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/code-size-report.zip`, Buffer.from(download.data));
49+
50+
console.log('artifact downloaded to `code-size-report.zip`');
51+
console.log('result: "ok"');
52+
53+
return 'ok';
54+
- name: 'Unzip artifact'
55+
if: steps.download-artifact.outputs.result == 'ok'
56+
run: unzip code-size-report.zip
57+
- name: Post comment to pull request
58+
if: steps.download-artifact.outputs.result == 'ok'
59+
uses: actions/github-script@v6
60+
with:
61+
github-token: ${{secrets.GITHUB_TOKEN}}
62+
script: |
63+
const fs = require('fs');
64+
65+
const prNumber = Number(fs.readFileSync('pr_number'));
66+
const codeSizeReport = `Code size report:
67+
68+
\`\`\`
69+
${fs.readFileSync('diff')}
70+
\`\`\`
71+
`;
72+
73+
const comments = await github.paginate(
74+
github.rest.issues.listComments,
75+
{
76+
owner: context.repo.owner,
77+
repo: context.repo.repo,
78+
issue_number: prNumber,
79+
}
80+
);
81+
82+
comments.reverse();
83+
84+
const previousComment = comments.find(comment =>
85+
comment.user.login === 'github-actions[bot]'
86+
)
87+
88+
// if github-actions[bot] already made a comment, update it,
89+
// otherwise create a new comment.
90+
91+
if (previousComment) {
92+
await github.rest.issues.updateComment({
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
comment_id: previousComment.id,
96+
body: codeSizeReport,
97+
});
98+
} else {
99+
await github.rest.issues.createComment({
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
issue_number: prNumber,
103+
body: codeSizeReport,
104+
});
105+
}

0 commit comments

Comments
 (0)