diff --git a/piptools/build.py b/piptools/build.py index 23fc6c1f..93bcc3b4 100644 --- a/piptools/build.py +++ b/piptools/build.py @@ -260,11 +260,10 @@ def _create_project_builder( else _temporary_constraints_file_set_for_pip(upgrade_packages) ) - with build.env.DefaultIsolatedEnv() as env: + with maybe_pip_constrained_context, build.env.DefaultIsolatedEnv() as env: builder = build.ProjectBuilder.from_isolated_env(env, src_dir, runner) - with maybe_pip_constrained_context: - env.install(builder.build_system_requires) - env.install(builder.get_requires_for_build("wheel")) + env.install(builder.build_system_requires) + env.install(builder.get_requires_for_build("wheel")) yield builder