Visitar URL original
Do not run pip to install Python plugin packages under uv or Poetry by iwahbe · Pull Request #24951 · pulumi/pulumi · GitHub
Skip to content

Do not run pip to install Python plugin packages under uv or Poetry - #24951

Merged
iwahbe merged 1 commit into
masterfrom
iwahbe/fix-policy-pack-uv-install
Sep 30, 2026
Merged

iwahbe merged 1 commit into
masterfrom
iwahbe/fix-policy-pack-uv-install

Conversation

@iwahbe

@iwahbe iwahbe commented Sep 30, 2026

Copy link
Copy Markdown
Member

pulumi install ran python -m pip install <dir> for each Python plugin that is a buildable package (a pyproject.toml with a [build-system] table), for every toolchain. A virtual environment that uv creates does not contain pip, so a policy pack or a component provider with toolchain: uv failed with No module named pip.

Add InstallPackage to the Toolchain interface and call it before InstallDependencies. The pip toolchain runs pip install <dir>, because its InstallDependencies installs only requirements.txt. The uv and Poetry toolchains do nothing, because uv sync and poetry install install the project itself.

Fixes #24949

`pulumi install` ran `python -m pip install <dir>` for each Python
plugin that is a buildable package, for every toolchain. A virtual
environment that uv creates does not contain pip, so a policy pack or a
component provider with `toolchain: uv` and a `[build-system]` table
failed with `No module named pip`.

Add `InstallPackage` to the `Toolchain` interface and call it before
`InstallDependencies`. The pip toolchain runs `pip install <dir>`,
because its `InstallDependencies` installs only `requirements.txt`. The
uv and Poetry toolchains do nothing, because `uv sync` and
`poetry install` install the project itself.

Fixes #24949
@iwahbe
iwahbe requested a review from a team as a code owner September 30, 2026 15:11
@iwahbe
iwahbe enabled auto-merge September 30, 2026 15:27
@iwahbe
iwahbe added this pull request to the merge queue Sep 30, 2026
Merged via the queue into master with commit 2803d47 Sep 30, 2026
242 of 247 checks passed
@iwahbe
iwahbe deleted the iwahbe/fix-policy-pack-uv-install branch September 30, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python policy pack with toolchain: uv and a [build-system] table fails to install: No module named pip

2 participants