Skip to content

Add a devcontainer / Codespaces configuration for one-click contributor setup #413

@dgenio

Description

@dgenio

Summary

Add a .devcontainer/ configuration (Python 3.x base image, pip install -e .[dev,docs,test], pre-commit install, recommended VS Code extensions) so contributors and reviewers can open the repo in a ready-to-build environment in GitHub Codespaces or locally without manual setup.

Why this matters

ChainWeaver's contribution flow requires a specific dev environment (editable install with multiple extras, pre-commit with detect-secrets, mypy, the property-test extra). A devcontainer makes that reproducible in one click, reduces "works on my machine" friction, and is especially valuable for a project that explicitly courts AI coding agents and editor-based contributors (the #264-#282 editor-helper line).

Current evidence

  • No .devcontainer/ directory exists (repo root listing).
  • pyproject.toml defines many optional extras (dev, docs, test, integrations) that a newcomer must assemble correctly.
  • .pre-commit-config.yaml and .secrets.baseline exist, so the setup has non-obvious steps worth encoding.

External context

Devcontainers/Codespaces configs are a common contributor-experience asset; actions/setup-python and the devcontainer Python feature are well-supported.

Proposed implementation

  1. Add .devcontainer/devcontainer.json (+ optional Dockerfile) installing the package editable with [dev,docs,test], running pre-commit install, and recommending the Python/Ruff/Mypy extensions.
  2. Pin to a Python version in the supported matrix; keep the image slim.
  3. Document the option in CONTRIBUTING.md alongside the manual path.

AI-agent execution notes

Inspect pyproject.toml extras, .pre-commit-config.yaml, CONTRIBUTING.md, .github/workflows/ci.yml for the Python versions used. Keep manual setup instructions intact (devcontainer is additive). Do not pin to a single Python in a way that hides the multi-version matrix — note it in docs.

Acceptance criteria

  • Opening the repo in a devcontainer yields an environment where python scripts/dev.py ci (or the four commands) runs successfully.
  • pre-commit hooks are installed automatically.
  • CONTRIBUTING.md documents the devcontainer path.

Test plan

Manual: build the devcontainer and run the validation suite. Optional: a CI smoke that builds the image.

Documentation plan

CONTRIBUTING.md, .devcontainer/README note, CHANGELOG (contributor-tooling note).

Migration and compatibility notes

Not expected to require migration.

Risks and tradeoffs

Image maintenance as dependencies/Python versions evolve; keep it minimal and aligned with the CI matrix.

Suggested labels

contributor-experience, developer-experience

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions