Skip to content

Commit e99efa2

Browse files
author
Kenny
authored
Merge branch 'master' into vectorio-polygon-speed
2 parents 05a6f31 + 0d8bca9 commit e99efa2

File tree

158 files changed

+4737
-5612
lines changed

Some content is hidden

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

158 files changed

+4737
-5612
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: |
3535
sudo apt-get install -y eatmydata
3636
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64
37-
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml
37+
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid
3838
- name: Versions
3939
run: |
4040
gcc --version
@@ -64,6 +64,8 @@ jobs:
6464
- name: mpy Tests
6565
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
6666
working-directory: tests
67+
- name: Stubs
68+
run: make stubs -j2
6769
- name: Docs
6870
run: sphinx-build -E -W -b html . _build/html
6971
- name: Translations

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
############
1515
dist/
1616
*.egg-info
17+
.eggs
1718

1819
# Logs and Databases
1920
######################
@@ -51,6 +52,7 @@ _build
5152
# Generated rst files
5253
######################
5354
genrst/
55+
/autoapi/
5456

5557
# ctags and similar
5658
###################

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ help:
6767

6868
clean:
6969
rm -rf $(BUILDDIR)/*
70+
rm -rf autoapi
7071
rm -rf $(STUBDIR) $(DISTDIR) *.egg-info
7172

72-
html:
73+
html: stubs
7374
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
7475
@echo
7576
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
@@ -213,8 +214,10 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
213214
$(PYTHON) tools/check_translations.py $^
214215

215216
stubs:
216-
rst2pyi $(VALIDATE) shared-bindings/ $(STUBDIR)
217-
python setup.py sdist
217+
@mkdir -p circuitpython-stubs
218+
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
219+
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
220+
@$(PYTHON) setup.py -q sdist
218221

219222
update-frozen-libraries:
220223
@echo "Updating all frozen libraries to latest tagged version."

conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
'sphinx.ext.todo',
5656
'sphinx.ext.coverage',
5757
'rstjinja',
58-
'c2rst',
5958
'recommonmark',
6059
]
6160

@@ -66,9 +65,18 @@
6665
source_suffix = {
6766
'.rst': 'restructuredtext',
6867
'.md': 'markdown',
69-
'.c': ''
7068
}
7169

70+
extensions.append('autoapi.extension')
71+
72+
autoapi_type = 'python'
73+
# Uncomment this if debugging autoapi
74+
autoapi_keep_files = True
75+
autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circuitpython-stubs')]
76+
autoapi_add_toctree_entry = False
77+
autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary']
78+
autoapi_template_dir = 'docs/autoapi/templates'
79+
autoapi_python_use_implicit_namespaces = True
7280

7381
# The encoding of source files.
7482
#source_encoding = 'utf-8-sig'
@@ -78,7 +86,7 @@
7886

7987
# General information about the project.
8088
project = 'Adafruit CircuitPython'
81-
copyright = '2014-2018, MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)'
89+
copyright = '2014-2020, MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)'
8290

8391
# These are overwritten on ReadTheDocs.
8492
# The version info for the project you're documenting, acts as replacement for
@@ -105,6 +113,7 @@
105113
".git",
106114
".venv",
107115
".direnv",
116+
"docs/autoapi",
108117
"docs/README.md",
109118
"drivers",
110119
"examples",
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{% if not obj.display %}
2+
:orphan:
3+
4+
{% endif %}
5+
:mod:`{{ obj.name }}`
6+
======={{ "=" * obj.name|length }}
7+
8+
.. py:module:: {{ obj.name }}
9+
10+
{% if obj.docstring %}
11+
.. autoapi-nested-parse::
12+
13+
{{ obj.docstring|prepare_docstring|indent(3) }}
14+
15+
{% endif %}
16+
17+
{% block subpackages %}
18+
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
19+
{% if visible_subpackages %}
20+
.. toctree::
21+
:titlesonly:
22+
:maxdepth: 3
23+
24+
{% for subpackage in visible_subpackages %}
25+
{{ subpackage.short_name }}/index.rst
26+
{% endfor %}
27+
28+
29+
{% endif %}
30+
{% endblock %}
31+
{% block submodules %}
32+
{% set visible_submodules = obj.submodules|selectattr("display")|list %}
33+
{% if visible_submodules %}
34+
35+
.. toctree::
36+
:titlesonly:
37+
:maxdepth: 1
38+
39+
{% for submodule in visible_submodules %}
40+
{{ submodule.short_name }}/index.rst
41+
{% endfor %}
42+
43+
44+
{% endif %}
45+
{% endblock %}
46+
{% block content %}
47+
{% if obj.all is not none %}
48+
{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
49+
{% elif obj.type is equalto("package") %}
50+
{% set visible_children = obj.children|selectattr("display")|list %}
51+
{% else %}
52+
{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
53+
{% endif %}
54+
{% if visible_children %}
55+
56+
{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
57+
{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
58+
{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
59+
{% block classes %}
60+
{% if visible_classes %}
61+
Classes
62+
~~~~~~~
63+
64+
.. autoapisummary::
65+
66+
{% for klass in visible_classes %}
67+
{{ klass.id }}
68+
{% endfor %}
69+
70+
71+
{% endif %}
72+
{% endblock %}
73+
74+
{% block functions %}
75+
{% if visible_functions %}
76+
Functions
77+
~~~~~~~~~
78+
79+
.. autoapisummary::
80+
81+
{% for function in visible_functions %}
82+
{{ function.id }}
83+
{% endfor %}
84+
85+
86+
{% endif %}
87+
{% endblock %}
88+
{% endif %}
89+
{% for obj_item in visible_children %}
90+
{{ obj_item.rendered|indent(0) }}
91+
{% endfor %}
92+
{% endif %}
93+
{% endblock %}

docs/c2rst.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)