micropython-stubber 1.23.1__py3-none-any.whl → 1.23.1.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 (61) hide show
  1. {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/METADATA +30 -13
  2. {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/RECORD +60 -60
  3. micropython_stubber-1.23.1.post1.dist-info/entry_points.txt +5 -0
  4. mpflash/README.md +26 -0
  5. mpflash/mpflash/cli_download.py +1 -1
  6. mpflash/mpflash/cli_flash.py +11 -14
  7. mpflash/mpflash/cli_list.py +8 -2
  8. mpflash/mpflash/common.py +2 -1
  9. mpflash/mpflash/connected.py +2 -3
  10. mpflash/mpflash/list.py +20 -13
  11. mpflash/mpflash/mpremoteboard/__init__.py +50 -6
  12. mpflash/pyproject.toml +1 -1
  13. stubber/bulk/mcu_stubber.py +28 -45
  14. stubber/codemod/enrich.py +1 -1
  15. stubber/codemod/merge_docstub.py +1 -1
  16. stubber/commands/build_cmd.py +1 -1
  17. stubber/commands/cli.py +5 -11
  18. stubber/commands/clone_cmd.py +1 -1
  19. stubber/commands/config_cmd.py +1 -1
  20. stubber/commands/enrich_folder_cmd.py +1 -1
  21. stubber/commands/get_core_cmd.py +1 -1
  22. stubber/commands/get_docstubs_cmd.py +5 -2
  23. stubber/commands/get_frozen_cmd.py +5 -2
  24. stubber/commands/get_mcu_cmd.py +52 -11
  25. stubber/commands/merge_cmd.py +1 -1
  26. stubber/commands/publish_cmd.py +1 -1
  27. stubber/commands/stub_cmd.py +1 -1
  28. stubber/commands/variants_cmd.py +1 -1
  29. stubber/downloader.py +2 -1
  30. stubber/freeze/common.py +7 -3
  31. stubber/freeze/freeze_folder.py +2 -2
  32. stubber/freeze/freeze_manifest_2.py +19 -6
  33. stubber/freeze/get_frozen.py +7 -3
  34. stubber/get_cpython.py +15 -4
  35. stubber/minify.py +7 -3
  36. stubber/publish/candidates.py +26 -7
  37. stubber/publish/merge_docstubs.py +4 -2
  38. stubber/publish/missing_class_methods.py +4 -2
  39. stubber/publish/package.py +7 -3
  40. stubber/publish/pathnames.py +1 -1
  41. stubber/publish/publish.py +1 -1
  42. stubber/publish/pypi.py +6 -2
  43. stubber/publish/stubpackage.py +40 -16
  44. stubber/rst/classsort.py +2 -1
  45. stubber/rst/lookup.py +1 -0
  46. stubber/rst/reader.py +7 -7
  47. stubber/rst/report_return.py +12 -4
  48. stubber/rst/rst_utils.py +2 -1
  49. stubber/stubs_from_docs.py +1 -1
  50. stubber/tools/manifestfile.py +1 -1
  51. stubber/update_fallback.py +1 -1
  52. stubber/update_module_list.py +1 -1
  53. stubber/utils/config.py +19 -7
  54. stubber/utils/post.py +2 -1
  55. stubber/utils/repos.py +9 -3
  56. stubber/utils/stubmaker.py +1 -1
  57. stubber/utils/typed_config_toml.py +5 -2
  58. stubber/variants.py +1 -1
  59. micropython_stubber-1.23.1.dist-info/entry_points.txt +0 -3
  60. {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/LICENSE +0 -0
  61. {micropython_stubber-1.23.1.dist-info → micropython_stubber-1.23.1.post1.dist-info}/WHEEL +0 -0
stubber/utils/post.py CHANGED
@@ -1,11 +1,12 @@
1
1
  """Pre/Post Processing for createstubs.py"""
2
+
2
3
  import subprocess
3
4
  import sys
4
5
  from pathlib import Path
5
6
  from typing import List
6
7
 
7
8
  import autoflake
8
- from loguru import logger as log
9
+ from mpflash.logger import log
9
10
 
10
11
  from .stubmaker import generate_pyi_files
11
12
 
stubber/utils/repos.py CHANGED
@@ -8,7 +8,7 @@ from collections import defaultdict
8
8
  from pathlib import Path
9
9
  from typing import Tuple
10
10
 
11
- from loguru import logger as log
11
+ from mpflash.logger import log
12
12
  from packaging.version import Version
13
13
 
14
14
  import mpflash.basicgit as git
@@ -63,7 +63,11 @@ def read_micropython_lib_commits(filename: str = "data/micropython_tags.csv"):
63
63
  reader = csv.DictReader(ntf.file, skipinitialspace=True) # dialect="excel",
64
64
  rows = list(reader)
65
65
  # create a dict version --> commit_hash
66
- version_commit = {row["version"].split("/")[-1]: row["lib_commit_hash"] for row in rows if row["version"].startswith("refs/tags/")}
66
+ version_commit = {
67
+ row["version"].split("/")[-1]: row["lib_commit_hash"]
68
+ for row in rows
69
+ if row["version"].startswith("refs/tags/")
70
+ }
67
71
  # add default
68
72
  version_commit = defaultdict(lambda: "master", version_commit)
69
73
  return version_commit
@@ -91,7 +95,9 @@ def match_lib_with_mpy(version_tag: str, mpy_path: Path, lib_path: Path) -> bool
91
95
  return False
92
96
  return git.sync_submodules(mpy_path)
93
97
  else:
94
- log.info(f"Matching repo's: Micropython {version_tag} needs micropython-lib:{micropython_lib_commits[version_tag]}")
98
+ log.info(
99
+ f"Matching repo's: Micropython {version_tag} needs micropython-lib:{micropython_lib_commits[version_tag]}"
100
+ )
95
101
  return git.checkout_commit(micropython_lib_commits[version_tag], lib_path)
96
102
 
97
103
 
@@ -5,7 +5,7 @@ import sys
5
5
  from pathlib import Path
6
6
 
7
7
  import mypy.stubgen as stubgen
8
- from loguru import logger as log
8
+ from mpflash.logger import log
9
9
  from mypy.errors import CompileError
10
10
 
11
11
  # default stubgen options
@@ -4,6 +4,7 @@ typed-config-toml
4
4
  Extend typed-config to read configuration from .toml files
5
5
 
6
6
  """
7
+
7
8
  # TODO : extend support for . notation in section names
8
9
 
9
10
  from pathlib import Path
@@ -15,7 +16,7 @@ except ModuleNotFoundError:
15
16
  import tomli as tomllib # type: ignore
16
17
  assert tomllib
17
18
 
18
- from loguru import logger as log
19
+ from mpflash.logger import log
19
20
  from typedconfig.source import ConfigSource
20
21
 
21
22
 
@@ -69,7 +70,9 @@ class TomlConfigSource(ConfigSource):
69
70
  # do not assume/require that all values are strings
70
71
  # assert isinstance(v_v, str)
71
72
  # Convert all keys to lowercase
72
- self.data = {k.lower(): {v_k.lower(): v_v for v_k, v_v in v.items()} for k, v in self.data.items()}
73
+ self.data = {
74
+ k.lower(): {v_k.lower(): v_v for v_k, v_v in v.items()} for k, v in self.data.items()
75
+ }
73
76
 
74
77
  def get_config_value(self, section_name: str, key_name: str) -> Optional[str]:
75
78
  # Extract info from data which we read in during __init__
stubber/variants.py CHANGED
@@ -10,7 +10,7 @@ from typing import List, Optional
10
10
 
11
11
  import libcst as cst
12
12
  import libcst.codemod as codemod
13
- from loguru import logger as log
13
+ from mpflash.logger import log
14
14
 
15
15
  from stubber.codemod.board import CreateStubsCodemod, CreateStubsVariant
16
16
  from stubber.codemod.modify_list import ListChangeSet # type: ignore
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- stubber=stubber.stubber:stubber_cli
3
-