adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

The release action is publishing .py with invalid __version__ #127

Closed askpatrickw closed 3 years ago

askpatrickw commented 3 years ago

@lesamouraipourpre originally reported this in the Build Tools repo: https://github.com/adafruit/circuitpython-build-tools/issues/70

And they gave an EXCELLENT assessment of the issue

After reading far too much documentation and github repos I think I've got it figured down as follows:

Currently in .github/workflows/release.yml (simplified):

  • build the release bundles (.py, & .mpy) for github and used by circup. As part of this circuitpython-build-tools munges the version information into the files with the method _munge_to_temp
  • python setup.py sdist and python setup.py bdist_wheel --universal. These are what gets uploaded to PyPi and are using the unmunged files.

The fix would be to move the version munging to it's own earlier step and do it in place. The files are going to be deleted from the (docker?) container anyway once the release is completed:

  • munge the version information into the files in place.
  • build the release bundles for github.
  • python setup.py for uploading to PyPi.

This is far above the knowledge level that I feel I have in relation to github/PyPi/CircuitPython and I don't know if this is a viable way to achieve this.