Skip to content

Commit 2a2a8d6

Browse files
authored
Merge pull request #28 from adafruit/main
Merge from adafruit/main
2 parents 4a3be4d + 3d8bac5 commit 2a2a8d6

File tree

480 files changed

+31164
-4822
lines changed

Some content is hidden

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

480 files changed

+31164
-4822
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install deps
3737
run: |
3838
sudo apt-get install -y eatmydata
39-
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64
39+
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
4040
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli
4141
- name: Versions
4242
run: |
@@ -73,12 +73,19 @@ jobs:
7373
with:
7474
name: stubs
7575
path: circuitpython-stubs*
76-
- name: Docs
76+
- name: Test Documentation Build (HTML)
7777
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
7878
- uses: actions/upload-artifact@v2
7979
with:
8080
name: docs
8181
path: _build/html
82+
- name: Test Documentation Build (LaTeX/PDF)
83+
run: |
84+
make latexpdf
85+
- uses: actions/upload-artifact@v2
86+
with:
87+
name: docs
88+
path: _build/latex
8289
- name: Translations
8390
run: make check-translate
8491
- name: New boards check
@@ -227,6 +234,7 @@ jobs:
227234
- "makerdiary_nrf52840_m2_devkit"
228235
- "makerdiary_nrf52840_mdk"
229236
- "makerdiary_nrf52840_mdk_usb_dongle"
237+
- "matrixportal_m4"
230238
- "meowbit_v121"
231239
- "meowmeow"
232240
- "metro_m0_express"
@@ -253,6 +261,7 @@ jobs:
253261
- "pca10100"
254262
- "pewpew10"
255263
- "pewpew_m4"
264+
- "picoplanet"
256265
- "pirkey_m0"
257266
- "pitaya_go"
258267
- "pyb_nano_v2"
@@ -266,6 +275,7 @@ jobs:
266275
- "pyportal"
267276
- "pyportal_titano"
268277
- "pyruler"
278+
- "qtpy_m0"
269279
- "raytac_mdbt50q-db-40"
270280
- "robohatmm1_m4"
271281
- "sam32"
@@ -400,8 +410,11 @@ jobs:
400410
fail-fast: false
401411
matrix:
402412
board:
413+
- "electroniccats_bastwifi"
414+
- "espressif_kaluga_1"
403415
- "espressif_saola_1_wroom"
404416
- "espressif_saola_1_wrover"
417+
- "microdev_micro_s2"
405418
- "unexpectedmaker_feathers2"
406419

407420
steps:
@@ -422,6 +435,11 @@ jobs:
422435
with:
423436
path: ${{ github.workspace }}/.idf_tools
424437
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801
438+
- name: Clone IDF submodules
439+
run: |
440+
(cd $IDF_PATH && git submodule update --init)
441+
env:
442+
IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
425443
- name: Install IDF tools
426444
run: |
427445
$IDF_PATH/tools/idf_tools.py --non-interactive install required

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ _build
5757
######################
5858
genrst/
5959
/autoapi/
60-
/shared-bindings/**/*.rst
60+
/shared-bindings/*/**/*.rst
6161

6262
# ctags and similar
6363
###################
@@ -80,3 +80,8 @@ TAGS
8080
*.mo
8181

8282
.vscode
83+
84+
# Python Virtual Environments
85+
####################
86+
.venv
87+
.env

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,9 @@
147147
[submodule "ports/esp32s2/esp-idf"]
148148
path = ports/esp32s2/esp-idf
149149
url = https://github.com/tannewt/esp-idf.git
150+
[submodule "frozen/Adafruit_CircuitPython_RFM9x"]
151+
path = frozen/Adafruit_CircuitPython_RFM9x
152+
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git
153+
[submodule "frozen/Adafruit_CircuitPython_RFM69"]
154+
path = frozen/Adafruit_CircuitPython_RFM69
155+
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git

.readthedocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
version: 2
1010

11+
submodules:
12+
include:
13+
- extmod/ulab
14+
15+
formats:
16+
- pdf
17+
1118
python:
1219
version: 3
1320
install:

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ stubs:
245245
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
246246
@$(PYTHON) setup.py -q sdist
247247

248+
.PHONY: check-stubs
249+
check-stubs: stubs
250+
MYPYPATH=$(STUBDIR) mypy --strict $(STUBDIR)
251+
248252
update-frozen-libraries:
249253
@echo "Updating all frozen libraries to latest tagged version."
250254
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done

conf.py

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717
#
1818
# SPDX-License-Identifier: MIT
1919

20-
import json
2120
import logging
2221
import os
22+
import re
2323
import subprocess
2424
import sys
2525
import urllib.parse
2626

2727
import recommonmark
28+
from sphinx.transforms import SphinxTransform
29+
from docutils import nodes
30+
from sphinx import addnodes
2831

2932
# If extensions (or modules to document with autodoc) are in another directory,
3033
# add these directories to sys.path here. If the directory is relative to the
@@ -39,6 +42,9 @@
3942
# Grab the JSON values to use while building the module support matrix
4043
# in 'shared-bindings/index.rst'
4144

45+
# The stubs must be built before we calculate the shared bindings matrix
46+
subprocess.check_output(["make", "stubs"])
47+
4248
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
4349
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
4450

@@ -74,7 +80,6 @@
7480
'.md': 'markdown',
7581
}
7682

77-
subprocess.check_output(["make", "stubs"])
7883
extensions.append('autoapi.extension')
7984

8085
autoapi_type = 'python'
@@ -84,6 +89,7 @@
8489
autoapi_add_toctree_entry = False
8590
autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary']
8691
autoapi_template_dir = 'docs/autoapi/templates'
92+
autoapi_python_class_content = "both"
8793
autoapi_python_use_implicit_namespaces = True
8894
autoapi_root = "shared-bindings"
8995

@@ -106,7 +112,25 @@
106112
#
107113
# We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags"
108114
# breakdown, so use the same version identifier for both to avoid confusion.
109-
version = release = '0.0.0'
115+
116+
final_version = ""
117+
git_describe = subprocess.run(
118+
["git", "describe", "--dirty", "--tags"],
119+
stdout=subprocess.PIPE,
120+
stderr=subprocess.STDOUT,
121+
encoding="utf-8"
122+
)
123+
if git_describe.returncode == 0:
124+
git_version = re.search(
125+
r"^\d(?:\.\d){0,2}(?:\-(?:alpha|beta|rc)\.\d+){0,1}",
126+
str(git_describe.stdout)
127+
)
128+
if git_version:
129+
final_version = git_version[0]
130+
else:
131+
print("Failed to retrieve git version:", git_describe.stdout)
132+
133+
version = release = final_version
110134

111135
# The language for content autogenerated by Sphinx. Refer to documentation
112136
# for a list of supported languages.
@@ -122,6 +146,7 @@
122146
# directories to ignore when looking for source files.
123147
exclude_patterns = ["**/build*",
124148
".git",
149+
".env",
125150
".venv",
126151
".direnv",
127152
"docs/autoapi",
@@ -423,7 +448,38 @@ def generate_redirects(app):
423448
with open(redirected_filename, 'w') as f:
424449
f.write(TEMPLATE % urllib.parse.quote(to_path, '#/'))
425450

451+
452+
class CoreModuleTransform(SphinxTransform):
453+
default_priority = 870
454+
455+
def _convert_first_paragraph_into_title(self):
456+
title = self.document.next_node(nodes.title)
457+
paragraph = self.document.next_node(nodes.paragraph)
458+
if not title or not paragraph:
459+
return
460+
if isinstance(paragraph[0], nodes.paragraph):
461+
paragraph = paragraph[0]
462+
if all(isinstance(child, nodes.Text) for child in paragraph.children):
463+
for child in paragraph.children:
464+
title.append(nodes.Text(" \u2013 "))
465+
title.append(child)
466+
paragraph.parent.remove(paragraph)
467+
468+
def _enable_linking_to_nonclass_targets(self):
469+
for desc in self.document.traverse(addnodes.desc):
470+
for xref in desc.traverse(addnodes.pending_xref):
471+
if xref.attributes.get("reftype") == "class":
472+
xref.attributes.pop("refspecific", None)
473+
474+
def apply(self, **kwargs):
475+
docname = self.env.docname
476+
if docname.startswith(autoapi_root) and docname.endswith("/index"):
477+
self._convert_first_paragraph_into_title()
478+
self._enable_linking_to_nonclass_targets()
479+
480+
426481
def setup(app):
427482
app.add_css_file("customstyle.css")
428483
app.add_config_value('redirects_file', 'redirects', 'env')
429484
app.connect('builder-inited', generate_redirects)
485+
app.add_transform(CoreModuleTransform)

0 commit comments

Comments
 (0)