CircuitPython feature request: Run mpy-cross on python modules as an option #1337
Replies: 3 comments
-
@KM4YRI I've encountered this scenario playing with a Trinket M0 and a library that also needed to be processed by |
Beta Was this translation helpful? Give feedback.
-
The issue with mpy-cross is that it needs to match the exact version of the MicroPython runtime it is targetting. |
Beta Was this translation helpful? Give feedback.
-
I will move this feature request to our new discussion board here on Github, as that's where we from now on discuss new features. |
Beta Was this translation helpful? Give feedback.
-
On an Adafruit Trinket M0, I'm basically stuck using
mpy-cross
to minify a library that contains a 125-line python class down into a.mpy
file because it doesn't have the memory to lex and parse the file in real time. Which is understandable, but frustrating. Any little changes to the library require me to runmpy-cross
, copy that file to the M0 USB drive, go back to Mu, hit 'save', and then repeat over and over.Being that
mpy-cross
is just a regular old executable that could be called in asubprocess.Popen()
call, it wouldn't be that difficult to have Mu automate this. Ideally the source python files would need to reside in a folder on the PC, and then 'Save' or maybe a dedicated 'Build' button (which I dearly miss from my Arduino days) would copy the files over to the virtual USB drive.Would this be considered out of scope for this project? Assuming that the whole intention of Mu is to make Python programming simpler, this would certainly accomplish this goal. It would allow newcomers to write more code than they would normally be able to, without having to worry about toolchains and workflows that dip outside of what Mu can do on its own.
I'm familiar enough with Python and PyQt5 that it wouldn't be difficult to do this myself and file a pull request but wanted to open a dialog here.
Beta Was this translation helpful? Give feedback.
All reactions