@@ -7,7 +7,7 @@ Installing packages with ``mip``
77--------------------------------
88
99Network-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,
1313however 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::
3838When installing a file directly, the ``target `` argument is still supported to set
3939the 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
4749More sophisticated packages (i.e. with more than one file, or with dependencies)
4850can 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
5356If 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
6064Using ``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
8793The ``--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