Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions micropython/mip/mip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# MicroPython package installer
# MIT license; Copyright (c) 2022 Jim Mussared
# Implement gitlab, Copyrigh (c) 2024 Olivier Lenoir

from micropython import const
import requests
Expand Down Expand Up @@ -73,6 +74,18 @@ def _rewrite_url(url, branch=None):
+ "/"
+ "/".join(url[2:])
)
if url.startswith("gitlab:"):
url = url[7:].split("/")
url = (
"https://gitlab.com/"
+ url[0]
+ "/"
+ url[1]
+ "/-/raw/"
+ branch
+ "/"
+ "/".join(url[2:])
)
return url


Expand Down Expand Up @@ -128,6 +141,7 @@ def _install_package(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("Downloading {} to {}".format(package, target))
Expand Down