kopia lustrzana https://github.com/micropython/micropython
tools/mpremote/mpremote: Mip install from GitLab.
main.py: Add gitlab:org/repo, gitlab:org/repo@branch. mip.py: Implement install from GitLab. Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>
rodzic
bc424ddc41
commit
027a8849ac
|
@ -214,7 +214,7 @@ def argparse_mip():
|
|||
cmd_parser.add_argument(
|
||||
"packages",
|
||||
nargs="+",
|
||||
help="list package specifications, e.g. name, name@version, github:org/repo, github:org/repo@branch",
|
||||
help="list package specifications, e.g. name, name@version, github:org/repo, github:org/repo@branch, gitlab:org/repo, gitlab:org/repo@branch",
|
||||
)
|
||||
return cmd_parser
|
||||
|
||||
|
|
|
@ -65,6 +65,18 @@ def _rewrite_url(url, branch=None):
|
|||
+ "/"
|
||||
+ "/".join(url[2:])
|
||||
)
|
||||
elif url.startswith("gitlab:"):
|
||||
url = url[7:].split("/")
|
||||
url = (
|
||||
"https://gitlab.com/"
|
||||
+ url[0]
|
||||
+ "/"
|
||||
+ url[1]
|
||||
+ "/-/raw/"
|
||||
+ branch
|
||||
+ "/"
|
||||
+ "/".join(url[2:])
|
||||
)
|
||||
return url
|
||||
|
||||
|
||||
|
@ -116,6 +128,7 @@ def _install_package(transport, package, index, target, version, mpy):
|
|||
package.startswith("http://")
|
||||
or package.startswith("https://")
|
||||
or package.startswith("github:")
|
||||
or package.startswith("gitlab:")
|
||||
):
|
||||
if package.endswith(".py") or package.endswith(".mpy"):
|
||||
print(f"Downloading {package} to {target}")
|
||||
|
|
Ładowanie…
Reference in New Issue