-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Publish mpy files on Release creation #168
Conversation
The problem with this is that mpy files are versioned and can only be used on the version of MicroPython they were generated from. So these releases will only work with the current version of MicroPython, and are bound to break as soon as a new release comes out and the mpy version is increased. The MicroPython folks have a solution for this, but the mpy repository they maintain is not open to third party packages, they just use it for the MicroPython standard library. Once and if they decide to allow third parties to upload packages this problem will be resolved, and people will be able to install mpy files directly, and without having to provide custom URL locations. |
docs/intro.rst
Outdated
@@ -16,6 +16,11 @@ them to *.mpy* files. These source files can also be | |||
`frozen <https://docs.micropython.org/en/latest/develop/optimizations.html?highlight=frozen#frozen-bytecode>`_ | |||
and incorporated into a custom MicroPython firmware. | |||
|
|||
Alternatively you can install using `mpremote` and `mip` | |||
``` | |||
mpremote a0 mip install https://github.com/miguelgrinberg/microdot/releases/download/v1.3.3/microdot.mpy |
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 method of installation is flawed, because mpy files cannot be used across MicroPython versions. When new MicroPython releases are out the mpy files that were archived in the release will not work anymore. Basically you need a set of mpy files for each MicroPython release.
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.
Updated to use include the micropython version
f4190f5
to
6a9bf75
Compare
I didn't know this. I have updated the PR to compile the mpy files for the latest 5 versions of micropython/mpy-cross. And create a release for each set of compiled files. Feel free to close the PR if you aren't interested in doing this. |
Are there any other third-party projects implementing this type of solution that you know of? What I see is that this still does not address the problem that once a new MicroPython release comes out, none of the existing releases of Microdot will have the mpy files for it. As I said above, the MicroPython project needs to figure out a way to support third-party packages, and they haven't done that yet. See micropython/micropython-lib#578 and #67 for context on the discussions that have already happened on this topic. |
Not that I know of but it doesn't seem like an unresonable way to approach the problem
We could approach this by having a scheduled job that will run regularly, iterate over all tags and compile the mpy files for the latest released mpy-cross. At this point I'm just using this as an opportunity to play with github actions. Sorry if I'm being annoying. |
f61aca1
to
bf7aa16
Compare
9eef5a7
to
e329d1a
Compare
e329d1a
to
79947c3
Compare
While I continue to wait for MicroPython to release a solution for third-party packages, I have added a section in the documentation on cross-compiling and freezing Microdot. |
This PR will automatically compile
mpy
files for any.py
files insrc/
The workflow has 3 modes:
v*.*.*
), python source files insrc/
will be complied for the latest 5 versions of micropython/mpy-cross and a release created for each version of micropython/mpy-cross with the compiled mpy files attached as assets.Example workflow:
https://github.com/markafarrell/microdot/actions/runs/6211289626
v*.*.*
, python source files insrc/
will be complied for the latest version of micropython/mpy-cross and a release created with the compiled mpy files attached as assets. This will mean that when new version of mpy-cross are released there will also be compiled version of microdot available for people to use.Example workflow:
https://github.com/markafarrell/microdot/actions/runs/6211317787
["1.19.0", "1.19.1"]
. This will result in releases being created for all tags matchingv*.*.*
compiled for the supplied versions of micropython. This will allow for the ad-hoc creation of compiled versions of microdot for any available version of micro-python.Example workflow:
https://github.com/markafarrell/microdot/actions/runs/6211299190
This will make it easier for consumers to be able to consume microdot using
mip
e.g.