micropython-stubber 1.24.2__py3-none-any.whl → 1.24.4.post1__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 (83) hide show
  1. {micropython_stubber-1.24.2.dist-info → micropython_stubber-1.24.4.post1.dist-info}/METADATA +7 -28
  2. micropython_stubber-1.24.4.post1.dist-info/RECORD +107 -0
  3. {micropython_stubber-1.24.2.dist-info → micropython_stubber-1.24.4.post1.dist-info}/WHEEL +1 -1
  4. stubber/__init__.py +1 -1
  5. stubber/board/createstubs_db.py +1 -1
  6. stubber/board/createstubs_mem.py +1 -1
  7. stubber/bulk/mcu_stubber.py +1 -1
  8. stubber/codemod/board.py +1 -1
  9. stubber/codemod/enrich.py +12 -10
  10. stubber/codemod/merge_docstub.py +83 -53
  11. stubber/codemod/visitors/type_helpers.py +143 -41
  12. stubber/commands/enrich_folder_cmd.py +17 -17
  13. stubber/commands/get_docstubs_cmd.py +22 -3
  14. stubber/commands/get_frozen_cmd.py +1 -0
  15. stubber/commands/merge_cmd.py +2 -4
  16. stubber/merge_config.py +5 -39
  17. stubber/minify.py +3 -3
  18. stubber/modcat.py +118 -0
  19. stubber/publish/merge_docstubs.py +21 -3
  20. stubber/publish/stubpackage.py +10 -27
  21. stubber/rst/lookup.py +3 -23
  22. stubber/stubs_from_docs.py +2 -1
  23. stubber/{cst_transformer.py → typing_collector.py} +34 -3
  24. micropython_stubber-1.24.2.dist-info/RECORD +0 -163
  25. mpflash/README.md +0 -220
  26. mpflash/libusb_flash.ipynb +0 -203
  27. mpflash/mpflash/__init__.py +0 -0
  28. mpflash/mpflash/add_firmware.py +0 -98
  29. mpflash/mpflash/ask_input.py +0 -236
  30. mpflash/mpflash/basicgit.py +0 -324
  31. mpflash/mpflash/bootloader/__init__.py +0 -2
  32. mpflash/mpflash/bootloader/activate.py +0 -60
  33. mpflash/mpflash/bootloader/detect.py +0 -82
  34. mpflash/mpflash/bootloader/manual.py +0 -101
  35. mpflash/mpflash/bootloader/micropython.py +0 -12
  36. mpflash/mpflash/bootloader/touch1200.py +0 -36
  37. mpflash/mpflash/cli_download.py +0 -129
  38. mpflash/mpflash/cli_flash.py +0 -224
  39. mpflash/mpflash/cli_group.py +0 -111
  40. mpflash/mpflash/cli_list.py +0 -87
  41. mpflash/mpflash/cli_main.py +0 -39
  42. mpflash/mpflash/common.py +0 -217
  43. mpflash/mpflash/config.py +0 -44
  44. mpflash/mpflash/connected.py +0 -96
  45. mpflash/mpflash/download.py +0 -364
  46. mpflash/mpflash/downloaded.py +0 -138
  47. mpflash/mpflash/errors.py +0 -9
  48. mpflash/mpflash/flash/__init__.py +0 -55
  49. mpflash/mpflash/flash/esp.py +0 -59
  50. mpflash/mpflash/flash/stm32.py +0 -19
  51. mpflash/mpflash/flash/stm32_dfu.py +0 -104
  52. mpflash/mpflash/flash/uf2/__init__.py +0 -104
  53. mpflash/mpflash/flash/uf2/boardid.py +0 -15
  54. mpflash/mpflash/flash/uf2/linux.py +0 -136
  55. mpflash/mpflash/flash/uf2/macos.py +0 -42
  56. mpflash/mpflash/flash/uf2/uf2disk.py +0 -12
  57. mpflash/mpflash/flash/uf2/windows.py +0 -43
  58. mpflash/mpflash/flash/worklist.py +0 -170
  59. mpflash/mpflash/list.py +0 -106
  60. mpflash/mpflash/logger.py +0 -41
  61. mpflash/mpflash/mpboard_id/__init__.py +0 -98
  62. mpflash/mpflash/mpboard_id/add_boards.py +0 -265
  63. mpflash/mpflash/mpboard_id/board.py +0 -37
  64. mpflash/mpflash/mpboard_id/board_id.py +0 -92
  65. mpflash/mpflash/mpboard_id/board_info.zip +0 -0
  66. mpflash/mpflash/mpboard_id/store.py +0 -48
  67. mpflash/mpflash/mpremoteboard/__init__.py +0 -271
  68. mpflash/mpflash/mpremoteboard/mpy_fw_info.py +0 -152
  69. mpflash/mpflash/mpremoteboard/runner.py +0 -140
  70. mpflash/mpflash/vendor/board_database.py +0 -185
  71. mpflash/mpflash/vendor/click_aliases.py +0 -91
  72. mpflash/mpflash/vendor/dfu.py +0 -165
  73. mpflash/mpflash/vendor/pico-universal-flash-nuke/LICENSE.txt +0 -21
  74. mpflash/mpflash/vendor/pico-universal-flash-nuke/universal_flash_nuke.uf2 +0 -0
  75. mpflash/mpflash/vendor/pydfu.py +0 -605
  76. mpflash/mpflash/vendor/readme.md +0 -14
  77. mpflash/mpflash/versions.py +0 -123
  78. mpflash/poetry.lock +0 -2869
  79. mpflash/pyproject.toml +0 -66
  80. mpflash/stm32_udev_rules.md +0 -63
  81. stubber/codemod/test_enrich.py +0 -87
  82. {micropython_stubber-1.24.2.dist-info → micropython_stubber-1.24.4.post1.dist-info}/LICENSE +0 -0
  83. {micropython_stubber-1.24.2.dist-info → micropython_stubber-1.24.4.post1.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.7"
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