Custom build scipt
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
General introduction
During the investigation whether poetry is the right tool for our company, I have bumped into undocumented build
option. It seems that I can do something like this:
[tool.poetry]
build = "my_custom_build.py"
When I do, poetry adds following two lines to generated setup.py
in sdist
:
from my_custom_build import *
build(setup_kwargs)
When creating wheel, poetry executes the build
function in my_custom_build.py
.
Issue
I really like this behaviour, because it allows me to execute custom build steps like compilation of translations, generating python modules from grpc protobuf files and so on.
However, the build
option is undocumented. I propose that we document this behaviour, because it can be really useful.
Also, parsing of this option baffles me, because it’s splitted by the dots and only the first part is used as the module name. Which means that I can only use python modules in the root directory. This is confusing and it could be improved (accepting a dotted path to python module seems like a logical choice).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (1 by maintainers)
Top GitHub Comments
@sdispater: Thank you for elaborating! I’m looking forward to the new solution. I’d just like it to support generating python modules during the build and including those generated modules to the (wheel) distribution. This is something I currently do with custom
setup.py
build step and this functionality is really important for me. If needed, I can lend a hand in implementation.Is there a way to run a pre-build script?