-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
-
Poetry version: 1.7.1
-
Python version: 3.10.12
-
OS version and name: Ubuntu 22.04
-
pyproject.toml: pyproject.toml
-
build.py: build.py
-
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
In my pyproject.toml I have
[tool.poetry.build]
script = "build.py"
generate-setup-file = false
[build-system]
requires = ["poetry-core", "protoc-exe"]
build-backend = "poetry.core.masonry.api"
and my build.py invokes the protoc command, which is provided by the protoc-exe module, listed in [build-system].
This works fine with poetry install --sync:
% poetry install --sync
Installing dependencies from lock file
Preparing build environment with build-system requirements poetry-core, protoc-exe
Installing the current project: mypoetrytest (0.1.0)
But it fails with poetry build:
% poetry build
Preparing build environment with build-system requirements poetry-core, protoc-exe
Building mypoetrytest (0.1.0)
Traceback (most recent call last):
File "/home/cavedon/mypoetrytest/build.py", line 27, in <module>
build()
File "/home/cavedon/mypoetrytest/build.py", line 17, in build
subprocess.check_call(
File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'protoc'
Command '['/tmp/tmp0g_4j74h/.venv/bin/python', 'build.py']' returned non-zero exit status 1.
In the case of poetry build, the command protoc is in the bin directory of the virtualenv, but the bin directory is not added to the PATH environment variable.
Setting generate-setup-file = true does not help.