Skip to content

Commit

Permalink
stubber: Add port specific modules.
Browse files Browse the repository at this point in the history
closes: #630

Signed-off-by: Jos Verlinde <[email protected]>
  • Loading branch information
Josverl committed Dec 10, 2024
1 parent a6fe004 commit d6b305d
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 114 deletions.
22 changes: 22 additions & 0 deletions data/micropython-allports.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# manual entry
# ref : https://github.com/micropython/micropython/pull/16381
# Lets assume there may be a module named for the port

cc3200
embed
esp32
esp8266
mimxrt
nrf
pic16bit
powerpc
qemu
renesas-ra
renesas
rp2
samd
stm32
unix
webassembly
windows
zephyr
78 changes: 42 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ mpremote = "mpremote.main:main"
python = ">=3.9,<4.0"
python-minifier = { version = "^2.7.0", python = "<3.14" }
requests = "^2.32.3"
mypy = "1.10.1"
mpflash = "^1.24.0"
mpremote = "^1.23.0"
mypy = ">=1.10"
mpflash = ">=1.24.2"
mpremote = ">=1.24.1"
# others
autoflake = ">=1.7,<3.0"
black = ">=22.10,<25.0"
Expand All @@ -66,8 +66,8 @@ mypy-gitlab-code-quality = "^1.1.0"
packaging = ">=21.3,<24.0"
pipx = "^1.1.0"
pygithub = "^2.1.1"
pyright = "^1.1.341"
pyserial = "^3.5"
pyright = ">=1.1.341"
pyserial = ">=3.5"
pysondb-v2 = "^2.1.0"
pypi-simple = "^1.0.0"
rich-click = "^1.8.3"
Expand Down
14 changes: 14 additions & 0 deletions src/stubber/board/createstubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ def main():
"breakout_trackball",
"breakout_vl53l5cx",
"btree",
"cc3200",
"cmath",
"collections",
"crypto",
Expand All @@ -811,10 +812,12 @@ def main():
"display",
"display_driver_utils",
"ds18x20",
"embed",
"encoder",
"errno",
"esp",
"esp32",
"esp8266",
"espidf",
"espnow",
"ffi",
Expand Down Expand Up @@ -854,6 +857,7 @@ def main():
"microWebSrv",
"microWebTemplate",
"micropython",
"mimxrt",
"mip",
"mip/__init__",
"mip/__main__",
Expand All @@ -862,11 +866,13 @@ def main():
"mpu9250",
"neopixel",
"network",
"nrf",
"ntptime",
"onewire",
"openamp",
"os",
"pcf85063a",
"pic16bit",
"picoexplorer",
"picographics",
"picokeypad",
Expand All @@ -878,12 +884,16 @@ def main():
"pimoroni_i2c",
"plasma",
"platform",
"powerpc",
"pyb",
"pycom",
"pye",
"qemu",
"qrcode",
"queue",
"random",
"renesas",
"renesas-ra",
"requests",
"requests/__init__",
"rp2",
Expand All @@ -896,6 +906,7 @@ def main():
"ssh",
"ssl",
"stm",
"stm32",
"struct",
"sys",
"termios",
Expand Down Expand Up @@ -936,6 +947,7 @@ def main():
"umqtt/__init__",
"umqtt/robust",
"umqtt/simple",
"unix",
"uos",
"uplatform",
"uqueue",
Expand All @@ -961,8 +973,10 @@ def main():
"uzlib",
"version",
"vfs",
"webassembly",
"websocket",
"websocket_helper",
"windows",
"wipy",
"writer",
"xpt2046",
Expand Down
2 changes: 1 addition & 1 deletion src/stubber/board/createstubs_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def get_root() -> str: # sourcery skip: use-assigned-variable
# unix port
c = "."
r = c
for r in [c, "/sd", "/flash", "/", "."]:
for r in ["/sd", "/flash", "/", c, "."]:
try:
_ = os.stat(r)
break
Expand Down
4 changes: 2 additions & 2 deletions src/stubber/board/createstubs_db_min.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def get_root():
try:A=os.getcwd()
except(D,I):A=J
B=A
for B in[A,'/sd','/flash',G,J]:
for B in['/sd','/flash',G,A,J]:
try:C=os.stat(B);break
except D:continue
return B
Expand Down Expand Up @@ -327,6 +327,6 @@ def main():
S('All modules have been processed, Finalizing report');stubber.report_end()
if __name__=='__main__'or n():
if not Z('no_auto_stubber.txt'):
try:F.threshold(4*1024);F.enable()
try:F.threshold(4096);F.enable()
except BaseException:pass
main()
Binary file modified src/stubber/board/createstubs_db_mpy.mpy
Binary file not shown.
2 changes: 1 addition & 1 deletion src/stubber/board/createstubs_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def get_root() -> str: # sourcery skip: use-assigned-variable
# unix port
c = "."
r = c
for r in [c, "/sd", "/flash", "/", "."]:
for r in ["/sd", "/flash", "/", c, "."]:
try:
_ = os.stat(r)
break
Expand Down
4 changes: 2 additions & 2 deletions src/stubber/board/createstubs_mem_min.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_root():
try:A=os.getcwd()
except(F,I):A=J
B=A
for B in[A,'/sd','/flash',G,J]:
for B in['/sd','/flash',G,A,J]:
try:C=os.stat(B);break
except F:continue
return B
Expand Down Expand Up @@ -302,6 +302,6 @@ def A(stubber):
stubber.modules=[];A(stubber);D.collect();stubber.create_all_stubs()
if __name__=='__main__'or j():
if not h('no_auto_stubber.txt'):
try:D.threshold(4*1024);D.enable()
try:D.threshold(4096);D.enable()
except BaseException:pass
main()
Binary file modified src/stubber/board/createstubs_mem_mpy.mpy
Binary file not shown.
Loading

0 comments on commit d6b305d

Please sign in to comment.