Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

micropython/mip/mip/__init__.py: Implement install from gitlab. #816

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions micropython/mip/mip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,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


Expand Down Expand Up @@ -128,6 +140,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