Skip to content

Commit 7814bde

Browse files
committed
Merge and release
2 parents 2a5a5b1 + 9173d82 commit 7814bde

16 files changed

+196
-188
lines changed

mip/full.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"urls": [
3-
[
4-
"createstubs.py",
5-
"github:josverl/micropython-stubber/src/stubber/board/createstubs.py"
6-
],
7-
[
8-
"createstubs_db.py",
9-
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_db.py"
10-
],
11-
[
12-
"createstubs_mem.py",
13-
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_mem.py"
14-
],
15-
[
16-
"modulelist.txt",
17-
"github:Josverl/micropython-stubber/src/stubber/board/modulelist.txt"
18-
]
2+
"urls": [
3+
[
4+
"createstubs.py",
5+
"github:josverl/micropython-stubber/src/stubber/board/createstubs.py"
196
],
20-
"deps": [],
21-
"version": "1.17.4"
22-
}
7+
[
8+
"createstubs_db.py",
9+
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_db.py"
10+
],
11+
[
12+
"createstubs_mem.py",
13+
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_mem.py"
14+
],
15+
[
16+
"modulelist.txt",
17+
"github:Josverl/micropython-stubber/src/stubber/board/modulelist.txt"
18+
]
19+
],
20+
"deps": [],
21+
"version": "1.17.5"
22+
}

mip/minified.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"urls": [
3-
[
4-
"createstubs.py",
5-
"github:josverl/micropython-stubber/src/stubber/board/createstubs_min.py"
6-
],
7-
[
8-
"createstubs_db.py",
9-
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_db_min.py"
10-
],
11-
[
12-
"createstubs_mem.py",
13-
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_mem_min.py"
14-
],
15-
[
16-
"modulelist.txt",
17-
"github:Josverl/micropython-stubber/src/stubber/board/modulelist.txt"
18-
]
2+
"urls": [
3+
[
4+
"createstubs.py",
5+
"github:josverl/micropython-stubber/src/stubber/board/createstubs_min.py"
196
],
20-
"deps": [],
21-
"version": "1.17.4"
22-
}
7+
[
8+
"createstubs_db.py",
9+
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_db_min.py"
10+
],
11+
[
12+
"createstubs_mem.py",
13+
"github:Josverl/micropython-stubber/src/stubber/board/createstubs_mem_min.py"
14+
],
15+
[
16+
"modulelist.txt",
17+
"github:Josverl/micropython-stubber/src/stubber/board/modulelist.txt"
18+
]
19+
],
20+
"deps": [],
21+
"version": "1.17.5"
22+
}

mip/mpy_v5.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"urls": [
3-
[
4-
"createstubs.mpy",
5-
"github:josverl/micropython-stubber/mip/v5/createstubs_mpy.mpy"
6-
],
7-
[
8-
"createstubs_db.mpy",
9-
"github:Josverl/micropython-stubber/mip/v5/createstubs_db_mpy.mpy"
10-
],
11-
[
12-
"createstubs_mem.mpy",
13-
"github:Josverl/micropython-stubber/mip/v5/createstubs_mem_mpy.mpy"
14-
],
15-
[
16-
"modulelist.txt",
17-
"github:Josverl/micropython-stubber/mip/v5/modulelist.txt"
18-
]
2+
"urls": [
3+
[
4+
"createstubs.mpy",
5+
"github:josverl/micropython-stubber/mip/v5/createstubs_mpy.mpy"
196
],
20-
"deps": [],
21-
"version": "1.17.4"
22-
}
7+
[
8+
"createstubs_db.mpy",
9+
"github:Josverl/micropython-stubber/mip/v5/createstubs_db_mpy.mpy"
10+
],
11+
[
12+
"createstubs_mem.mpy",
13+
"github:Josverl/micropython-stubber/mip/v5/createstubs_mem_mpy.mpy"
14+
],
15+
[
16+
"modulelist.txt",
17+
"github:Josverl/micropython-stubber/mip/v5/modulelist.txt"
18+
]
19+
],
20+
"deps": [],
21+
"version": "1.17.5"
22+
}

mip/mpy_v6.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"urls": [
3-
[
4-
"createstubs.mpy",
5-
"github:josverl/micropython-stubber/mip/v6/createstubs_mpy.mpy"
6-
],
7-
[
8-
"createstubs_mem.mpy",
9-
"github:Josverl/micropython-stubber/mip/v6/createstubs_mem_mpy.mpy"
10-
],
11-
[
12-
"createstubs_db.mpy",
13-
"github:Josverl/micropython-stubber/mip/v6/createstubs_db_mpy.mpy"
14-
],
15-
[
16-
"modulelist.txt",
17-
"github:Josverl/micropython-stubber/mip/v6/modulelist.txt"
18-
]
2+
"urls": [
3+
[
4+
"createstubs.mpy",
5+
"github:josverl/micropython-stubber/mip/v6/createstubs_mpy.mpy"
196
],
20-
"deps": [],
21-
"version": "1.17.4"
22-
}
7+
[
8+
"createstubs_mem.mpy",
9+
"github:Josverl/micropython-stubber/mip/v6/createstubs_mem_mpy.mpy"
10+
],
11+
[
12+
"createstubs_db.mpy",
13+
"github:Josverl/micropython-stubber/mip/v6/createstubs_db_mpy.mpy"
14+
],
15+
[
16+
"modulelist.txt",
17+
"github:Josverl/micropython-stubber/mip/v6/modulelist.txt"
18+
]
19+
],
20+
"deps": [],
21+
"version": "1.17.5"
22+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
]
1919
],
2020
"deps": [],
21-
"version": "1.17.4"
21+
"version": "1.17.5"
2222
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repo-path = "./repos"
88

99
[tool.poetry]
1010
name = "micropython-stubber"
11-
version = "1.17.4"
11+
version = "1.17.5"
1212
description = "Tooling to create and maintain stubs for MicroPython"
1313
authors = ["Jos Verlinde <[email protected]>"]
1414
license = "MIT"

src/stubber/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
"""get the version"""
22

3-
4-
__version__ = "1.17.4"
3+
__version__ = "1.17.5"

src/stubber/board/createstubs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
except ImportError:
2525
from ucollections import OrderedDict # type: ignore
2626

27-
__version__ = "v1.17.4"
27+
__version__ = "v1.17.5"
2828
ENOENT = 2
2929
_MAX_CLASS_LEVEL = 2 # Max class nesting
3030
LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
@@ -363,6 +363,8 @@ def write_object_stub(self, fp, object_expr: object, obj_name: str, indent: str,
363363
else:
364364
# Requires Python 3.6 syntax, which is OK for the stubs/pyi
365365
t = "Incomplete"
366+
if " at " in item_repr:
367+
item_repr = item_repr.split(" at ")[0] + " at ...>"
366368
if " at " in item_repr:
367369
item_repr = item_repr.split(" at ")[0] + " at ...>"
368370
s = "{0}{1}: {2} ## {3} = {4}\n".format(indent, item_name, t, item_type_txt, item_repr)

src/stubber/board/createstubs_db.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- cross compilation, using mpy-cross, to avoid the compilation step on the micropython device
1919
2020
21-
This variant was generated from createstubs.py by micropython-stubber v1.17.4
21+
This variant was generated from createstubs.py by micropython-stubber v1.17.5
2222
"""
2323

2424
# Copyright (c) 2019-2023 Jos Verlinde
@@ -43,7 +43,7 @@
4343
except ImportError:
4444
from ucollections import OrderedDict # type: ignore
4545

46-
__version__ = "v1.17.4"
46+
__version__ = "v1.17.5"
4747
ENOENT = 2
4848
_MAX_CLASS_LEVEL = 2 # Max class nesting
4949
LIBS = ["lib", "/lib", "/sd/lib", "/flash/lib", "."]
@@ -376,6 +376,8 @@ def write_object_stub(self, fp, object_expr: object, obj_name: str, indent: str,
376376
else:
377377
# Requires Python 3.6 syntax, which is OK for the stubs/pyi
378378
t = "Incomplete"
379+
if " at " in item_repr:
380+
item_repr = item_repr.split(" at ")[0] + " at ...>"
379381
if " at " in item_repr:
380382
item_repr = item_repr.split(" at ")[0] + " at ...>"
381383
s = "{0}{1}: {2} ## {3} = {4}\n".format(indent, item_name, t, item_type_txt, item_repr)

src/stubber/board/createstubs_db_min.py

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
except O:pass
5252
try:from collections import OrderedDict as k
5353
except O:from ucollections import OrderedDict as k
54-
__version__='v1.17.4'
54+
__version__='v1.17.5'
5555
A3=2
5656
A4=2
5757
A5=['lib','/lib','/sd/lib','/flash/lib',J]
@@ -131,40 +131,41 @@ def create_module_stub(K,module_name,file_name=E):
131131
try:del N
132132
except(D,q):A.warning('could not del new_module')
133133
F.collect();return R
134-
def write_object_stub(K,fp,object_expr,obj_name,indent,in_class=0):
135-
Y=' at ';X='generator';W='{0}{1}: {3} = {2}\n';V='bound_method';U='Incomplete';N=in_class;M='Exception';L=object_expr;I=fp;D=indent;F.collect()
136-
if L in K.problematic:A.warning('SKIPPING problematic module:{}'.format(L));return
137-
Z,O=K.get_obj_attributes(L)
138-
if O:A.error(O)
139-
for(E,J,H,a,c)in Z:
140-
if E in['classmethod','staticmethod','BaseException',M]:continue
134+
def write_object_stub(L,fp,object_expr,obj_name,indent,in_class=0):
135+
Z=' at ...>';Y='generator';X='{0}{1}: {3} = {2}\n';W='bound_method';V='Incomplete';O=in_class;N='Exception';M=object_expr;K=' at ';J=fp;D=indent;F.collect()
136+
if M in L.problematic:A.warning('SKIPPING problematic module:{}'.format(M));return
137+
a,Q=L.get_obj_attributes(M)
138+
if Q:A.error(Q)
139+
for(E,H,I,b,g)in a:
140+
if E in['classmethod','staticmethod','BaseException',N]:continue
141141
if E[0].isdigit():A.warning('NameError: invalid name {}'.format(E));continue
142-
if H=="<class 'type'>"and P(D)<=A4*4:
143-
Q=B;R=E.endswith(M)or E.endswith('Error')or E in['KeyboardInterrupt','StopIteration','SystemExit']
144-
if R:Q=M
145-
C='\n{}class {}({}):\n'.format(D,E,Q)
146-
if R:C+=D+' ...\n';I.write(C);continue
147-
I.write(C);K.write_object_stub(I,a,'{0}.{1}'.format(obj_name,E),D+' ',N+1);C=D+' def __init__(self, *argv, **kwargs) -> None:\n';C+=D+' ...\n\n';I.write(C)
148-
elif any(A in H for A in[A0,z,'closure']):
149-
S=U;T=B
150-
if N>0:T='self, '
151-
if V in H or V in J:C='{}@classmethod\n'.format(D)+'{}def {}(cls, *args, **kwargs) -> {}:\n'.format(D,E,S)
152-
else:C='{}def {}({}*args, **kwargs) -> {}:\n'.format(D,E,T,S)
153-
C+=D+' ...\n\n';I.write(C)
154-
elif H=="<class 'module'>":0
155-
elif H.startswith("<class '"):
156-
G=H[8:-2];C=B
157-
if G in(x,v,w,y,'bytearray','bytes'):C=W.format(D,E,J,G)
158-
elif G in(f,e,d):b={f:'{}',e:'[]',d:'()'};C=W.format(D,E,b[G],G)
159-
elif G in('object','set','frozenset','Pin',X):
160-
if G==X:G='Generator'
161-
C='{0}{1}: {2} ## = {4}\n'.format(D,E,G,H,J)
142+
if I=="<class 'type'>"and P(D)<=A4*4:
143+
R=B;S=E.endswith(N)or E.endswith('Error')or E in['KeyboardInterrupt','StopIteration','SystemExit']
144+
if S:R=N
145+
C='\n{}class {}({}):\n'.format(D,E,R)
146+
if S:C+=D+' ...\n';J.write(C);continue
147+
J.write(C);L.write_object_stub(J,b,'{0}.{1}'.format(obj_name,E),D+' ',O+1);C=D+' def __init__(self, *argv, **kwargs) -> None:\n';C+=D+' ...\n\n';J.write(C)
148+
elif any(A in I for A in[A0,z,'closure']):
149+
T=V;U=B
150+
if O>0:U='self, '
151+
if W in I or W in H:C='{}@classmethod\n'.format(D)+'{}def {}(cls, *args, **kwargs) -> {}:\n'.format(D,E,T)
152+
else:C='{}def {}({}*args, **kwargs) -> {}:\n'.format(D,E,U,T)
153+
C+=D+' ...\n\n';J.write(C)
154+
elif I=="<class 'module'>":0
155+
elif I.startswith("<class '"):
156+
G=I[8:-2];C=B
157+
if G in(x,v,w,y,'bytearray','bytes'):C=X.format(D,E,H,G)
158+
elif G in(f,e,d):c={f:'{}',e:'[]',d:'()'};C=X.format(D,E,c[G],G)
159+
elif G in('object','set','frozenset','Pin',Y):
160+
if G==Y:G='Generator'
161+
C='{0}{1}: {2} ## = {4}\n'.format(D,E,G,I,H)
162162
else:
163-
G=U
164-
if Y in J:J=J.split(Y)[0]+' at ...>'
165-
C='{0}{1}: {2} ## {3} = {4}\n'.format(D,E,G,H,J)
166-
I.write(C)
167-
else:I.write("# all other, type = '{0}'\n".format(H));I.write(D+E+' # type: Incomplete\n')
163+
G=V
164+
if K in H:H=H.split(K)[0]+Z
165+
if K in H:H=H.split(K)[0]+Z
166+
C='{0}{1}: {2} ## {3} = {4}\n'.format(D,E,G,I,H)
167+
J.write(C)
168+
else:J.write("# all other, type = '{0}'\n".format(I));J.write(D+E+' # type: Incomplete\n')
168169
@property
169170
def flat_fwid(self):
170171
A=self._fwid;B=' .()/\\:$'

0 commit comments

Comments
 (0)