-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
mpremote: Implement mip install from GitLab. #13791
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13791 +/- ##
=======================================
Coverage 98.39% 98.39%
=======================================
Files 161 161
Lines 21204 21204
=======================================
Hits 20864 20864
Misses 340 340 ☔ View full report in Codecov by Sentry. |
Code size report:
|
Both pull requests are link to the same implementation of mip install from GitLab.
Signed-off-by: Olivier Lenoir olivier.len02@gmail.com micropython/micropython-lib#816 Modify _rewrite_url() to allow mip install from gitlab: repository. Signed-off-by: Olivier Lenoir olivier.len02@gmail.com mpremote: Implement mip install from GitLab. tools/mpremote/README.md: Add mip install gitlab:org/repo@branch. tools/mpremote/mpremote/mip.py: Implement install from GitLab. mpremote/mpremote/main.py: Add gitlab:org/repo, gitlab:org/repo@branch. docs/reference/packages.rst: Mip install from GitLab. docs/reference/mpremote.rst: Install package from GitLab. Signed-off-by: Olivier Lenoir olivier.len02@gmail.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @OlivierLenoir !
docs/reference/packages.rst
Outdated
@@ -56,6 +56,24 @@ If no json file is specified, then "package.json" is implicitly added:: | |||
>>> mip.install("github:org/repo") # Uses default branch of that repo | |||
>>> mip.install("github:org/repo", version="branch-or-tag") | |||
|
|||
The URL can also start with ``gitlab:`` as a simple way of pointing to content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding docs.
This section mostly just duplicates the above though, and because the gitlab support works in exactly the same way at github, maybe just say
The URL can also start with ``gitlab:`` and works in exactly the same way as GitHub URLs described above ``gitlab:org/repo[/path]``, including support for branches.
@jimmo , I've aggregated both topics into one. I've also added a deps example with gitlab:. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating! Please squash the commits down to a single commit (or if you want, one to the code and one to the docs).
docs/reference/packages.rst
Outdated
The URL can also start with ``github:`` as a simple way of pointing to content | ||
hosted on GitHub:: | ||
The URL can also start with ``github:`` or ``gitlab:`` as a simple way of pointing to content | ||
hosted on GitHub:: or GitLab:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra ::
after GitHub
|
@jimmo, I've fix the extra :: after github. git rebase -i HEAD~<number_of_commit>
git push --force-with-lease As 5 files have been updated, what should be the commit first line and comment? |
8b232e9
to
370e6a1
Compare
You PR seems completely messed up, since it contains all the STATIC->static changes. |
370e6a1
to
e32d0ff
Compare
I'm trying to rebase my commit into one, but it fail because I did not format the commit message as it should. |
@OlivierLenoir This might help: https://github.com/jimmo/git-and-micropython Basically if you do a |
e32d0ff
to
4d70f62
Compare
@jimmo I think it's now correct, thanks to your help: https://github.com/jimmo/git-and-micropython. |
|
||
More sophisticated packages (i.e. with more than one file, or with dependencies) | ||
can be downloaded by specifying the path to their ``package.json``. | ||
|
||
>>> mip.install("http://example.com/x/package.json") | ||
>>> mip.install("github:org/user/path/package.json") | ||
>>> mip.install("gitlab:org/user/path/package.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering but do we really want to repeat this in every single example in all involved readme/.rst files? Because suppose we add another method then we'd also have to adjust all locations again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just consider that example should be explicit to ease search and understanding.
I've done it searching for github:, and now gitlab:.
$ grep -rl "github:\|gitlab:"
tools/mpremote/README.md
tools/mpremote/mpremote/mip.py
tools/mpremote/mpremote/main.py
docs/reference/packages.rst
docs/reference/mpremote.rst
Changes are: - main.py: Add gitlab:org/repo, gitlab:org/repo@branch. - mip.py: Implement install from GitLab. - README.md: Add mip install gitlab:org/repo@branch example. Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>
Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>
Thanks for the contribution! Now merged. |
mpremote: Implement mip install from GitLab.
tools/mpremote/README.md: Add mip install gitlab:org/repo@branch.
Add example
mpremote mip install gitlab:org/repo@branch
.tools/mpremote/mpremote/mip.py: Implement install from GitLab.
Modify _rewrite_url() to allow mip install from
gitlab:
repository.mpremote/mpremote/main.py: Add gitlab:org/repo, gitlab:org/repo@branch.
Modify argparse_mip() for gitlab:org/repo, gitlab:org/repo@branch.
docs/reference/packages.rst: Mip install from GitLab.
Describe how to mip install from GitLab.
docs/reference/mpremote.rst: Install package from GitLab.
Install the package from the specified branch at org/repo on GitLab.
Signed-off-by: Olivier Lenoir olivier.len02@gmail.com