Skip to content

Commit d712d12

Browse files
authored
Merge branch 'main' into master
2 parents c8752ff + 3fcd999 commit d712d12

File tree

319 files changed

+27240
-4116
lines changed

Some content is hidden

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

319 files changed

+27240
-4116
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ jobs:
1616
env:
1717
GITHUB_CONTEXT: ${{ toJson(github) }}
1818
run: echo "$GITHUB_CONTEXT"
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v2.2.0
2020
with:
2121
submodules: true
2222
fetch-depth: 0
2323
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
24-
- run: git submodule sync
25-
- run: git submodule foreach git remote -v
26-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
2724
- name: CircuitPython version
28-
run: git describe --dirty --tags
25+
run: |
26+
git describe --dirty --tags
27+
echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)"
2928
- name: Set up Python 3.8
3029
uses: actions/setup-python@v1
3130
with:
@@ -66,8 +65,16 @@ jobs:
6665
working-directory: tests
6766
- name: Stubs
6867
run: make stubs -j2
68+
- uses: actions/upload-artifact@v2
69+
with:
70+
name: stubs
71+
path: circuitpython-stubs*
6972
- name: Docs
70-
run: sphinx-build -E -W -b html . _build/html
73+
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
74+
- uses: actions/upload-artifact@v2
75+
with:
76+
name: docs
77+
path: _build/html
7178
- name: Translations
7279
run: make check-translate
7380
- name: New boards check
@@ -110,14 +117,11 @@ jobs:
110117
gcc --version
111118
python3 --version
112119
msgfmt --version
113-
- uses: actions/checkout@v2
120+
- uses: actions/checkout@v2.2.0
114121
with:
115122
submodules: true
116123
fetch-depth: 0
117124
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
118-
- run: git submodule sync
119-
- run: git submodule foreach git remote -v
120-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
121125
- name: CircuitPython version
122126
run: git describe --dirty --tags
123127
- name: Build mpy-cross
@@ -145,6 +149,7 @@ jobs:
145149
- "arduino_zero"
146150
- "bast_pro_mini_m0"
147151
- "bdmicro_vina_m0"
152+
- "bless_dev_board_multi_sensor"
148153
- "capablerobot_usbhub"
149154
- "catwan_usbstick"
150155
- "circuitbrains_basic_m0"
@@ -193,6 +198,7 @@ jobs:
193198
- "itsybitsy_m4_express"
194199
- "itsybitsy_nrf52840_express"
195200
- "kicksat-sprite"
201+
- "loc_ber_m4_base_board"
196202
- "makerdiary_m60_keyboard"
197203
- "makerdiary_nrf52840_m2_devkit"
198204
- "makerdiary_nrf52840_mdk"
@@ -235,8 +241,11 @@ jobs:
235241
- "pyportal"
236242
- "pyportal_titano"
237243
- "pyruler"
244+
- "raytac_mdbt50q-db-40"
238245
- "robohatmm1_m4"
239246
- "sam32"
247+
- "same54_xplained"
248+
- "seeeduino_wio_terminal"
240249
- "seeeduino_xiao"
241250
- "serpente"
242251
- "shirtty"
@@ -288,14 +297,11 @@ jobs:
288297
gcc --version
289298
arm-none-eabi-gcc --version
290299
python3 --version
291-
- uses: actions/checkout@v2
300+
- uses: actions/checkout@v2.2.0
292301
with:
293302
submodules: true
294303
fetch-depth: 0
295304
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
296-
- run: git submodule sync
297-
- run: git submodule foreach git remote -v
298-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
299305
- name: mpy-cross
300306
run: make -C mpy-cross -j2
301307
- name: build
@@ -339,14 +345,11 @@ jobs:
339345
gcc --version
340346
riscv64-unknown-elf-gcc --version
341347
python3 --version
342-
- uses: actions/checkout@v2
348+
- uses: actions/checkout@v2.2.0
343349
with:
344350
submodules: true
345351
fetch-depth: 0
346352
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
347-
- run: git submodule sync
348-
- run: git submodule foreach git remote -v
349-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
350353
- name: mpy-cross
351354
run: make -C mpy-cross -j2
352355
- name: build
@@ -373,20 +376,18 @@ jobs:
373376
board:
374377
- "espressif_saola_1_wroom"
375378
- "espressif_saola_1_wrover"
379+
- "unexpectedmaker_feathers2"
376380

377381
steps:
378382
- name: Set up Python 3.8
379383
uses: actions/setup-python@v1
380384
with:
381385
python-version: 3.8
382-
- uses: actions/checkout@v2
386+
- uses: actions/checkout@v2.2.0
383387
with:
384388
submodules: true
385389
fetch-depth: 0
386390
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
387-
- run: git submodule sync
388-
- run: git submodule foreach git remote -v
389-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
390391
- name: CircuitPython version
391392
run: git describe --dirty --tags
392393
- uses: actions/cache@v1

.github/workflows/create_website_pr.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ jobs:
2323
run: |
2424
gcc --version
2525
python3 --version
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v2.2.0
2727
with:
2828
submodules: true
2929
fetch-depth: 0
3030
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
31-
- run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
3231
- name: CircuitPython version
3332
run: git describe --dirty --tags
3433
- name: Website

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: pre-commit
77
on:
88
pull_request:
99
push:
10-
branches: [master]
10+
branches: [main]
1111

1212
jobs:
1313
pre-commit:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ _build
5353
######################
5454
genrst/
5555
/autoapi/
56+
/shared-bindings/**/*.rst
5657

5758
# ctags and similar
5859
###################

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22
Please note that this project is released with a
3-
[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md).
3+
[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md).
44
By participating in this project you agree to abide by its terms. Participation
55
covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do
66
so will result in corrective actions such as time out or ban from the project.

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,49 @@ stubs:
243243
update-frozen-libraries:
244244
@echo "Updating all frozen libraries to latest tagged version."
245245
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
246+
247+
one-of-each: samd21 samd51 esp32s2 litex mimxrt10xx nrf stm
248+
249+
samd21:
250+
$(MAKE) -C ports/atmel-samd BOARD=trinket_m0
251+
252+
samd51:
253+
$(MAKE) -C ports/atmel-samd BOARD=feather_m4_express
254+
255+
esp32s2:
256+
$(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom
257+
258+
litex:
259+
$(MAKE) -C ports/litex BOARD=fomu
260+
261+
mimxrt10xx:
262+
$(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011
263+
264+
nrf:
265+
$(MAKE) -C ports/nrf BOARD=feather_nrf52840_express
266+
267+
stm:
268+
$(MAKE) -C ports/stm BOARD=feather_stm32f405_express
269+
270+
clean-one-of-each: clean-samd21 clean-samd51 clean-esp32s2 clean-litex clean-mimxrt10xx clean-nrf clean-stm
271+
272+
clean-samd21:
273+
$(MAKE) -C ports/atmel-samd BOARD=trinket_m0 clean
274+
275+
clean-samd51:
276+
$(MAKE) -C ports/atmel-samd BOARD=feather_m4_express clean
277+
278+
clean-esp32s2:
279+
$(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom clean
280+
281+
clean-litex:
282+
$(MAKE) -C ports/litex BOARD=fomu clean
283+
284+
clean-mimxrt10xx:
285+
$(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011 clean
286+
287+
clean-nrf:
288+
$(MAKE) -C ports/nrf BOARD=feather_nrf52840_express clean
289+
290+
clean-stm:
291+
$(MAKE) -C ports/stm BOARD=feather_stm32f405_express clean

README.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ Contributing
5555
------------
5656

5757
See
58-
`CONTRIBUTING.md <https://github.com/adafruit/circuitpython/blob/master/CONTRIBUTING.md>`__
58+
`CONTRIBUTING.md <https://github.com/adafruit/circuitpython/blob/main/CONTRIBUTING.md>`__
5959
for full guidelines but please be aware that by contributing to this
6060
project you are agreeing to the `Code of
61-
Conduct <https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md>`__.
61+
Conduct <https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md>`__.
6262
Contributors who follow the `Code of
63-
Conduct <https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md>`__
63+
Conduct <https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md>`__
6464
are welcome to submit pull requests and they will be promptly reviewed
6565
by project admins. Please join the
6666
`Discord <https://adafru.it/discord>`__ too.
@@ -96,7 +96,6 @@ CircuitPython:
9696

9797
- Supports native USB on all boards, allowing file editing without special tools.
9898
- Supports only SAMD21, SAMD51, nRF52840, CXD56, STM32F4 and i.MX RT ports.
99-
- Tracks MicroPython's releases (not master).
10099
- Floats (aka decimals) are enabled for all builds.
101100
- Error messages are translated into 10+ languages.
102101
- Does not support concurrency within Python (including interrupts and threading). Some concurrency
@@ -211,8 +210,8 @@ The remaining port directories not listed above are in the repo to maintain comp
211210

212211
`back to top <#circuitpython>`__
213212

214-
.. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master
215-
:target: https://travis-ci.org/adafruit/circuitpython
213+
.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg
214+
:target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain
216215
.. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest
217216
:target: http://circuitpython.readthedocs.io/
218217
.. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg

conf.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
# serve to show the default.
1515

1616
import json
17-
import sys
17+
import logging
1818
import os
19+
import subprocess
20+
import sys
21+
import urllib.parse
1922

2023
import recommonmark
21-
import subprocess
2224

2325
# If extensions (or modules to document with autodoc) are in another directory,
2426
# add these directories to sys.path here. If the directory is relative to the
@@ -79,6 +81,9 @@
7981
autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary']
8082
autoapi_template_dir = 'docs/autoapi/templates'
8183
autoapi_python_use_implicit_namespaces = True
84+
autoapi_root = "shared-bindings"
85+
86+
redirects_file = 'docs/redirects.txt'
8287

8388
# The encoding of source files.
8489
#source_encoding = 'utf-8-sig'
@@ -374,5 +379,47 @@
374379
"bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),
375380
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
376381

382+
# Adapted from sphinxcontrib-redirects
383+
from sphinx.builders import html as builders
384+
385+
TEMPLATE = """<html>
386+
<head><meta http-equiv="refresh" content="0; url=%s"/></head>
387+
</html>
388+
"""
389+
390+
391+
def generate_redirects(app):
392+
path = os.path.join(app.srcdir, app.config.redirects_file)
393+
if not os.path.exists(path):
394+
logging.error("Could not find redirects file at '%s'" % path)
395+
return
396+
397+
if not isinstance(app.builder, builders.StandaloneHTMLBuilder):
398+
logging.warn("The 'sphinxcontib-redirects' plugin is only supported "
399+
"by the 'html' builder and subclasses. Skipping...")
400+
logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})")
401+
return
402+
403+
with open(path) as redirects:
404+
for line in redirects.readlines():
405+
from_path, to_path = line.rstrip().split(' ')
406+
407+
logging.debug("Redirecting '%s' to '%s'" % (from_path, to_path))
408+
409+
from_path = os.path.splitext(from_path)[0] + ".html"
410+
to_path_prefix = '..%s' % os.path.sep * (
411+
len(from_path.split(os.path.sep)) - 1)
412+
to_path = to_path_prefix + to_path
413+
414+
redirected_filename = os.path.join(app.builder.outdir, from_path)
415+
redirected_directory = os.path.dirname(redirected_filename)
416+
if not os.path.exists(redirected_directory):
417+
os.makedirs(redirected_directory)
418+
419+
with open(redirected_filename, 'w') as f:
420+
f.write(TEMPLATE % urllib.parse.quote(to_path, '#/'))
421+
377422
def setup(app):
378423
app.add_css_file("customstyle.css")
424+
app.add_config_value('redirects_file', 'redirects', 'env')
425+
app.connect('builder-inited', generate_redirects)

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The latest documentation can be found at:
55
http://circuitpython.readthedocs.io/en/latest/
66

77
The documentation you see there is generated from the files in the whole tree:
8-
https://github.com/adafruit/circuitpython/tree/master
8+
https://github.com/adafruit/circuitpython/tree/main
99

1010
Building the documentation locally
1111
----------------------------------

docs/design_guide.rst

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
.. role:: strike
2+
13
Design Guide
24
============
35

46
This guide covers a variety of development practices for CircuitPython core and library APIs. These
57
APIs are both `built-into CircuitPython
6-
<https://github.com/adafruit/circuitpython/tree/master/shared-bindings>`_ and those that are
8+
<https://github.com/adafruit/circuitpython/tree/main/shared-bindings>`_ and those that are
79
`distributed on GitHub <https://github.com/search?utf8=%E2%9C%93&q=topic%3Acircuitpython&type=>`_
810
and in the `Adafruit <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_ and `Community
911
<https://github.com/adafruit/CircuitPython_Community_Bundle/>`_ bundles. Consistency with these
@@ -46,6 +48,41 @@ not have the ``adafruit_`` module or package prefix.
4648

4749
Both should have the CircuitPython repository topic on GitHub.
4850

51+
Terminology
52+
-----------
53+
54+
As our Code of Conduct states, we strive to use "welcoming and inclusive
55+
language." Whether it is in documentation or in code, the words we use matter.
56+
This means we disfavor language that due to historical and social context can
57+
make community members and potential community members feel unwelcome.
58+
59+
There are specific terms to avoid except where technical limitations require it.
60+
While specific cases may call for other terms, consider using these suggested
61+
terms first:
62+
63+
+--------------------+---------------------+
64+
| Preferred | Deprecated |
65+
+====================+=====================+
66+
| Main (device) | :strike:`Master` |
67+
+--------------------+---------------------+
68+
| Peripheral | :strike:`Slave` |
69+
+--------------------+ +
70+
| Sensor | |
71+
+--------------------+ +
72+
| Secondary (device) | |
73+
+--------------------+---------------------+
74+
| Denylist | :strike:`Blacklist` |
75+
+--------------------+---------------------+
76+
| Allowlist | :strike:`Whitelist` |
77+
+--------------------+---------------------+
78+
79+
Note that "technical limitations" refers e.g., to the situation where an
80+
upstream library or URL has to contain those substrings in order to work.
81+
However, when it comes to documentation and the names of parameters and
82+
properties in CircuitPython, we will use alternate terms even if this breaks
83+
tradition with past practice.
84+
85+
4986
.. _lifetime-and-contextmanagers:
5087

5188
Lifetime and ContextManagers

0 commit comments

Comments
 (0)