Skip to content

The dev container's Python tools in their own environment - #101

Merged
theAndreas merged 2 commits into
mainfrom
venv-devcontainer
Nov 16, 2026
Merged

theAndreas merged 2 commits into
mainfrom
venv-devcontainer

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

In the dev container, the Python tools (clang-format, clang-tidy, cpplint, copier and the others) could fail to start with Failed to spawn: clang-tidy. The workspace is the host's folder, and a .venv that uv made on the host names the host's paths in its scripts; uv takes such an environment as current and does not repair it. AtmegaTimer ran into this: its .venv came from the host, and make check stopped at make tidy.

The dev container now keeps its own environment, .venv-devcontainer, next to the host's .venv, which it leaves alone. It is relative to the project, so each worktree still has its own. Git ignores it. CI and the host are unchanged.

For a project: after copier update, rebuild the dev container. A .venv the container made before can be deleted.

How it was checked: a project generated from this branch, with a .venv whose scripts point at a host path beside it. Without the new setting, uv run clang-tidy fails as in AtmegaTimer; with it, uv makes .venv-devcontainer, and make lint and make tidy pass. The feature's JSON parses, and git status shows both environments as ignored.

The workspace is the host's folder, and a .venv that uv made on the host
names the host's paths in its scripts. uv takes it as current, and in the
container the tools failed to start: "Failed to spawn: clang-tidy", as
in AtmegaTimer, whose .venv came from the host. UV_PROJECT_ENVIRONMENT
gives the container an environment of its own, relative, so that each
worktree keeps its own too.
@theAndreas
theAndreas merged commit abe8d52 into main Nov 16, 2026
1 check passed
@theAndreas
theAndreas deleted the venv-devcontainer branch November 16, 2026 08:54
@theAndreas theAndreas mentioned this pull request Nov 16, 2026
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.

2 participants