upip - Self-hosted package manager
Re: Self-hosted package manager
Works fine on fresh debian installation
Re: Self-hosted package manager
Thanks for testing!
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Self-hosted package manager (upip)
upip is now bundled with Unix binary as a frozen module. To use:
Code: Select all
micropython -m upip
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: upip - Self-hosted package manager
Ok, the last thing which was required to fully enable upip was builtin SSL support on MicroPython level. Module "ussl", using axTLS library was recently committed to master. Here are the steps to try it:
1. Clone uPy with submodules (recursively):
2. If you already have non-recursive clone, pull submodules using:
3. cd unix
4. Build axtls:
You can specify crosscompiling and target options as usual, e.g. MICROPY_FORCE_32BIT=1. Note that this will rebuild axtls each time (this is done to make sure that library corresponds to crosscompiling and target options passed).
5. Build unix port, enabling module ussl:
6. Test that module ussl is there:
7. That's all, upip is now fully self-contained and doesn't depend on wget binary present (it still falls back to it if ussl is not available).
I'd appreciate if different people tested the steps above on their systems. The eventual plan is to enable modussl by default. And of course, this opens up possibility to use upip on baremetal targets (but of course, this will require some work).
1. Clone uPy with submodules (recursively):
Code: Select all
git clone --recursive https://github.com/micropython/micropython
Code: Select all
git submodule update --init
4. Build axtls:
Code: Select all
make axtls
5. Build unix port, enabling module ussl:
Code: Select all
make MICROPY_PY_USSL=1
Code: Select all
./micropython
>>> import ussl
>>>
Code: Select all
micropython -m upip install micropython-os
I'd appreciate if different people tested the steps above on their systems. The eventual plan is to enable modussl by default. And of course, this opens up possibility to use upip on baremetal targets (but of course, this will require some work).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: upip - Self-hosted package manager
Hi pfalcon, ran this in my local repo and worked absolutely fine.
The default path for libs is ~/.micropython, is there a way to configure this so the micropython executable picks up the libs also?
Thank you for your work!
The default path for libs is ~/.micropython, is there a way to configure this so the micropython executable picks up the libs also?
Thank you for your work!
Re: upip - Self-hosted package manager
Thanks for testing!
What do you mean? The default for upip is the same as for micropython executable, so after you installed module(s) with upip, you can start up executable and import them.The default path for libs is ~/.micropython, is there a way to configure this so the micropython executable picks up the libs also?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: upip - Self-hosted package manager
I'll also confirm that this worked for me (including the install of micropython-os) and I was able to import os when I reran micropython after installing it.
I was building using Ubuntu 14.04.3 LTS.
I was building using Ubuntu 14.04.3 LTS.
Re: upip - Self-hosted package manager
@pfalcon - so assuming that I've installed some modules (like micropython-os) what's the procedure for keeping them up-to-date?
Right now it looks like I'd have to keep track of all of the various modules installed and then reinstall them.
Right now it looks like I'd have to keep track of all of the various modules installed and then reinstall them.
Re: upip - Self-hosted package manager
Yes, importing and using the libs works fine, I tried the os module. What I meant was, upip creates a directory in the user folder called .micropython/lib under which the installed libs go, unless I'm missing something. Is it possible to keep the libraries someplace else, for example the same directory as the unix build, rather than in user home dir.pfalcon wrote:...you can start up executable and import them.
Re: upip - Self-hosted package manager
Here's the code which determines the path used:
https://github.com/micropython/micropyt ... #L385-L392
So, you can do: and it will use that.
You can examine the library search path from within micropython by doing: and if I were instead to do: we see that the import of os fails because I don't have it installed in /home/mmm.
You can also influence the directory that the builtin upip uses by using the -p option on the upip install command:
https://github.com/micropython/micropyt ... #L385-L392
So, you can do:
Code: Select all
MICROPYPATH=/some/other/dir ./micropython
You can examine the library search path from within micropython by doing:
Code: Select all
2530 >./micropython
MicroPython v1.4.6-89-g556c8a9 on 2015-10-14; linux version
Use CTRL-D to exit, CTRL-E for paste mode
>>> import sys
>>> sys.path
['', '/home/dhylands/.micropython/lib', '/usr/lib/micropython']
>>> import os
>>>
Code: Select all
2531 >MICROPYPATH=/home/mmm ./micropython
MicroPython v1.4.6-89-g556c8a9 on 2015-10-14; linux version
Use CTRL-D to exit, CTRL-E for paste mode
>>> import sys
>>> sys.path
['', '/home/mmm']
>>> import os
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'os'
>>>
You can also influence the directory that the builtin upip uses by using the -p option on the upip install command:
Code: Select all
2532 >./micropython -m upip install -p ~/mp micropython-os
Installing to: /home/dhylands/mp/
Installing micropython-os 0.3 from https://pypi.python.org/packages/source/m/micropython-os/micropython-os-0.3.tar.gz
Created /home/dhylands/mp/
Created /home/dhylands/mp/os/
Installing micropython-ffilib 0.1.2 from https://pypi.python.org/packages/source/m/micropython-ffilib/micropython-ffilib-0.1.2.tar.gz
Installing micropython-errno 0.1.3 from https://pypi.python.org/packages/source/m/micropython-errno/micropython-errno-0.1.3.tar.gz
Installing micropython-stat 0.5 from https://pypi.python.org/packages/source/m/micropython-stat/micropython-stat-0.5.tar.gz