This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly include generated Python files in the wheel (#12)
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: * pypa/setuptools#3180 (comment) * pypa/setuptools#2591 This PR also includes some other improvements, including: * Better abstraction of the configuration object * Better hooking into setuptools * Use of logging instead of print * Better name for the command to compile the proto files
- Loading branch information
Showing
8 changed files
with
282 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
# Betterproto Setuptools plugin Release Notes | ||
|
||
## Summary | ||
|
||
<!-- Here goes a general summary of what this release is about --> | ||
|
||
## Upgrading | ||
|
||
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with --> | ||
|
||
## New Features | ||
|
||
<!-- Here goes the main new features and examples or instructions on how to use them --> | ||
|
||
## Bug Fixes | ||
|
||
<!-- Here goes notable bug fixes that are worth a special mention or explanation --> | ||
- Fix a bug where the generated files were not included in the wheel distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,12 @@ dynamic = ["version"] | |
name = "Frequenz Energy-as-a-Service GmbH" | ||
email = "[email protected]" | ||
|
||
[project.entry-points."setuptools.finalize_distribution_options"] | ||
finalize_distribution_options_betterproto = "setuptools_betterproto:finalize_distribution_options" | ||
|
||
[project.entry-points."distutils.commands"] | ||
build_betterproto = "setuptools_betterproto:CompileProto" | ||
compile_betterproto = "setuptools_betterproto:CompileBetterproto" | ||
add_proto_files = "setuptools_betterproto:AddProtoFiles" | ||
|
||
[project.optional-dependencies] | ||
dev-flake8 = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.