adafruit / circuitpython-build-tools

Build scripts for CircuitPython libraries and the bundle
MIT License
28 stars 17 forks source link

Get package name from pyproject.toml, allow arbitrary files in packages #101

Closed jepler closed 11 months ago

jepler commented 11 months ago

This is more dependable, and when we know the package name we can glob inside it to get all files such as bin or ttf files.

This will allow e.g., 5x8.bin & ov5640_autofocus.bin within bundles.

the behavior of bundlefly and circup when encountering .bin files needs to be checked.

Tested by building modified pycamera bundle and the autofocus.bin file appears in the generated zip files:

pycamera-py-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096
pycamera-8.x-mpy-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096
pycamera-9.x-mpy-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096

There's at least one library in the bundle that has incorrect metadata and that leads to an error: https://github.com/adafruit/Adafruit_CircuitPython_Colorsys/pull/29

jepler commented 11 months ago

circup appears to use shutil.copytree, so it will copy files regardless of type/extension.

jepler commented 11 months ago

This'll require some metadata problems across multiple libs to be corrected.

jepler commented 11 months ago

The test failure appears to be due to wrong metadata. I think I've filed PRs with every affected library now.

jepler commented 11 months ago

I have settings.toml on the brain because of circuitpython, but it should be pyproject.toml everywhere here.

jepler commented 11 months ago

Trying to think of a creative way to let this land without requiring all those libs to be updated. Could be as simple as a blacklist of things that DON'T get the treatment, or disabling it in the communty bundle for now. (allowing the build process to opt out of using the new thing)

jepler commented 11 months ago

I've implemented a simple blacklist (of values that appear in py_modules today and are wrong) so that this can complete CI without all those related issues being closed.