Skip to content

Commit e816b49

Browse files
OlivierLenoirdpgeorge
authored andcommitted
docs/reference: Document how to mip install packages from GitLab.
Signed-off-by: Olivier Lenoir <olivier.len02@gmail.com>
1 parent 85c85e8 commit e816b49

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

docs/reference/mpremote.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@ See :ref:`packages`.
682682
Install the package from the specified branch at org/repo on GitHub to the
683683
device. See :ref:`packages`.
684684

685+
.. code-block:: bash
686+
687+
mpremote mip install gitlab:org/repo@branch
688+
689+
Install the package from the specified branch at org/repo on GitLab to the
690+
device. See :ref:`packages`.
691+
685692
.. code-block:: bash
686693
687694
mpremote mip install --target /flash/third-party functools

docs/reference/packages.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Installing packages with ``mip``
77
--------------------------------
88

99
Network-capable boards include the ``mip`` module, which can install packages
10-
from :term:`micropython-lib` and from third-party sites (including GitHub).
10+
from :term:`micropython-lib` and from third-party sites (including GitHub, GitLab).
1111

1212
``mip`` ("mip installs packages") is similar in concept to Python's ``pip`` tool,
1313
however it does not use the PyPI index, rather it uses :term:`micropython-lib`
@@ -38,24 +38,28 @@ install third-party libraries. The simplest way is to download a file directly::
3838
When installing a file directly, the ``target`` argument is still supported to set
3939
the destination path, but ``mpy`` and ``version`` are ignored.
4040

41-
The URL can also start with ``github:`` as a simple way of pointing to content
42-
hosted on GitHub::
41+
The URL can also start with ``github:`` or ``gitlab:`` as a simple way of pointing to content
42+
hosted on GitHub or GitLab::
4343

4444
>>> mip.install("github:org/repo/path/foo.py") # Uses default branch
4545
>>> mip.install("github:org/repo/path/foo.py", version="branch-or-tag") # Optionally specify the branch or tag
46+
>>> mip.install("gitlab:org/repo/path/foo.py") # Uses default branch
47+
>>> mip.install("gitlab:org/repo/path/foo.py", version="branch-or-tag") # Optionally specify the branch or tag
4648

4749
More sophisticated packages (i.e. with more than one file, or with dependencies)
4850
can be downloaded by specifying the path to their ``package.json``.
4951

5052
>>> mip.install("http://example.com/x/package.json")
5153
>>> mip.install("github:org/user/path/package.json")
54+
>>> mip.install("gitlab:org/user/path/package.json")
5255

5356
If no json file is specified, then "package.json" is implicitly added::
5457

5558
>>> mip.install("http://example.com/x/")
5659
>>> mip.install("github:org/repo") # Uses default branch of that repo
5760
>>> mip.install("github:org/repo", version="branch-or-tag")
58-
61+
>>> mip.install("gitlab:org/repo") # Uses default branch of that repo
62+
>>> mip.install("gitlab:org/repo", version="branch-or-tag")
5963

6064
Using ``mip`` on the Unix port
6165
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -83,6 +87,8 @@ can be used from a host PC to install packages to a locally connected device
8387
$ mpremote mip install http://example.com/x/y/foo.py
8488
$ mpremote mip install github:org/repo
8589
$ mpremote mip install github:org/repo@branch-or-tag
90+
$ mpremote mip install gitlab:org/repo
91+
$ mpremote mip install gitlab:org/repo@branch-or-tag
8692

8793
The ``--target=path``, ``--no-mpy``, and ``--index`` arguments can be set::
8894

@@ -120,7 +126,8 @@ A typical ``package.json`` for an example ``mlx90640`` library looks like::
120126
"deps": [
121127
["collections-defaultdict", "latest"],
122128
["os-path", "latest"],
123-
["github:org/micropython-additions", "main"]
129+
["github:org/micropython-additions", "main"],
130+
["gitlab:org/micropython-otheradditions", "main"]
124131
],
125132
"version": "0.2"
126133
}

0 commit comments

Comments
 (0)