mpflash 1.0.5__py3-none-any.whl → 1.24.0__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.
- mpflash/basicgit.py +7 -27
- mpflash/common.py +5 -2
- mpflash/mpboard_id/board_info.zip +0 -0
- {mpflash-1.0.5.dist-info → mpflash-1.24.0.dist-info}/METADATA +1 -1
- {mpflash-1.0.5.dist-info → mpflash-1.24.0.dist-info}/RECORD +8 -8
- {mpflash-1.0.5.dist-info → mpflash-1.24.0.dist-info}/LICENSE +0 -0
- {mpflash-1.0.5.dist-info → mpflash-1.24.0.dist-info}/WHEEL +0 -0
- {mpflash-1.0.5.dist-info → mpflash-1.24.0.dist-info}/entry_points.txt +0 -0
mpflash/basicgit.py
CHANGED
@@ -10,7 +10,7 @@ from pathlib import Path
|
|
10
10
|
from typing import List, Optional, Union
|
11
11
|
|
12
12
|
import cachetools.func
|
13
|
-
from github import Auth,
|
13
|
+
from github import Auth, Github
|
14
14
|
from loguru import logger as log
|
15
15
|
from packaging.version import parse
|
16
16
|
|
@@ -18,11 +18,7 @@ from packaging.version import parse
|
|
18
18
|
|
19
19
|
# Token with no permissions to avoid throttling
|
20
20
|
# https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
|
21
|
-
PAT_NO_ACCESS =
|
22
|
-
"github_pat_"
|
23
|
-
+ "11AAHPVFQ0G4NTaQ73Bw5J"
|
24
|
-
+ "_fAp7K9sZ1qL8VFnI9g78eUlCdmOXHB3WzSdj2jtEYb4XF3N7PDJBl32qIxq"
|
25
|
-
)
|
21
|
+
PAT_NO_ACCESS = "github_pat" + "_11AAHPVFQ0qAkDnSUaMKSp" + "_ZkDl5NRRwBsUN6EYg9ahp1Dvj4FDDONnXVgimxC2EtpY7Q7BUKBoQ0Jq72X"
|
26
22
|
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
27
23
|
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
28
24
|
|
@@ -39,17 +35,9 @@ def _run_local_git(
|
|
39
35
|
if repo:
|
40
36
|
if isinstance(repo, str):
|
41
37
|
repo = Path(repo)
|
42
|
-
result = subprocess.run(
|
43
|
-
cmd,
|
44
|
-
capture_output=capture_output,
|
45
|
-
check=True,
|
46
|
-
cwd=repo.absolute().as_posix(),
|
47
|
-
encoding="utf-8",
|
48
|
-
)
|
38
|
+
result = subprocess.run(cmd, capture_output=capture_output, check=True, cwd=repo.absolute().as_posix(), encoding="utf-8")
|
49
39
|
else:
|
50
|
-
result = subprocess.run(
|
51
|
-
cmd, capture_output=capture_output, check=True, encoding="utf-8"
|
52
|
-
)
|
40
|
+
result = subprocess.run(cmd, capture_output=capture_output, check=True, encoding="utf-8")
|
53
41
|
except (NotADirectoryError, FileNotFoundError) as e: # pragma: no cover
|
54
42
|
return None
|
55
43
|
except subprocess.CalledProcessError as e: # pragma: no cover
|
@@ -88,9 +76,7 @@ def clone(remote_repo: str, path: Path, shallow: bool = False, tag: Optional[str
|
|
88
76
|
return False
|
89
77
|
|
90
78
|
|
91
|
-
def get_local_tag(
|
92
|
-
repo: Optional[Union[str, Path]] = None, abbreviate: bool = True
|
93
|
-
) -> Union[str, None]:
|
79
|
+
def get_local_tag(repo: Optional[Union[str, Path]] = None, abbreviate: bool = True) -> Union[str, None]:
|
94
80
|
"""
|
95
81
|
get the most recent git version tag of a local repo
|
96
82
|
repo Path should be in the form of : repo = "./repo/micropython"
|
@@ -139,16 +125,12 @@ def get_local_tags(repo: Optional[Path] = None, minver: Optional[str] = None) ->
|
|
139
125
|
@cachetools.func.ttl_cache(maxsize=16, ttl=60) # 60 seconds
|
140
126
|
def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
|
141
127
|
"""
|
142
|
-
Get list of tag of a repote github repo
|
143
|
-
only the last -preview tag is kept
|
128
|
+
Get list of tag of a repote github repo
|
144
129
|
"""
|
145
130
|
if not repo or not isinstance(repo, str) or "/" not in repo: # type: ignore
|
146
131
|
return []
|
147
132
|
try:
|
148
133
|
gh_repo = GH_CLIENT.get_repo(repo)
|
149
|
-
except BadCredentialsException as e:
|
150
|
-
log.error(f"Github authentication error - {e}")
|
151
|
-
return []
|
152
134
|
except ConnectionError as e:
|
153
135
|
# TODO: unable to capture the exeption
|
154
136
|
log.warning(f"Unable to get tags - {e}")
|
@@ -156,9 +138,7 @@ def get_tags(repo: str, minver: Optional[str] = None) -> List[str]:
|
|
156
138
|
tags = [tag.name for tag in gh_repo.get_tags()]
|
157
139
|
if minver:
|
158
140
|
tags = [tag for tag in tags if parse(tag) >= parse(minver)]
|
159
|
-
|
160
|
-
tags = [t for t in sorted(tags[:-1]) if "-preview" not in t] + sorted(tags)[-1:]
|
161
|
-
return tags
|
141
|
+
return sorted(tags)
|
162
142
|
|
163
143
|
|
164
144
|
def checkout_tag(tag: str, repo: Optional[Union[str, Path]] = None) -> bool:
|
mpflash/common.py
CHANGED
@@ -30,8 +30,11 @@ PORT_FWTYPES = {
|
|
30
30
|
|
31
31
|
# Token with no permissions to avoid throttling
|
32
32
|
# https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#getting-a-higher-rate-limit
|
33
|
-
PAT_NO_ACCESS =
|
34
|
-
|
33
|
+
PAT_NO_ACCESS = (
|
34
|
+
"github_pat"
|
35
|
+
+ "_11AAHPVFQ0qAkDnSUaMKSp"
|
36
|
+
+ "_ZkDl5NRRwBsUN6EYg9ahp1Dvj4FDDONnXVgimxC2EtpY7Q7BUKBoQ0Jq72X"
|
37
|
+
)
|
35
38
|
PAT = os.environ.get("GITHUB_TOKEN") or PAT_NO_ACCESS
|
36
39
|
GH_CLIENT = Github(auth=Auth.Token(PAT))
|
37
40
|
|
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mpflash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
mpflash/add_firmware.py,sha256=1h0HsA-EVi3HXLmoEvzwY_a-GuWYzPwulTYHHBB8THg,3428
|
3
3
|
mpflash/ask_input.py,sha256=RJHGGrhYniSu-bdoKnKptE3DtpiCREJGRTZmFazvG-E,8946
|
4
|
-
mpflash/basicgit.py,sha256=
|
4
|
+
mpflash/basicgit.py,sha256=li6g0AsOEp2hTfGy25y-ZKvC9QFTDlv1cr6dmY_pTyY,9497
|
5
5
|
mpflash/bootloader/__init__.py,sha256=Qy3E6tETPnzMga9LgD5UgOvJ0zZIBEqhtEVb4v8CTWQ,107
|
6
6
|
mpflash/bootloader/activate.py,sha256=FlO4XQlKyoOuvmDdj_0u_mjNPhjGwB_K17jQ-8nSXRA,2361
|
7
7
|
mpflash/bootloader/detect.py,sha256=fBrILi7-ICRaregqms3PYqwiQVAJC0rXVhpyzDkoPQI,2690
|
@@ -13,7 +13,7 @@ mpflash/cli_flash.py,sha256=pVqEsDocDT3KmIMTpXdym-ZlzThLSIp6oVtYib65dys,7595
|
|
13
13
|
mpflash/cli_group.py,sha256=VWwYHiPVV19sQEr5lL8LlcPyZ-A6Gs79eMDJy8LLt90,2615
|
14
14
|
mpflash/cli_list.py,sha256=ja21AZ4yghGTtOHkEtV1EOmT6EYxOiU2gzJc-mZaDto,2427
|
15
15
|
mpflash/cli_main.py,sha256=5EkvzsqOUDXvNaW814oSUcPWeNhnwh78Sg0MteDv_fk,1133
|
16
|
-
mpflash/common.py,sha256=
|
16
|
+
mpflash/common.py,sha256=f7yOivJCXiIs5aywbPMrMjz4T4036njEp8wXvdyHTnI,7398
|
17
17
|
mpflash/config.py,sha256=tdpvAvAlpco1GfeG2evn5tAKYluLEanqwrrvkir7QcQ,1073
|
18
18
|
mpflash/connected.py,sha256=woYhuXoWpfzRMDUpBLVQZbVTGtMsKWNd5z1rsR1ELXA,3578
|
19
19
|
mpflash/download.py,sha256=wE4uBSFFMAKOBH4jwHweL0wVYh4vi74t1673ku_IeoA,14305
|
@@ -36,7 +36,7 @@ mpflash/mpboard_id/__init__.py,sha256=5xSmiAHafjT00MG30S7Uv5hufOFKJy0ZvrXuUfaCms
|
|
36
36
|
mpflash/mpboard_id/add_boards.py,sha256=47TtN98FVc6PvuOr-3-g3LacYW8JvXpM5Gr_jhdUGEU,9630
|
37
37
|
mpflash/mpboard_id/board.py,sha256=CwtBux8y7GDUe7CADVxL8YefGRl9Fg8OAJBUhgaBYCI,1151
|
38
38
|
mpflash/mpboard_id/board_id.py,sha256=3Qeo9cQOfn6EQ0gr5MHsl0Nk7is_piYrz0mMbV2LC-Q,2957
|
39
|
-
mpflash/mpboard_id/board_info.zip,sha256=
|
39
|
+
mpflash/mpboard_id/board_info.zip,sha256=XkIk35v6LotRMClCU-zEvo1zQiKXZAqkHfwLP4JhfaM,20102
|
40
40
|
mpflash/mpboard_id/store.py,sha256=n85vnUAxGKv1C23wkm22ZFAFGK6AZZiCFvc1lGJJjis,1703
|
41
41
|
mpflash/mpremoteboard/__init__.py,sha256=3F6vZHM1znUOnAo0ne-FalApM6vwbTNYg4kJwkS1gNI,9521
|
42
42
|
mpflash/mpremoteboard/mpy_fw_info.py,sha256=eRjhqN7MpmYE9TiS4iukquZZs3QE_lD5zv_vOPSjNrk,4821
|
@@ -46,8 +46,8 @@ mpflash/vendor/dfu.py,sha256=ZXMcE6aH4-43Wh4tbQT4U-q-BU3RUiL3JAxmP_QAK2s,5755
|
|
46
46
|
mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
|
47
47
|
mpflash/vendor/readme.md,sha256=iIIZxuLUIGHQ0KODzYVtMezsztvyxCXcNJp_AzwTIPk,86
|
48
48
|
mpflash/versions.py,sha256=EZtIe2RdBobhZaRIN7I-zZVNJ38CD_H8s3W8gXX9-IY,4627
|
49
|
-
mpflash-1.0.
|
50
|
-
mpflash-1.0.
|
51
|
-
mpflash-1.0.
|
52
|
-
mpflash-1.0.
|
53
|
-
mpflash-1.0.
|
49
|
+
mpflash-1.24.0.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
|
50
|
+
mpflash-1.24.0.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
|
51
|
+
mpflash-1.24.0.dist-info/METADATA,sha256=dsobVQCNpxJcB_pNe2Yk6NgEGVmd-IXc0_W_GNL8BME,17650
|
52
|
+
mpflash-1.24.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
53
|
+
mpflash-1.24.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|