|
1 | 1 | micropython-lib
|
2 | 2 | ===============
|
3 | 3 | micropython-lib is a project to develop a non-monolothic standard library
|
4 |
| -for MicroPython. Each module or package is available as a separate |
5 |
| -distribution package from PyPI. Each module is either written from scratch or |
6 |
| -ported from CPython. |
| 4 | +for MicroPython (https://github.com/micropython/micropython). Each module |
| 5 | +or package is available as a separate distribution package from PyPI. Each |
| 6 | +module is either written from scratch or ported from CPython. |
7 | 7 |
|
8 |
| -Note that the main target of micropython-lib is a "Unix" port of MicroPython |
9 |
| -(additional ports to support are to be determined). Actual system requirements |
10 |
| -vary per module. Though if a module is not related to I/O, the module should |
11 |
| -work without problem on bare-metal ports too (e.g. pyboard). |
| 8 | +Note that the main target of micropython-lib is a "Unix" port of MicroPython. |
| 9 | +Actual system requirements vary per module. Though if a module is not related |
| 10 | +to I/O, the module should work without problems on bare-metal ports too (e.g. |
| 11 | +pyboard). |
12 | 12 |
|
13 | 13 |
|
14 | 14 | Usage
|
15 | 15 | -----
|
16 | 16 | micropython-lib packages are published on PyPI (Python Package Index),
|
17 | 17 | the standard Python community package repository: http://pypi.python.org/ .
|
18 |
| -On PyPi, you can search for MicroPython related packages and read |
| 18 | +On PyPI, you can search for MicroPython related packages and read |
19 | 19 | additional package information.
|
20 | 20 |
|
21 | 21 | To install packages from PyPI for usage on your local system, use the
|
22 |
| -`pip-micropython` tool, which is a simple wrapper around the standard |
23 |
| -`pip` tool, which is used to install packages for CPython. |
24 |
| -The `pip-micropython` tool can be found in `tools` subdirectory |
25 |
| -of the main MicroPython repository (https://github.com/micropython/micropython). |
26 |
| -Just install the `pip-micropython` script somewhere on your `PATH`. |
27 |
| - |
28 |
| -Afterwards, just use `pip-micropython` in a way similar to `pip`: |
| 22 | +`upip` tool, which is MicroPython's native package manager, similar to |
| 23 | +`upip`, which is used to install packages for CPython. `upip` is bundled |
| 24 | +with MicroPython "Unix" port (i.e. if you build "Unix" port, you |
| 25 | +automatically have `upip` tool). Following examples assume that |
| 26 | +`micropython` binary is available on your `PATH`: |
29 | 27 |
|
30 | 28 | ~~~~
|
31 |
| -$ pip-micropython install micropython-copy |
| 29 | +$ micropython -m upip install micropython-pystone |
| 30 | +... |
32 | 31 | $ micropython
|
33 |
| ->>> import copy |
34 |
| ->>> copy.copy([1, 2, 3]) |
35 |
| -[1, 2, 3] |
| 32 | +>>> import pyston |
| 33 | +>>> pystone.main() |
| 34 | +Pystone(1.2) time for 50000 passes = 0.534 |
| 35 | +This machine benchmarks at 93633 pystones/second |
36 | 36 | ~~~~
|
37 | 37 |
|
38 |
| -Review the `pip-micropython` source code for more info. |
| 38 | +Run `micropython -m upip --help` for more information about `upip`. |
39 | 39 |
|
40 | 40 |
|
41 | 41 | Development
|
42 | 42 | -----------
|
43 | 43 | To install modules during development, use `make install`. By default, all
|
44 |
| -available packages will be installed. To install a specific module, add the |
| 44 | +available packages will be installed. To install a specific module, add the |
45 | 45 | `MOD=<module>` parameter to the end of the `make install` command.
|
46 | 46 |
|
47 | 47 |
|
48 | 48 | Links
|
49 | 49 | -----
|
50 |
| -More information is on GitHub and in the MicroPython forums: |
| 50 | +If you would like to trace evolution of MicroPython packaging support, |
| 51 | +you may find following links useful (note that they may contain outdated |
| 52 | +information): |
51 | 53 |
|
52 | 54 | * https://github.com/micropython/micropython/issues/405
|
53 | 55 | * http://forum.micropython.org/viewtopic.php?f=5&t=70
|
|
0 commit comments