Skip to content

Commit 0b4727c

Browse files
authored
Merge branch 'master' into patch-1
Signed-off-by: Ben Wynn <bwynn@glowie.com>
2 parents 2523670 + d0511a4 commit 0b4727c

File tree

82 files changed

+612
-290
lines changed

Some content is hidden

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

82 files changed

+612
-290
lines changed

.github/workflows/codespell.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Check spelling with codespell
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
codespell:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
# codespell version should be kept in sync with .pre-commit-config.yml
11+
- run: pip install --user codespell==2.4.1 tomli
12+
- run: codespell
13+

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ repos:
1313
hooks:
1414
- id: ruff
1515
id: ruff-format
16+
17+
- repo: https://github.com/codespell-project/codespell
18+
# version should be kept in sync with .github/workflows/codespell.yml & micropython repo
19+
rev: v2.4.1
20+
hooks:
21+
- id: codespell
22+
additional_dependencies:
23+
- tomli

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,40 @@ specific conventions and guidelines for micropython-lib:
8787
packages](README.md#installing-packages-from-forks) in your Pull Request
8888
description.
8989

90+
### Module documentation
91+
92+
Each package in micropython-lib is encouraged to include documentation in
93+
the form of docstrings in the code itself. The top-level docstring in the main
94+
module or package should provide an overview of the package's functionality,
95+
usage examples, and any important notes or caveats.
96+
97+
Note that the docstrings should be concise and relevant, even though they will
98+
not be included in the cross-compiled bytecode and will not impact the size of
99+
the module when installed via `mip`.
100+
101+
When writing docstrings, please follow these guidelines:
102+
* Use triple double quotes (`"""`) for docstrings.
103+
* Multi-line docstrings should place the starting and ending triple quotes on
104+
their own lines.
105+
* Start with a brief summary of the module's purpose.
106+
* Include usage examples where appropriate (indent examplecode blocks with 4
107+
spaces).
108+
* Use proper indentation for multi-line docstrings to align with the code block.
109+
110+
### Module versioning
111+
112+
Each package in micropython-lib should include a `manifest.py` file that
113+
specifies metadata about the package, including its version. The version
114+
management is intentionally manual to ensure package stability and prevent
115+
accidental version bumps. When making changes to a package that affect its
116+
functionality or API, please update the version in `manifest.py`. The
117+
`tools/build.py` script will detect new versions and add them to the index, but
118+
won't increment versions automatically
119+
120+
> [!NOTE]
121+
> Changes to docstrings or comments that do not change the generated bytecode
122+
> should not change the version.
123+
90124
### Publishing packages from forks
91125

92126
You can easily publish the packages from your micropython-lib

micropython/aiorepl/aiorepl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def kbd_intr_task(exec_task, s):
7474
except asyncio.CancelledError:
7575
pass
7676
else:
77-
# Excute code snippet directly.
77+
# Execute code snippet directly.
7878
try:
7979
try:
8080
micropython.kbd_intr(3)

micropython/bluetooth/aioble/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async with aioble.scan(duration_ms=5000, interval_us=30000, window_us=30000, act
9393
# Either from scan result
9494
device = result.device
9595
# Or with known address
96-
device = aioble.Device(aioble.PUBLIC, "aa:bb:cc:dd:ee:ff")
96+
device = aioble.Device(aioble.ADDR_PUBLIC, "aa:bb:cc:dd:ee:ff")
9797

9898
try:
9999
connection = await device.connect(timeout_ms=2000)

micropython/bluetooth/aioble/aioble/central.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def _connect(
119119
_connecting.add(device)
120120

121121
# Event will be set in the connected IRQ, and then later
122-
# re-used to notify disconnection.
122+
# reused to notify disconnection.
123123
connection._event = connection._event or asyncio.ThreadSafeFlag()
124124

125125
try:

micropython/bluetooth/aioble/aioble/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async def read(self, timeout_ms=1000):
244244
self._register_with_connection()
245245
# This will be set by the done IRQ.
246246
self._read_status = None
247-
# This will be set by the result and done IRQs. Re-use if possible.
247+
# This will be set by the result and done IRQs. Reuse if possible.
248248
self._read_event = self._read_event or asyncio.ThreadSafeFlag()
249249

250250
# Issue the read.

micropython/bluetooth/aioble/examples/l2cap_file_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MIT license; Copyright (c) 2021 Jim Mussared
22

33
# This is a BLE file server, based very loosely on the Object Transfer Service
4-
# specification. It demonstrated transfering data over an L2CAP channel, as
4+
# specification. It demonstrated transferring data over an L2CAP channel, as
55
# well as using notifications and GATT writes on a characteristic.
66

77
# The server supports downloading and uploading files, as well as querying
@@ -33,7 +33,7 @@
3333
_CONTROL_CHARACTERISTIC_UUID = bluetooth.UUID("0492fcec-7194-11eb-9439-0242ac130003")
3434

3535
# How frequently to send advertising beacons.
36-
_ADV_INTERVAL_MS = 250_000
36+
_ADV_INTERVAL_US = 250_000
3737

3838

3939
_COMMAND_SEND = const(0)
@@ -162,7 +162,7 @@ async def peripheral_task():
162162
while True:
163163
print("Waiting for connection")
164164
connection = await aioble.advertise(
165-
_ADV_INTERVAL_MS,
165+
_ADV_INTERVAL_US,
166166
name="mpy-file",
167167
services=[_FILE_SERVICE_UUID],
168168
)

micropython/bluetooth/aioble/examples/temp_sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
_ADV_APPEARANCE_GENERIC_THERMOMETER = const(768)
2121

2222
# How frequently to send advertising beacons.
23-
_ADV_INTERVAL_MS = 250_000
23+
_ADV_INTERVAL_US = 250_000
2424

2525

2626
# Register GATT server.
@@ -50,7 +50,7 @@ async def sensor_task():
5050
async def peripheral_task():
5151
while True:
5252
async with await aioble.advertise(
53-
_ADV_INTERVAL_MS,
53+
_ADV_INTERVAL_US,
5454
name="mpy-temp",
5555
services=[_ENV_SENSE_UUID],
5656
appearance=_ADV_APPEARANCE_GENERIC_THERMOMETER,

micropython/drivers/display/lcd160cr/lcd160cr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, connect=None, *, pwr=None, i2c=None, spi=None, i2c_addr=98):
5656
pwr(1)
5757
sleep_ms(10)
5858
# else:
59-
# alread have power
59+
# already have power
6060
# lets be optimistic...
6161

6262
# set connections

0 commit comments

Comments
 (0)