adafruit / circuitpython-build-tools

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

Fix the single file libraries being copied as source. #88

Closed Neradoc closed 2 years ago

Neradoc commented 2 years ago

The code generates a temp file with the library version before converting it to MPY or copying it as-is. For windows compatibility (#84), the temporary file must be copied outside of the with block using the file's name.

In this PR we only keep the temporary file open the time to write to it, and then do the rest (either run mpy_cross or copy with shutil) with the file's name.

The latest release of the bundles is bad, but previous ones are good because this repository was not published to pypi between the windows compatibilty PR and yesterday. This PR, if it tests well, should be published before publishing a fixed release of the bundles.