Skip to content

ci: build devcontainer from Dockerfile and verify setup in CI - #1

Open
NicoleNageli wants to merge 1 commit into
masterfrom
devcontainer-ci
Open

NicoleNageli wants to merge 1 commit into
masterfrom
devcontainer-ci

Conversation

@NicoleNageli

Copy link
Copy Markdown
Owner

Description

Makes the devcontainer CI build .devcontainer/Dockerfile and check that the
container setup scripts actually ran.

  • Dockerfile: based on mcr.microsoft.com/devcontainers/python, copies in
    uv, and installs dependencies from pyproject.toml/uv.lock (replaces the
    removed requirements.txt).
  • devcontainer.json: builds from the Dockerfile with the repo root as the
    context. post_install now runs with bash to match its shebang.
  • post_install: marks the workspace as a git safe.directory so
    pre-commit install works on Docker Desktop hosts.
  • Workflow: devcontainers/ci now checks python3/uv/ruff/pre-commit versions,
    the pre-commit git hook, and the Oh My Zsh plugins, not just uv --version.

Checklist

  • ruff check passes
  • pre-commit run --all-files passes, except validate-filenames, which
    can't start on the Windows host (no python3). The script itself passes
    when run with python.
  • Devcontainer image builds locally. The dependencies install into
    /opt/venv with free-threaded 3.15.
  • Full setup verified on Linux. This PR's CI run is the check (the local
    Docker Desktop run hit the safe.directory issue this PR fixes).

Fixes TheAlgorithms#15695

🤖 Generated with Claude Code

- Rebuild .devcontainer/Dockerfile on mcr.microsoft.com/devcontainers/python,
  copy in uv, and install deps from pyproject.toml/uv.lock (replaces the
  removed requirements.txt).
- Point devcontainer.json at the Dockerfile with the repo root as context.
- Run post_install with bash to match its shebang, and mark the workspace as
  a git safe.directory so pre-commit install works on Docker Desktop hosts.
- Extend the devcontainer CI runCmd to check that the setup ran: tool
  versions, the pre-commit hook, and the Oh My Zsh plugins.

Fixes TheAlgorithms#15695

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

Add a workflow CI to validate the Devcontainer environment

1 participant