micropython-stubber 1.20.1__py3-none-any.whl → 1.20.2__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 (58) hide show
  1. {micropython_stubber-1.20.1.dist-info → micropython_stubber-1.20.2.dist-info}/METADATA +3 -3
  2. {micropython_stubber-1.20.1.dist-info → micropython_stubber-1.20.2.dist-info}/RECORD +56 -49
  3. mpflash/README.md +16 -5
  4. mpflash/mpflash/add_firmware.py +98 -0
  5. mpflash/mpflash/ask_input.py +97 -120
  6. mpflash/mpflash/cli_download.py +42 -25
  7. mpflash/mpflash/cli_flash.py +70 -32
  8. mpflash/mpflash/cli_group.py +14 -12
  9. mpflash/mpflash/cli_list.py +39 -3
  10. mpflash/mpflash/cli_main.py +17 -6
  11. mpflash/mpflash/common.py +125 -12
  12. mpflash/mpflash/config.py +2 -0
  13. mpflash/mpflash/connected.py +74 -0
  14. mpflash/mpflash/download.py +56 -42
  15. mpflash/mpflash/downloaded.py +9 -9
  16. mpflash/mpflash/flash.py +2 -2
  17. mpflash/mpflash/flash_esp.py +2 -2
  18. mpflash/mpflash/flash_uf2.py +16 -8
  19. mpflash/mpflash/flash_uf2_linux.py +5 -16
  20. mpflash/mpflash/flash_uf2_macos.py +78 -0
  21. mpflash/mpflash/flash_uf2_windows.py +1 -1
  22. mpflash/mpflash/list.py +57 -57
  23. mpflash/mpflash/mpboard_id/__init__.py +37 -44
  24. mpflash/mpflash/mpboard_id/add_boards.py +255 -0
  25. mpflash/mpflash/mpboard_id/board.py +37 -0
  26. mpflash/mpflash/mpboard_id/board_id.py +38 -34
  27. mpflash/mpflash/mpboard_id/board_info.zip +0 -0
  28. mpflash/mpflash/mpboard_id/store.py +42 -0
  29. mpflash/mpflash/mpremoteboard/__init__.py +18 -6
  30. mpflash/mpflash/uf2disk.py +12 -0
  31. mpflash/mpflash/vendor/basicgit.py +288 -0
  32. mpflash/mpflash/vendor/dfu.py +1 -0
  33. mpflash/mpflash/vendor/versions.py +7 -3
  34. mpflash/mpflash/worklist.py +71 -48
  35. mpflash/poetry.lock +164 -138
  36. mpflash/pyproject.toml +18 -15
  37. stubber/__init__.py +1 -1
  38. stubber/board/createstubs.py +4 -3
  39. stubber/board/createstubs_db.py +5 -7
  40. stubber/board/createstubs_db_min.py +329 -825
  41. stubber/board/createstubs_db_mpy.mpy +0 -0
  42. stubber/board/createstubs_mem.py +6 -7
  43. stubber/board/createstubs_mem_min.py +304 -765
  44. stubber/board/createstubs_mem_mpy.mpy +0 -0
  45. stubber/board/createstubs_min.py +293 -975
  46. stubber/board/createstubs_mpy.mpy +0 -0
  47. stubber/board/modulelist.txt +1 -0
  48. stubber/commands/get_core_cmd.py +7 -6
  49. stubber/commands/get_docstubs_cmd.py +8 -3
  50. stubber/commands/get_frozen_cmd.py +5 -2
  51. stubber/publish/publish.py +18 -7
  52. stubber/utils/makeversionhdr.py +3 -2
  53. stubber/utils/versions.py +2 -1
  54. mpflash/mpflash/mpboard_id/board_info.csv +0 -2213
  55. mpflash/mpflash/mpboard_id/board_info.json +0 -19910
  56. {micropython_stubber-1.20.1.dist-info → micropython_stubber-1.20.2.dist-info}/LICENSE +0 -0
  57. {micropython_stubber-1.20.1.dist-info → micropython_stubber-1.20.2.dist-info}/WHEEL +0 -0
  58. {micropython_stubber-1.20.1.dist-info → micropython_stubber-1.20.2.dist-info}/entry_points.txt +0 -0
Binary file
@@ -173,6 +173,7 @@ struct
173
173
  sys
174
174
  termios
175
175
  time
176
+ tls
176
177
  tpcalib
177
178
  uarray
178
179
  uasyncio/__init__
@@ -4,11 +4,12 @@
4
4
  # core
5
5
  ##########################################################################################
6
6
 
7
- from loguru import logger as log
8
7
  from pathlib import Path
9
8
  from typing import List
10
9
 
11
10
  import click
11
+ from loguru import logger as log
12
+
12
13
  import stubber.get_cpython as get_cpython
13
14
  import stubber.utils as utils
14
15
  from stubber.utils.config import CONFIG
@@ -41,7 +42,7 @@ from .cli import stubber_cli
41
42
  show_default=True,
42
43
  )
43
44
  def cli_get_core(
44
- stub_folder: str = CONFIG.stub_path.as_posix(),
45
+ stub_folder: str = "",
45
46
  # core_type: str = "pycopy", # pycopy or Micropython CPython stubs
46
47
  stubgen: bool = True,
47
48
  black: bool = True,
@@ -51,16 +52,16 @@ def cli_get_core(
51
52
 
52
53
  Get the core (CPython compat) modules for both MicroPython and Pycopy.
53
54
  """
54
-
55
+ # default parameter values
56
+ stub_folder = stub_folder or CONFIG.stub_path.as_posix()
57
+
55
58
  stub_paths: List[Path] = []
56
59
  for core_type in ["pycopy", "micropython"]:
57
60
  log.info(f"::group:: Get Cpython core :{core_type}")
58
61
  req_filename = f"requirements-core-{core_type}.txt"
59
62
  stub_path = Path(stub_folder) / f"cpython_core-{core_type}"
60
63
 
61
- get_cpython.get_core(
62
- stub_path=stub_path.as_posix(), requirements=req_filename, family=core_type
63
- )
64
+ get_cpython.get_core(stub_path=stub_path.as_posix(), requirements=req_filename, family=core_type)
64
65
  stub_paths.append(stub_path)
65
66
 
66
67
  log.info("::group:: start post processing of retrieved stubs")
@@ -4,6 +4,7 @@ get-docstubs
4
4
  """
5
5
 
6
6
  from pathlib import Path
7
+ from typing import Optional
7
8
 
8
9
  import click
9
10
  from loguru import logger as log
@@ -44,10 +45,10 @@ from .cli import stubber_cli
44
45
  @click.pass_context
45
46
  def cli_docstubs(
46
47
  ctx: click.Context,
47
- path: str = CONFIG.repo_path.as_posix(),
48
- target: str = CONFIG.stub_path.as_posix(),
48
+ path: Optional[str] = None,
49
+ target:Optional[str] = None,
49
50
  black: bool = True,
50
- basename: str = "micropython",
51
+ basename: Optional[str] = None,
51
52
  version: str = "",
52
53
  ):
53
54
  """
@@ -55,6 +56,10 @@ def cli_docstubs(
55
56
 
56
57
  Read the Micropython library documentation files and use them to build stubs that can be used for static typechecking.
57
58
  """
59
+ # default parameter values
60
+ path = path or CONFIG.repo_path.as_posix()
61
+ target = target or CONFIG.stub_path.as_posix()
62
+ basename = basename or "micropython"
58
63
 
59
64
  if path == CONFIG.repo_path.as_posix():
60
65
  # default
@@ -4,7 +4,7 @@
4
4
  # get-frozen
5
5
  ##########################################################################################
6
6
  from pathlib import Path
7
- from typing import List
7
+ from typing import List, Optional
8
8
 
9
9
  import click
10
10
  from loguru import logger as log
@@ -51,7 +51,7 @@ from .cli import stubber_cli
51
51
  show_default=True,
52
52
  )
53
53
  def cli_get_frozen(
54
- stub_folder: str = CONFIG.stub_path.as_posix(),
54
+ stub_folder: Optional[str] = None,
55
55
  # path: str = config.repo_path.as_posix(),
56
56
  version: str = "",
57
57
  stubgen: bool = True,
@@ -63,6 +63,9 @@ def cli_get_frozen(
63
63
 
64
64
  Get the frozen modules for the checked out version of MicroPython
65
65
  """
66
+ # default parameter values
67
+ stub_folder = stub_folder or CONFIG.stub_path.as_posix()
68
+ # FIXME: Stub_folder is not used
66
69
 
67
70
  stub_paths: List[Path] = []
68
71
 
@@ -3,7 +3,8 @@ prepare a set of stub files for publishing to PyPi
3
3
 
4
4
  !!Note: anything excluded in .gitignore is not packaged by poetry
5
5
  """
6
- from typing import Any, Dict, List, Union
6
+
7
+ from typing import Any, Dict, List, Optional, Union
7
8
 
8
9
  from loguru import logger as log
9
10
 
@@ -18,9 +19,9 @@ from stubber.utils.versions import V_PREVIEW
18
19
 
19
20
  def build_multiple(
20
21
  family: str = "micropython",
21
- versions: List[str] = [V_PREVIEW],
22
- ports: List[str] = ["all"],
23
- boards: List[str] = [GENERIC_U],
22
+ versions: Optional[List[str]] = None,
23
+ ports: Optional[List[str]] = None,
24
+ boards: Optional[List[str]] = None,
24
25
  production: bool = False,
25
26
  clean: bool = False,
26
27
  force: bool = False,
@@ -28,6 +29,11 @@ def build_multiple(
28
29
  """
29
30
  Build a bunch of stub packages
30
31
  """
32
+ # default parameter values
33
+ versions = versions or [V_PREVIEW]
34
+ ports = ports or ["all"]
35
+ boards = boards or [GENERIC_U]
36
+
31
37
  db = get_database(CONFIG.publish_path, production=production)
32
38
  results: List[Dict[str, Any]] = []
33
39
  worklist = build_worklist(family, versions, ports, boards)
@@ -47,9 +53,9 @@ def build_multiple(
47
53
 
48
54
  def publish_multiple(
49
55
  family: str = "micropython",
50
- versions: List[str] = ["v1.19.1"],
51
- ports: List[str] = ["all"],
52
- boards: List[str] = [GENERIC_U],
56
+ versions: Optional[List[str]] = None,
57
+ ports: Optional[List[str]] = None,
58
+ boards: Optional[List[str]] = None,
53
59
  production: bool = False,
54
60
  clean: bool = False,
55
61
  build: bool = False,
@@ -59,6 +65,11 @@ def publish_multiple(
59
65
  """
60
66
  Publish a bunch of stub packages
61
67
  """
68
+ # default parameter values
69
+ versions = versions or [V_PREVIEW]
70
+ ports = ports or ["all"]
71
+ boards = boards or [GENERIC_U]
72
+
62
73
  db = get_database(CONFIG.publish_path, production=production)
63
74
  results = []
64
75
  worklist = build_worklist(family, versions, ports, boards)
@@ -6,14 +6,15 @@ from __future__ import print_function
6
6
 
7
7
  import subprocess
8
8
  from pathlib import Path
9
- from typing import Tuple, Union
9
+ from typing import Optional, Tuple, Union
10
10
 
11
11
 
12
- def get_version_info_from_git(path: Path = Path.cwd()) -> Tuple[Union[str, None], Union[str, None]]:
12
+ def get_version_info_from_git(path: Optional[Path] = None) -> Tuple[Union[str, None], Union[str, None]]:
13
13
  """return the version info from the git repository specified.
14
14
  returns: a 2-tuple containing git_tag, short_hash
15
15
 
16
16
  """
17
+ path = path or Path.cwd()
17
18
  # Note: git describe doesn't work if no tag is available
18
19
  try:
19
20
  git_tag = subprocess.check_output(
stubber/utils/versions.py CHANGED
@@ -82,9 +82,10 @@ def micropython_versions(minver: str = "v1.9.2"):
82
82
  """Get the list of micropython versions from github tags"""
83
83
  try:
84
84
  g = Github()
85
- _ = 1 / 0
86
85
  repo = g.get_repo("micropython/micropython")
87
86
  versions = [tag.name for tag in repo.get_tags() if parse(tag.name) >= parse(minver)]
87
+ # Only keep the last preview
88
+ versions = [v for v in versions if not v.endswith(V_PREVIEW) or v == versions[-1]]
88
89
  except Exception:
89
90
  versions = [
90
91
  "v9.99.9-preview",