Issue
I have a custom build section by using the following config in my pyproject.toml
generate-setup-file = false
script = "build.py"
The build.py script dynamically creates my package in a dynamically created directory, let's say my_real_package/ (does not exist at the moment of executing poetry build). In my pyproject.toml I have
[tool.poetry]
packages = [{include = "my_real_package"}]
Then when executing poetry build I am shown the error .../my_real_package does not contain any element at the start, because the my_real_package is created during the build and is not present at the start.
I tested and if I change packages = [{include = "package"}] (this directory exists as a package), run the build so that my_real_package is created and then change back packages = [{include = "my_real_package"}] and run again poetry build, it works.
So this tells me that updating to a warning the error for special cases (like when there is a custom build script) .../my_real_package does not contain any element will make everything work with a single poetry build command where I keep packages = [{include = "my_real_package"}] and my_real_package is dynamically created by my build.py script.
Poetry version: 1.5.1
Python version: 3.10
OS version and name: macOS 13.5
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.Issue
I have a custom build section by using the following config in my
pyproject.tomlThe
build.pyscript dynamically creates my package in a dynamically created directory, let's saymy_real_package/(does not exist at the moment of executingpoetry build). In mypyproject.tomlI haveThen when executing
poetry buildI am shown the error.../my_real_package does not contain any elementat the start, because themy_real_packageis created during the build and is not present at the start.I tested and if I change
packages = [{include = "package"}](this directory exists as a package), run the build so thatmy_real_packageis created and then change backpackages = [{include = "my_real_package"}]and run againpoetry build, it works.So this tells me that updating to a warning the error for special cases (like when there is a custom build script)
.../my_real_package does not contain any elementwill make everything work with a singlepoetry buildcommand where I keeppackages = [{include = "my_real_package"}]andmy_real_packageis dynamically created by mybuild.pyscript.