-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI tools defined in 'build_requires' not available during dependency install #8628
Comments
diff --git a/src/poetry/installation/chef.py b/src/poetry/installation/chef.py
index d801fb6d..4d554696 100644
--- a/src/poetry/installation/chef.py
+++ b/src/poetry/installation/chef.py
@@ -129,10 +129,8 @@ class Chef:
with ephemeral_environment(self._env.python) as venv:
env = IsolatedEnv(venv, self._pool)
- builder = ProjectBuilder(
- directory,
- python_executable=env.python_executable,
- runner=quiet_subprocess_runner,
+ builder = ProjectBuilder.from_isolated_env(
+ env, directory, runner=quiet_subprocess_runner
)
env.install(builder.build_system_requires) should do it (else |
I can observe this in my project that uses maturin. I guess it can be reproduced with the default maturin project. |
pull request welcome, I'm sure |
Thanks for the quick feedback, and getting a fix ready 🎉 I can confirm that this is fixed with the PR branch. |
* Drop support for Python 3.8 * Run `pyupgrade` with `--py39-plus` * Disallow poetry version `1.7.0`, to avoid python-poetry/poetry#8628 * Remove outdated `poetry config installer.modern-installation false` * Switch dependabot to weekly schedule * Fix type hints for paths * Re-lock dependencies
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue
When installing a poetry project with dependencies which require a CLI tool (defined in their
pyproject.toml
[build-system]requires
section), the build fails since the CLI tool is not available when the dependency is built. Building the dependency directly usingpython -m build
works.The following repository contains a minimal reproduction: https://github.com/greschd/poetry_bug_repro The CLI tool chosen is
pre-commit==2.3.0
. [1]Steps to reproduce:
Option 1 (using Docker):
git clone https://github.com/greschd/poetry_bug_repro.git
cd poetry_bug_repro
docker build .
This builds the
failing_build
target, which errors out with the traceback below (pre-commit does not exist). To see thatpython -m build
works (in the same directory):docker build --target=working_build .
Option 2 (direct):
git clone https://github.com/greschd/poetry_bug_repro.git
cd poetry_bug_repro/poetry_project
poetry install
This will either produce the same traceback as below, or complain that the pre-commit version is wrong (if pre-commit is available in the wider environment).
Full log:
[1] This is only for demonstration purposes, it could be any CLI tool. A somewhat old version of
pre-commit
is used to make it less likely to already exist in the environment.The text was updated successfully, but these errors were encountered: