docs/reference/packages: Add GitHub repo to package example dependency.

Signed-off-by: Jonas Scharpf <jonas@brainelectronics.de>
pull/11670/head
Jonas Scharpf 2023-05-27 17:44:26 +02:00 zatwierdzone przez Damien George
rodzic 5159304ca1
commit 7a17596e1a
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -53,7 +53,7 @@ can be downloaded by specifying the path to their ``package.json``.
If no json file is specified, then "package.json" is implicitly added:: If no json file is specified, then "package.json" is implicitly added::
>>> mip.install("http://example.com/x/") >>> mip.install("http://example.com/x/")
>>> mip.install("github:org/repo") >>> mip.install("github:org/repo") # Uses default branch of that repo
>>> mip.install("github:org/repo", version="branch-or-tag") >>> mip.install("github:org/repo", version="branch-or-tag")
@ -108,9 +108,9 @@ https://github.com/micropython/micropython-lib for more information.
To write a "self-hosted" package that can be downloaded by ``mip`` or To write a "self-hosted" package that can be downloaded by ``mip`` or
``mpremote``, you need a static webserver (or GitHub) to host either a ``mpremote``, you need a static webserver (or GitHub) to host either a
single .py file, or a package.json file alongside your .py files. single .py file, or a ``package.json`` file alongside your .py files.
A typical package.json for an example ``mlx90640`` library looks like:: A typical ``package.json`` for an example ``mlx90640`` library looks like::
{ {
"urls": [ "urls": [
@ -119,7 +119,8 @@ A typical package.json for an example ``mlx90640`` library looks like::
], ],
"deps": [ "deps": [
["collections-defaultdict", "latest"], ["collections-defaultdict", "latest"],
["os-path", "latest"] ["os-path", "latest"],
["github:org/micropython-additions", "main"]
], ],
"version": "0.2" "version": "0.2"
} }
@ -127,7 +128,9 @@ A typical package.json for an example ``mlx90640`` library looks like::
This includes two files, hosted at a GitHub repo named This includes two files, hosted at a GitHub repo named
``org/micropython-mlx90640``, which install into the ``mlx90640`` directory on ``org/micropython-mlx90640``, which install into the ``mlx90640`` directory on
the device. It depends on ``collections-defaultdict`` and ``os-path`` which will the device. It depends on ``collections-defaultdict`` and ``os-path`` which will
be installed automatically. be installed automatically from the :term:`micropython-lib`. The third
dependency installs the content as defined by the ``package.json`` file of the
``main`` branch of the GitHub repo ``org/micropython-additions``.
Freezing packages Freezing packages
----------------- -----------------