File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313# Packages
1414# ###########
15+ dist /
16+ * .egg-info
1517
1618# Logs and Databases
1719# #####################
2527# #####################
2628build /
2729bin /
30+ circuitpython-stubs /
2831
2932# Test failure outputs
3033# #####################
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ CONFDIR = .
1717FORCE = -E
1818VERBOSE = -v
1919
20+ # path to generated type stubs
21+ STUBDIR = circuitpython-stubs
22+ # Run "make VALIDATE= stubs" to avoid validating generated stub files
23+ VALIDATE = -v
24+ # path to pypi source distributions
25+ DISTDIR = dist
26+
2027# Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the
2128# full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the
2229# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
@@ -31,7 +38,7 @@ I18NSPHINXOPTS = $(BASEOPTS)
3138
3239TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/nrf py shared-bindings shared-module supervisor
3340
34- .PHONY : help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
41+ .PHONY : help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs
3542
3643help :
3744 @echo " Please use \` make <target>' where <target> is one of"
6067
6168clean :
6269 rm -rf $(BUILDDIR ) /*
70+ rm -rf $(STUBDIR ) $(DISTDIR )
6371
6472html :
6573 $(SPHINXBUILD ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
@@ -203,3 +211,7 @@ translate: locale/circuitpython.pot
203211
204212check-translate : locale/circuitpython.pot $(wildcard locale/* .po)
205213 $(PYTHON ) tools/check_translations.py $^
214+
215+ stubs :
216+ rst2pyi $(VALIDATE ) shared-bindings/ $(STUBDIR )
217+ python setup.py sdist
Original file line number Diff line number Diff line change 1+ rst2pyi =0.1.0
Original file line number Diff line number Diff line change 1+ from datetime import datetime
2+ from setuptools import setup
3+ from pathlib import Path
4+
5+ stub_root = Path ("circuitpython-stubs" )
6+ stubs = [p .relative_to (stub_root ).as_posix () for p in stub_root .glob ("*.pyi" )]
7+
8+ now = datetime .utcnow ()
9+ version = now .strftime ("%Y.%m.%d" )
10+
11+ setup (
12+ name = "circuitpython-stubs" ,
13+ description = "PEP 561 type stubs for CircuitPython" ,
14+ url = "https://github.com/adafruit/circuitpython" ,
15+ author = "John Reese" ,
16+ author_email = "john@noswap.com" ,
17+ version = version ,
18+ license = "MIT" ,
19+ package_data = {"circuitpython-stubs" : stubs },
20+ packages = ["circuitpython-stubs" ],
21+ setup_requires = ["setuptools>=38.6.0" ],
22+ )
You can’t perform that action at this time.
0 commit comments