PyOs and pyb test suite

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
antons
Posts: 2
Joined: Thu Dec 25, 2014 6:03 pm

PyOs and pyb test suite

Post by antons » Thu Dec 25, 2014 6:13 pm

Hello

I have a lot of fun with micro python. Thanks Damien for the great work done!

I created some test for the pyb libs
And I am working on a cooperative PyOS.

Yes yes, yet another operating system, but like to re-invent wheels.

You can check out the next gitub repo directly in the root of a (empty) micro SD card:
https://github.com/smeenka/micro-python-lib.git

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: PyOs and pyb test suite

Post by pfalcon » Fri Dec 26, 2014 6:16 pm

It's surely ok if you just like to reinvent the wheel. But otherwise, there's already project for complete Python standard library - http://forum.micropython.org/viewtopic.php?f=5&t=70 , which includes small implementation of asyncio - http://forum.micropython.org/viewtopic.php?f=3&t=85
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/

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: PyOs and pyb test suite

Post by Damien » Fri Dec 26, 2014 7:37 pm

Good to hear you are enjoying Micro Python! But please don't forget that by now it is more than just me working on the project :)

Related to what you are doing: A PyOS would be awesome!

antons
Posts: 2
Joined: Thu Dec 25, 2014 6:03 pm

Re: PyOs and pyb test suite

Post by antons » Sat Dec 27, 2014 11:03 am

Hello Team MicroPython
I started with the micro python library, but it was not clear to me how to use the library on the micropython board itself.
So I started to copy and paste parts of the library to an SD card, fixing some __init__.py stuff and writing for each lib a small test.

My lib is not meant as a replacement, but to get some stuff working for me, and maybe for somebody else.
What do you think of the idea to have a git repository which one can check out directly on the micro-python board, without a make step?

And about reinventing wheels: one can only re-invent a wheel after carefully studying the original... :-)
For me, embedded development with Python is really the way to go. So please go one with development.

Anton

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: PyOs and pyb test suite

Post by pfalcon » Sun Jan 04, 2015 3:00 pm

antons wrote:Hello Team MicroPython
I started with the micro python library, but it was not clear to me how to use the library on the micropython board itself.
Well, the basic idea is the same as for (any) Python: you make a requirements file with a list of dependency modules, then you run a package manager to deploy the dependencies. For Python this package manager is called "pip", for MicroPython - "pip-micropython". It is installed when you do "make install" for micropython on a host (and that's a prerequisite for comfortable development).

Specific example how that works is given in this thread: http://forum.micropython.org/viewtopic.php?f=5&t=221 (that example targets small embedded Linux systems, but there's very little difference from PyBoard or any other hardware capable of running MicroPython).
So I started to copy and paste parts of the library to an SD card, fixing some __init__.py stuff and writing for each lib a small test.

My lib is not meant as a replacement, but to get some stuff working for me, and maybe for somebody else.
Sounds good, https://github.com/micropython/micropython-lib has the same aim ;-).

What do you think of the idea to have a git repository which one can check out directly on the micro-python board, without a make step?
Taken literally, that's not possible - you cannot run git on pyboard. Just the same as you cannot run pip-micropython on a pyboard currently, so have to run it on a host, make it prepare a deployable directory image, and then copy it to pyboard.

If you mean "connect pyboard, change to its disk, and run git clone there", there're number of caveats to that approach. First, git clone contains hidden .git dir - it's not needed to run Python code, but takes space on a tiny filesystem. The more changes you make to the repository, the bigger .git dir, so soon you have very little space for source code and data, and then none at all. So, you can't just "git clone", you at least will need to do "rm -rf .git", and not forget about. The easiest way to not forget is to automate it with a script or a makefile.

It doesn't end there so. You might be caring about a single project now, but soon you (or somebody else) will work on another project, need more modules, then more, and more. Again, if you keep adding more and more modules to a monolithic repository, you will get less and less space on pyboard, until none at all. micropython-lib already contains many more modules than pyboard can fit.

And about reinventing wheels: one can only re-invent a wheel after carefully studying the original... :-)
For me, embedded development with Python is really the way to go. So please go one with development.

Anton
That's cool, and sounds good. There's one caveat though - if you spend too much time reinventing the wheel, you leave yourself less time to do something really new and exciting, so it's easier to get disappointed in a project and drop it... ;-).
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/

Post Reply