Skip to content

pydevices publishing: own-package MIP packages and PyPI extras (for bledev) - #52

Open
bdbarnett wants to merge 1 commit into
mainfrom
bledev-packaging
Open

bdbarnett wants to merge 1 commit into
mainfrom
bledev-packaging

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

This teaches the pydevices publisher two mip-split.toml keys that bledev needs (pydevices workspace docs/ble.md §3):

  • own-package = true moves a lib/ package out of the pydevices MIP package. It publishes beside it as micropython/pydevices/<name>, and its requires become require() lines. bledev uses it so a board without a radio doesn't carry BLE, and so mip.install("bledev") brings aioble with it.
  • pypi-extras adds optional dependencies to the pydevices wheel. bledev's { ble = ["bleak>=1.0"] } becomes pip install "pydevices[ble]". bledev itself stays inside the wheel.

An unknown key in a section now fails the sync. So does requires without own-package, because a package inside pydevices has no manifest to put them in. Without the flag, nothing changes: the tests include that control.

Checked end to end: I ran the sync against PyDevices/pydevices#78, built the MIP index from its output with tools/build.py, and installed bledev from that index onto an ESP32-S3. The install brought /lib/bledev and /lib/aioble, and both imported. tests/ passes (42), 7 of them new.

To take effect: after the merge, this needs a new publishing-v* tag, and pydevices/.github/workflows/publish-release-packages.yml needs its pin moved to that tag. Until then pydevices keeps shipping bledev inside pydevices.

A mip-split.toml section can now say own-package = true: that lib/
package leaves the pydevices MIP package and publishes beside it, with
its requires as require() lines. PyPI is unchanged except that a
section's pypi-extras become optional dependencies of the pydevices
wheel. bledev is the first user (pydevices docs/ble.md section 3):
mip.install("bledev") brings aioble, and pip install "pydevices[ble]"
brings bleak. Unknown section keys now fail the sync.

Checked end to end: the sync against the bledev branch, the index build
with those manifests, and a mip install of bledev from that index on an
ESP32-S3, which installed bledev and aioble and imported.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant