kopia lustrzana https://github.com/micropython/micropython-lib
micropython/mip/mip/__init__.py: Implement install from gitlab.
Modify _rewrite_url() to allow mip install from `gitlab:` repository. Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>pull/816/head
rodzic
ffb07dbce5
commit
c0bf786a10
|
@ -73,6 +73,18 @@ def _rewrite_url(url, branch=None):
|
||||||
+ "/"
|
+ "/"
|
||||||
+ "/".join(url[2:])
|
+ "/".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
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,6 +140,7 @@ def _install_package(package, index, target, version, mpy):
|
||||||
package.startswith("http://")
|
package.startswith("http://")
|
||||||
or package.startswith("https://")
|
or package.startswith("https://")
|
||||||
or package.startswith("github:")
|
or package.startswith("github:")
|
||||||
|
or package.startswith("gitlab:")
|
||||||
):
|
):
|
||||||
if package.endswith(".py") or package.endswith(".mpy"):
|
if package.endswith(".py") or package.endswith(".mpy"):
|
||||||
print("Downloading {} to {}".format(package, target))
|
print("Downloading {} to {}".format(package, target))
|
||||||
|
|
Ładowanie…
Reference in New Issue