Skip to content

Conversation

@jimmo
Copy link
Member

@jimmo jimmo commented Mar 31, 2023

This PR adds a mechansim to allow micropython-lib packages to be published to PyPI for use by CPython.

The idea is that there are some packages (in the micropython directory) that do not have CPython counterparts -- essentially our version is the "original" or "upstream" for these packages. As opposed to a package in the python-stdlib or python-ecosys directories, where the micropython-lib is our version of those packages -- if you were using CPython you'd use the "real" one instead.

This adds a tool that can parse a package's manifest and generate a Python project directory (with pyproject.toml) suitable for building and uploading to PyPI. (Note this requires micropython/micropython#11162 to be merged first).

This is enabled for the micropython/senml package which has no counterpart in the PyPI. Note that this depends on cbor2, which does exist in PyPI, so the CPython version, micropython-senml will depend on the "real" version instead.

@brainelectronics
Copy link

This seems to implement kind of inverse "functionality" of https://github.com/brainelectronics/micropython-package-validation which creates a package.json from a setup.py. Excited to see this!

This is so the package knows the "upstream" name of the corresponding PyPI
package that it's based on.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
jimmo added 3 commits April 7, 2023 13:24
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This tool makes a buildable package (including pyproject.toml) from
supported micropython-lib packages, suitable for publishing to PyPI and
using from CPython.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@dpgeorge dpgeorge merged commit 01db3da into micropython:master Apr 7, 2023
@dpgeorge
Copy link
Member

dpgeorge commented Apr 7, 2023

The CI here now passes after the changes to micropython were merged.

I also updated the manifest changes to put description before version. That's the convention that seems to be more widely used elsewhere in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants