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.
For single file libraries, the temp file was ALWAYS copied back to the mpy file, making them invalid.
The temporary files for the package libraries were not deleted (when using mpy), but that has no impact on the bundles.
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.
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.