@@ -7,7 +7,7 @@ Installing packages with ``mip``
7
7
--------------------------------
8
8
9
9
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 ).
11
11
12
12
``mip `` ("mip installs packages") is similar in concept to Python's ``pip `` tool,
13
13
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::
38
38
When installing a file directly, the ``target `` argument is still supported to set
39
39
the destination path, but ``mpy `` and ``version `` are ignored.
40
40
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 ::
43
43
44
44
>>> mip.install("github:org/repo/path/foo.py") # Uses default branch
45
45
>>> 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
46
48
47
49
More sophisticated packages (i.e. with more than one file, or with dependencies)
48
50
can be downloaded by specifying the path to their ``package.json ``.
49
51
50
52
>>> mip.install(" http://example.com/x/package.json" )
51
53
>>> mip.install(" github:org/user/path/package.json" )
54
+ >>> mip.install(" gitlab:org/user/path/package.json" )
52
55
53
56
If no json file is specified, then "package.json" is implicitly added::
54
57
55
58
>>> mip.install("http://example.com/x/")
56
59
>>> mip.install("github:org/repo") # Uses default branch of that repo
57
60
>>> 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")
59
63
60
64
Using ``mip `` on the Unix port
61
65
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -83,6 +87,8 @@ can be used from a host PC to install packages to a locally connected device
83
87
$ mpremote mip install http://example.com/x/y/foo.py
84
88
$ mpremote mip install github:org/repo
85
89
$ 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
86
92
87
93
The ``--target=path ``, ``--no-mpy ``, and ``--index `` arguments can be set::
88
94
@@ -120,7 +126,8 @@ A typical ``package.json`` for an example ``mlx90640`` library looks like::
120
126
"deps": [
121
127
["collections-defaultdict", "latest"],
122
128
["os-path", "latest"],
123
- ["github:org/micropython-additions", "main"]
129
+ ["github:org/micropython-additions", "main"],
130
+ ["gitlab:org/micropython-otheradditions", "main"]
124
131
],
125
132
"version": "0.2"
126
133
}
0 commit comments