File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
# Packages
14
14
# ###########
15
+ dist /
16
+ * .egg-info
15
17
16
18
# Logs and Databases
17
19
# #####################
25
27
# #####################
26
28
build /
27
29
bin /
30
+ circuitpython-stubs /
28
31
29
32
# Test failure outputs
30
33
# #####################
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ CONFDIR = .
17
17
FORCE = -E
18
18
VERBOSE = -v
19
19
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
+
20
27
# Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the
21
28
# full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the
22
29
# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
@@ -31,7 +38,7 @@ I18NSPHINXOPTS = $(BASEOPTS)
31
38
32
39
TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/nrf py shared-bindings shared-module supervisor
33
40
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
35
42
36
43
help :
37
44
@echo " Please use \` make <target>' where <target> is one of"
60
67
61
68
clean :
62
69
rm -rf $(BUILDDIR ) /*
70
+ rm -rf $(STUBDIR ) $(DISTDIR ) * .egg-info
63
71
64
72
html :
65
73
$(SPHINXBUILD ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
@@ -203,3 +211,7 @@ translate: locale/circuitpython.pot
203
211
204
212
check-translate : locale/circuitpython.pot $(wildcard locale/* .po)
205
213
$(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.3.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
+ maintainer = "CircuitPythonistas" ,
16
+ author_email = "circuitpython@adafruit.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