micropython-stubber 1.24.1__py3-none-any.whl → 1.24.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {micropython_stubber-1.24.1.dist-info → micropython_stubber-1.24.4.dist-info}/METADATA +9 -29
  2. micropython_stubber-1.24.4.dist-info/RECORD +107 -0
  3. {micropython_stubber-1.24.1.dist-info → micropython_stubber-1.24.4.dist-info}/WHEEL +1 -1
  4. stubber/__init__.py +1 -1
  5. stubber/board/createstubs.py +44 -38
  6. stubber/board/createstubs_db.py +17 -12
  7. stubber/board/createstubs_db_min.py +63 -63
  8. stubber/board/createstubs_db_mpy.mpy +0 -0
  9. stubber/board/createstubs_mem.py +17 -12
  10. stubber/board/createstubs_mem_min.py +99 -99
  11. stubber/board/createstubs_mem_mpy.mpy +0 -0
  12. stubber/board/createstubs_min.py +111 -112
  13. stubber/board/createstubs_mpy.mpy +0 -0
  14. stubber/board/modulelist.txt +27 -27
  15. stubber/codemod/board.py +1 -1
  16. stubber/codemod/enrich.py +13 -13
  17. stubber/codemod/merge_docstub.py +83 -53
  18. stubber/codemod/visitors/type_helpers.py +143 -41
  19. stubber/commands/enrich_folder_cmd.py +17 -17
  20. stubber/commands/get_docstubs_cmd.py +27 -9
  21. stubber/commands/get_frozen_cmd.py +1 -0
  22. stubber/commands/merge_cmd.py +2 -4
  23. stubber/merge_config.py +5 -36
  24. stubber/minify.py +3 -3
  25. stubber/modcat.py +118 -0
  26. stubber/publish/merge_docstubs.py +22 -5
  27. stubber/publish/stubpackage.py +33 -28
  28. stubber/rst/lookup.py +6 -23
  29. stubber/rst/reader.py +8 -13
  30. stubber/stubs_from_docs.py +2 -1
  31. stubber/tools/manifestfile.py +2 -1
  32. stubber/{cst_transformer.py → typing_collector.py} +36 -4
  33. micropython_stubber-1.24.1.dist-info/RECORD +0 -161
  34. mpflash/README.md +0 -220
  35. mpflash/libusb_flash.ipynb +0 -203
  36. mpflash/mpflash/__init__.py +0 -0
  37. mpflash/mpflash/add_firmware.py +0 -98
  38. mpflash/mpflash/ask_input.py +0 -236
  39. mpflash/mpflash/basicgit.py +0 -324
  40. mpflash/mpflash/bootloader/__init__.py +0 -2
  41. mpflash/mpflash/bootloader/activate.py +0 -60
  42. mpflash/mpflash/bootloader/detect.py +0 -82
  43. mpflash/mpflash/bootloader/manual.py +0 -101
  44. mpflash/mpflash/bootloader/micropython.py +0 -12
  45. mpflash/mpflash/bootloader/touch1200.py +0 -36
  46. mpflash/mpflash/cli_download.py +0 -129
  47. mpflash/mpflash/cli_flash.py +0 -224
  48. mpflash/mpflash/cli_group.py +0 -111
  49. mpflash/mpflash/cli_list.py +0 -87
  50. mpflash/mpflash/cli_main.py +0 -39
  51. mpflash/mpflash/common.py +0 -217
  52. mpflash/mpflash/config.py +0 -44
  53. mpflash/mpflash/connected.py +0 -96
  54. mpflash/mpflash/download.py +0 -364
  55. mpflash/mpflash/downloaded.py +0 -138
  56. mpflash/mpflash/errors.py +0 -9
  57. mpflash/mpflash/flash/__init__.py +0 -55
  58. mpflash/mpflash/flash/esp.py +0 -59
  59. mpflash/mpflash/flash/stm32.py +0 -19
  60. mpflash/mpflash/flash/stm32_dfu.py +0 -104
  61. mpflash/mpflash/flash/uf2/__init__.py +0 -88
  62. mpflash/mpflash/flash/uf2/boardid.py +0 -15
  63. mpflash/mpflash/flash/uf2/linux.py +0 -136
  64. mpflash/mpflash/flash/uf2/macos.py +0 -42
  65. mpflash/mpflash/flash/uf2/uf2disk.py +0 -12
  66. mpflash/mpflash/flash/uf2/windows.py +0 -43
  67. mpflash/mpflash/flash/worklist.py +0 -170
  68. mpflash/mpflash/list.py +0 -106
  69. mpflash/mpflash/logger.py +0 -41
  70. mpflash/mpflash/mpboard_id/__init__.py +0 -98
  71. mpflash/mpflash/mpboard_id/add_boards.py +0 -262
  72. mpflash/mpflash/mpboard_id/board.py +0 -37
  73. mpflash/mpflash/mpboard_id/board_id.py +0 -90
  74. mpflash/mpflash/mpboard_id/board_info.zip +0 -0
  75. mpflash/mpflash/mpboard_id/store.py +0 -48
  76. mpflash/mpflash/mpremoteboard/__init__.py +0 -271
  77. mpflash/mpflash/mpremoteboard/mpy_fw_info.py +0 -152
  78. mpflash/mpflash/mpremoteboard/runner.py +0 -140
  79. mpflash/mpflash/vendor/board_database.py +0 -185
  80. mpflash/mpflash/vendor/click_aliases.py +0 -91
  81. mpflash/mpflash/vendor/dfu.py +0 -165
  82. mpflash/mpflash/vendor/pydfu.py +0 -605
  83. mpflash/mpflash/vendor/readme.md +0 -12
  84. mpflash/mpflash/versions.py +0 -123
  85. mpflash/poetry.lock +0 -2603
  86. mpflash/pyproject.toml +0 -66
  87. mpflash/stm32_udev_rules.md +0 -63
  88. stubber/codemod/test_enrich.py +0 -87
  89. {micropython_stubber-1.24.1.dist-info → micropython_stubber-1.24.4.dist-info}/LICENSE +0 -0
  90. {micropython_stubber-1.24.1.dist-info → micropython_stubber-1.24.4.dist-info}/entry_points.txt +0 -0
mpflash/pyproject.toml DELETED
@@ -1,66 +0,0 @@
1
- [tool.poetry]
2
- name = "mpflash"
3
- version = "1.24.6"
4
- description = "Flash and download tool for MicroPython firmwares"
5
- authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
6
- license = "MIT"
7
- readme = "README.md"
8
- keywords = ["MicroPython", "firmware", "flash", "download", "UF2", "esptool"]
9
- homepage = "https://github.com/Josverl/micropython-stubber/blob/main/src/mpflash/README.md"
10
- repository = "https://github.com/Josverl/micropython-stubber"
11
- classifiers = [
12
- "Programming Language :: Python :: Implementation :: MicroPython",
13
- "Programming Language :: Python :: Implementation :: CPython",
14
- "Topic :: Software Development :: Build Tools",
15
- ]
16
-
17
- [tool.poetry.scripts]
18
- mpflash = "mpflash.cli_main:mpflash"
19
-
20
- [tool.poetry.dependencies]
21
- python = ">=3.9,<4.0"
22
- beautifulsoup4 = "^4.12.3"
23
- bincopy = "^20.0.0"
24
- blkinfo = "^0.2.0"
25
- cachetools = "^5.3.0"
26
- esptool = "^4.7.0"
27
- inquirer = "^3.2.4"
28
- jsonlines = "^4.0.0"
29
- jsons = "^1.6.3"
30
- libusb = { version = "^1.0.27", platform = "win32" }
31
- loguru = "^0.7.2"
32
- mpremote = "^1.22.0"
33
- packaging = "^24.2"
34
- platformdirs = "^4.2.0"
35
- psutil = "^5.9.8"
36
- pygithub = "^2.1.1"
37
- pyusb = "^1.2.1"
38
- requests = "^2.31.0"
39
- rich-click = "^1.8.1"
40
- tenacity = "8.2.3"
41
- cache-to-disk = "^2.0.0"
42
- poetry = "^2.0.1"
43
-
44
-
45
- [tool.poetry.group.dev]
46
- optional = true
47
- [tool.poetry.group.dev.dependencies]
48
-
49
- [tool.poetry.group.test]
50
- optional = true
51
- [tool.poetry.group.test.dependencies]
52
- pytest = "^7.1.2"
53
- pytest-github-actions-annotate-failures = ">=0.1.7,<0.3.0"
54
- pytest-json-report = "^1.5.0"
55
- pytest-metadata = ">=2.0.2,<4.0.0"
56
- pytest-mock = "^3.10.0"
57
- #
58
- coverage = ">=6.4.3,<8.0.0"
59
- distro = "^1.8.0"
60
- fasteners = "^0.19"
61
- mock = "^4.0.3"
62
-
63
-
64
- [build-system]
65
- requires = ["poetry-core"]
66
- build-backend = "poetry.core.masonry.api"
@@ -1,63 +0,0 @@
1
- ## Linux permissions for usb devices
2
-
3
- In order to flash the firmware to the board, you need to have the correct permissions to access the USB devices.
4
- The details will depend on the specific USB device and the operating system you are using.
5
-
6
- You can use the following udev rules to give non-root users access to the USB devices.
7
-
8
- File: `/etc/udev/rules.d/65-mpflash.rules`
9
- ```bash
10
- # allow non-root users to access to stm32 device in dfu mode (bootloader)
11
- SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="STM32 BOOTLOADER", GROUP="plugdev", MODE="0660"
12
- ```
13
- reload the udev rules with the following command:
14
- ```bash
15
- sudo udevadm control --reload
16
- ```
17
- Unplug and replug the usb device to apply the new rules.
18
-
19
-
20
- ## to check
21
- Enter the stm32 bootloader mode
22
- ``` bash
23
- mpremote bootloader
24
- ```
25
-
26
-
27
- List usb devices
28
- ```bash
29
- (.venv) jos@jvnuc:~/projects/micropython-stubber$ lsusb -vv -t
30
- /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 10000M
31
- ID 1d6b:0003 Linux Foundation 3.0 root hub
32
- /sys/bus/usb/devices/usb2 /dev/bus/usb/002/001
33
- /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
34
- ID 1d6b:0002 Linux Foundation 2.0 root hub
35
- /sys/bus/usb/devices/usb1 /dev/bus/usb/001/001
36
- |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 12M
37
- ID 0a05:7211 Unknown Manufacturer hub
38
- /sys/bus/usb/devices/1-1 /dev/bus/usb/001/002
39
- |__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/4p, 12M
40
- ID 0a05:7211 Unknown Manufacturer hub
41
- /sys/bus/usb/devices/1-1.1 /dev/bus/usb/001/004
42
- |__ Port 2: Dev 22, If 0, Class=Application Specific Interface, Driver=, 12M
43
- ID 0483:df11 STMicroelectronics STM Device in DFU Mode
44
- /sys/bus/usb/devices/1-1.2 /dev/bus/usb/001/022
45
- |__ Port 10: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
46
- ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
47
- /sys/bus/usb/devices/1-10 /dev/bus/usb/001/003
48
- |__ Port 10: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M
49
- ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
50
- /sys/bus/usb/devices/1-10 /dev/bus/usb/001/003
51
- ```
52
- Lookup the stm32 device device path ( /dev/bus/usb/001/022),
53
- and check if the group `plugdev` is granted access using `ll`
54
- ```bash
55
- (.venv) jos@jvnuc:~/projects/micropython-stubber$ ll /dev/bus/usb/001/022
56
- crw-rw-r-- 1 root plugdev 189, 21 mrt 11 22:38 /dev/bus/usb/001/022
57
- ```
58
-
59
- Check `groups` to see if user is in plugdev group
60
- ```
61
- (.venv) jos@jvnuc:~/projects/micropython-stubber$ groups
62
- jos adm disk dialout cdrom sudo dip plugdev kvm lpadmin lxd sambashare usb
63
- ```
@@ -1,87 +0,0 @@
1
- from typing import List
2
- import pytest
3
- from pathlib import Path
4
- # from stubber.codemod.enrich import merge_source_candidates
5
-
6
-
7
- @pytest.fixture
8
- def docstub_path(tmp_path):
9
- # Create a temporary directory for docstub files
10
- docstub_path = tmp_path / "docstubs"
11
- docstub_path.mkdir(exist_ok=True, parents=True)
12
-
13
- (docstub_path / "one.pyi").touch()
14
-
15
- # Create some docstub files
16
- (docstub_path / "package.py").touch()
17
- (docstub_path / "package.pyi").touch()
18
- (docstub_path / "upackage.py").touch()
19
- (docstub_path / "upackage.pyi").touch()
20
- # for ufoo to foo
21
- (docstub_path / "usys.pyi").touch()
22
- (docstub_path / "sys.pyi").touch()
23
- # from _foo to foo
24
- (docstub_path / "rp2.pyi").touch()
25
- (docstub_path / "_rp2.pyi").touch()
26
-
27
- # dist package format
28
- (docstub_path / "foo").mkdir(exist_ok=True, parents=True)
29
- (docstub_path / "foo" / "__init__.pyi").touch()
30
-
31
- # dist package format
32
- (docstub_path / "bar").mkdir(exist_ok=True, parents=True)
33
- (docstub_path / "bar" / "__init__.pyi").touch()
34
- (docstub_path / "bar" / "barclass.pyi").touch()
35
-
36
- # dist package format
37
- (docstub_path / "machine").mkdir(exist_ok=True, parents=True)
38
- (docstub_path / "machine" / "__init__.pyi").touch()
39
- (docstub_path / "machine" / "Pin.pyi").touch()
40
- (docstub_path / "machine" / "Signal.pyi").touch()
41
- (docstub_path / "machine" / "ADC.pyi").touch()
42
- return docstub_path
43
-
44
-
45
- # @pytest.mark.parametrize(
46
- # "package_name, expected_candidates",
47
- # [
48
- # (
49
- # "package",
50
- # [
51
- # "package.py",
52
- # "package.pyi",
53
- # "upackage.py",
54
- # "upackage.pyi",
55
- # ],
56
- # ),
57
- # ("usys", ["usys.pyi", "sys.pyi"]),
58
- # ("_rp2", ["rp2.pyi", "_rp2.pyi"]),
59
- # ("rp2", ["rp2.pyi"]),
60
- # ("nonexistent", []),
61
- # ("foo", ["foo/__init__.pyi"]),
62
- # ("ufoo", ["foo/__init__.pyi"]),
63
- # ("bar", ["bar/__init__.pyi", "bar/barclass.pyi"]),
64
- # (
65
- # "machine",
66
- # [
67
- # "machine/__init__.pyi",
68
- # "machine/Pin.pyi",
69
- # "machine/Signal.pyi",
70
- # "machine/ADC.pyi",
71
- # ],
72
- # ),
73
- # ("machine.Pin", ["machine/Pin.pyi"]),
74
- # ],
75
- # )
76
- # def test_merge_source_candidates(
77
- # package_name: str,
78
- # expected_candidates: List[str],
79
- # docstub_path: Path,
80
- # ):
81
- # # Test with package name "package"
82
- # candidates = merge_source_candidates(package_name, docstub_path)
83
- # assert len(candidates) == len(expected_candidates)
84
- # for e in expected_candidates:
85
- # assert docstub_path / e in candidates
86
-
87
- # # todo : test ordering