frequenz-floss / setuptools-betterproto

A modern setuptools plugin to generate Python files from proto files using betterproto
https://frequenz-floss.github.io/setuptools-betterproto/
MIT License
0 stars 2 forks source link

Properly include generated Python files in the wheel #12

Closed llucax closed 1 month ago

llucax commented 1 month ago

When building the wheel, the setuptools file discovery feature runs before the compile_betterproto sub-command is run, so the files are not included in the resulting wheel.

To overcome this issue we use a hack, by running the compile command early when the distribution options are being finalized, we make sure the files are present by the time the file discovery runs.

This is very hacky though, and even when it seems to work well in all tested cases (calling setuptools`setup() directly, build, pip install, pip install -e), I wouldn't be very surprised if it breaks in the future, so we probably will have to have an eye on it.

Unfortunately it seems there is no easy way to do this with setuptools:

This PR also includes some other improvements, including:

Marenz commented 1 month ago

Approved, but removed from the queue in case you want to react to the feedback

llucax commented 1 month ago

Updated:

llucax commented 1 month ago

Re-enabling auto-merge.