-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg: micropython: initial commit #2968
Conversation
awesome |
I PR'ed this upstream: micropython/micropython#1249 |
the "help()" problem somehow only shows with pyterm. Using picocom everything works fine. |
pyterm handles |
@OlegHahm Lol! You know the feeling, staring at the debugger, debugging something that gets affected by debugging, but it should work, thinking, "WTF'ing hell is happening here!?" ;) |
Sorry for that. I should looked at the todos... |
Needs rebase |
I'm still really excited for this! Let's try to get it in for 2016.07! |
ping? |
Any chance to see this in the next release ? (+1 on my side) |
I heard somewhere that you could do cool stuff with (Micro)Python on RIOT... |
and from #2968 (comment):
May I ask how a orderly set of patches is a bigger maintanence nightmare than pointing to some "random guy's" fork? You still have to rebase the patches (aka commits) every time you update the package. Granted, these are 3 commands (2 if you know what your doing and don't use the git rebase -i upstream/master vs. git rebase -i upstream/master
rm *.patch
git format-patch upstream/master
cp *.patch ../RIOT/pkg/micropython/patches but in the end it is way better understandable and transparent what modifications were done to the upstream right from the RIOT repository. Yes, there were reviewers being confused about patches in the past, because GitHub renders the change confusingly, but that is the only "nightmare" I can think of. This however, is more about personal habits than maintainability. Another thing to consider is maintenance by other users: If I update the |
Well, because the workflow for doing changes with patches vs fork changes from:
to
Essentially the whole github workflow is broken when using patches. |
ff6941a
to
f73c1c5
Compare
this |
f73c1c5
to
acf1708
Compare
|
In the case of this PR, no patches would be required since the RIOT port is only adding adaption files to micropython upstream (in ports/riot). I have a branch ;) that adds the adaption code in a subfolder of the RIOT package and copy the these files on the fly in the upstream micropython ports/riot directory. That could work indeed and it's self contained. This PR is based on a branch in @kaspar030's fork that is used in a PR to micropython upstream (micropython/micropython#1249). Once the micropython PR is merged, we can just update the package URL/VERSION in RIOT to point to the upstream micropython url /commit. |
https://github.com/RIOT-OS/RIOT/pull/2968/files#r347873773 is still unaddressed. |
You could still have a fork (I used to do this with lwIP before lwIP got a better porting layer / our make system got a better handling for Why does any other operating system find patches just fine to use with packages, while for RIOT according to you it is a maintenance burden? |
No idea, but IMHO patches are hell. |
Yeah, to me, having the extra layer of pulling the source from github (or optionally a local folder) is much less work than dealing with patches, especially when collaborating. patches are always on top of what git/github already provides. Reviewing changes to patches is extremely cumbersome. |
In case you missed #2968 (comment), there's no need for patches in the micropython port. The contributed files are orthogonal with the current micropython code base: they are put in a separate subdirectory. But I find it nice to contribute the RIOT adaption layer upstream: it makes it visible to micropython that a port for RIOT exists. |
* interpreter works fairly well on native and Cortex-M, it has not seen much | ||
* testing. | ||
* | ||
* ## Configuration options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section should be removed now: it's duplicated with the new one added below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. I removed the old one and moved the updated one up.
To me it is a matter of consistency and traceability. Let's say we have contributor I also don't get the PR argument. Your workflow would mean two PRs: One against the contributors fork and one against RIOT. Even worse, the PR against RIOT gives no immediate transparency about what the change is about. With patches just one PR is needed, so way lower maintenence burden for everyone involved + the patches and a well documented version jump give a better transparency about what is changed. But granted, I'm talking more about a stable package than a package currently under development like this one or @aabadie, I read your comment and think it might be a good compromise until the RIOT code is merged upstream. |
ok, then let me take back that general statement. In this case, we do expect quite some development work (until the changes are upstreamed), and the patches are quite substantial (>1300 lines spread over >20 commits), so I think in this case, we're better off with a (temporary) fork (and working with the patches would be a nightmare 😉). |
Accepted. @aabadie's solution could also be a solution, but that would mean, once the changes are upstreamed they need to be removed again. Don't know what is worse 😅. |
Ideally the first step would be to revive micropython/micropython#1249, which just means remove WIP from the PR title and add a comment that this PR is ready. Maybe it could then be merged quite fast and the RIOT package could directly point to micropython upstream. |
ACK when #2968 (review) is addressed |
@aabadie do you agree on this? |
That is parallel work. No need to wait with this PR. Also, I'd rather ask them to take another look at the upstream PR once all machine API's that @dpgeorge mentioned are actually implemented and when there's a way to compile from within MicroPython. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash
929d9a0
to
b5743ca
Compare
All green, GO! |
Finally! 😉 Thanks everyone involved! |
Yeah! Awesome! Thanks for the great work. |
This PR adds Micro Python as pkg (and a tests/ example).
It works on native, and I tried arduino due and iot-lab_M3. It should work on all 32bit patforms with enough (~12k, ~95k) RAM and flash.
The port doesn't do much as no libraries are included in the image.
- [ ] there needs to be either a mapping for riot libs -> python libs or an adaption of micropython's "pyb." lib- [ ] integrate with VFS(postponed)- compile micropython for 16bit platforms depending on RIOT platform(probably just needs too much memory)UPDATE 07/2019:
Needs #11841 for its(#11841 is in)git describe
-fix.