Skip to content

refactor(build_environment): _createenv() should use self.run() like other BuildEnvironment methods #1276

Description

@smoparth

BuildEnvironment._createenv() calls external_commands.run() directly, while every other method (install, get_sysconfig_path, get_distributions) uses self.run(). This forces _createenv() to manually pass self._ctx.network_isolation and self._ctx.settings.external_commands, duplicating logic that self.run() already centralizes.

self.run() calls get_venv_environ(), which sets PATH, VIRTUAL_ENV, and UV_* env vars pointing to the venv. Since _createenv() runs before the venv exists, those env vars reference a directory that doesn't exist yet but uv venv creates the venv and it doesn't need to run inside one. The extra env vars pointing to the not-yet-created directory are ignored by uv venv and have no effect.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions