1
0
mirror of https://github.com/pypiserver/pypiserver synced 2025-02-22 19:19:37 +01:00

doc/json_info: added usage description with micropython.

This commit is contained in:
awachtler 2021-08-13 06:57:13 +02:00
parent e7bc2bb75d
commit fb81ab767a

@ -884,6 +884,31 @@ these steps:
you may add the user under which ``pypiserver`` runs into the *shadow*
group, with a command like this: ``sudo usermod -a -G shadow pypy-user``.
Use with MicroPython
--------------------
The MicroPython interpreter for embedded devices can install packages with the
module ``upip.py``. The module uses a specialized json-endpoint to retrieve
package information. This endpoint is supported by ``pypiserver``.
It can be tested with the UNIX port of ``micropython``::
cd micropython
ports/unix/micropython -m tools.upip install -i http://my-server:8080 -p /tmp/mymodules micropython-foobar
Installing packages from the REPL of an embedded device works in this way:
.. code-block:: python
import network
import upip
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect('<your ESSID>', '<your password>')
upip.index_urls = ["http://my-server:8080"]
upip.install("micropython-foobar")
Furhter information on micropython-packaging can be found here: https://docs.micropython.org/en/latest/reference/packages.html
Sources
=======