Skip to content

devcontainer: shared Ubuntu 26.04 image with pixi; ruff only - #76

Open
blooop wants to merge 8 commits into
mainfrom
fix/devcontainer-shared-base
Open

blooop wants to merge 8 commits into
mainfrom
fix/devcontainer-shared-base

Conversation

@blooop

@blooop blooop commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

This PR moves the devcontainer to the shared python_template image (Ubuntu 26.04). The container then does not trust emSign ECC Root CA - G3, and it starts under dl again. The PR also replaces black and pylint with ruff.

Evidence

  • Before: main does not start under dl. The build stops at RUN apt-get update && apt install git-lfs with exit code 100 after 15 s, because the yarn apt key on the dead python:0-3.10 image is gone. That base (Debian 11, ca-certificates 20210119) holds 1 emSign ECC Root CA - G3 file.
  • After, in the dl workspace of this branch at 27d391a: Ubuntu 26.04.1 LTS, G3 count 0, git-lfs/3.7.1, pixi 0.83.0.
  • After: pixi run test gives 1 passed on Python 3.12. git status is clean after the cold create, so the LFS PDFs do not show as modified.
  • After: the CI ruff job (lint and format --check) passes.

What this changes

  • Deletes .devcontainer/Dockerfile. Its base tag python:0-3.10 is dead.
  • Copies .devcontainer/ from blooop/python_template (without ci/): "image": "ghcr.io/blooop/python_template/devcontainer:latest", post-create.sh (runs pixi install --frozen), and claude-code/. The devcontainer.json comments name only the tasks and files that this repo has.
  • Adds a small [tool.pixi] config to pyproject.toml: Python 3.12 from conda-forge, the package as an editable PyPI dependency, the test extra as the default environment, and a test task. It commits pixi.lock (format v7, written by pixi 0.83.0) and ignores .pixi/.
  • Keeps flit as the build backend. The CI build job and publishing do not change.
  • The repo keeps 8 PDFs in Git LFS. The shared image ships git-lfs 3.7.1 (python_template#177 — pixi 0.83.0 and git-lfs in the shared image), so this repo needs no Dockerfile of its own.
  • Ruff only: CI drops the black job and the pylint step and adds ruff format --check. pyproject.toml drops black, pylint and their config. VS Code formats with ruff. Dependabot no longer groups black and pylint. The Python files get the ruff format and a few ruff fixes (import order, one noqa: DTZ002).

The shared image carries the CA fix, so this repo needs no CA block of its own.

How I checked it

dl blooop/ArjanCodesSoftwareDesignerMindset@fix/devcontainer-shared-base -- bash -lc 'ls /etc/ssl/certs | grep -c emSign_ECC_Root_CA_-_G3; grep PRETTY /etc/os-release; git lfs version; pixi run test; git status --short'
dl blooop/ArjanCodesSoftwareDesignerMindset@main -- bash -lc '...same, with python -m pytest...'
docker run --rm mcr.microsoft.com/devcontainers/python:0-3.10 bash -c 'ls /etc/ssl/certs | grep -c emSign_ECC_Root_CA_-_G3'

I did not wait for the CI build job on the last push.

Merge danger

Door: two-way. A revert brings back the old Dockerfile and the black and pylint checks.
Blast radius: small. Only the devcontainer, the pixi dev setup and the lint tools change. The package, the tests and the CI build do not.

Review notes

  • Ruff versions do not agree. The test extra pins ruff>=0.0.280,<=0.1.3, so pixi installs ruff 0.1.3. CI uses chartboost/ruff-action@v1, which runs the latest ruff (the format here is ruff 0.17.2). pixi run ruff format --check . flags 2 files, so the VS Code "autoformat" task undoes part of the format. A shared fix for all blooop repos comes later. This PR does not pin ruff.
  • The pixi platform list is linux-64 only, the same as python_template. The container does not start on an arm64 host.

🤖 Generated with Claude Code

@sourcery-ai

sourcery-ai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Sorry @blooop, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 1 hour by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Reviewer's Guide

Moves development containers from the dead Python 3.10 Docker base to the shared Ubuntu 26.04 python_template image, using pixi for a locked Python 3.12 test environment while adding a local Claude Code feature and its host-mounted configuration workflow; package code, CI, and publishing remain unchanged.

Sequence diagram for cold devcontainer creation and testing

sequenceDiagram
    actor Developer
    participant DevContainer
    participant SharedImage
    participant Repo
    participant Pixi

    Developer->>DevContainer: Create workspace
    DevContainer->>SharedImage: Pull ghcr.io/blooop/python_template/devcontainer:latest
    SharedImage-->>DevContainer: Ubuntu 26.04, pixi, git-lfs
    DevContainer->>Repo: Run post-create.sh
    Repo->>Pixi: install --frozen
    Pixi-->>Repo: Locked Python 3.12 environment
    Developer->>Pixi: run test
    Pixi-->>Developer: 1 passed
Loading

File-Level Changes

Change Details Files
Replace the repository-specific Docker build with the shared Ubuntu 26.04 devcontainer and template-provided lifecycle configuration.
  • Delete the obsolete Python 3.10-based Dockerfile and use the published shared image.
  • Add template-derived devcontainer configuration and a post-create script that initializes SSH host keys, installs the frozen pixi environment, and runs optional tasks.
  • Retain the existing devcontainer name while adopting the shared image’s tooling, including git-lfs and pixi.
.devcontainer/Dockerfile
.devcontainer/devcontainer.json
.devcontainer/post-create.sh
Add pixi-managed Python 3.12 development dependencies and reproducible locking.
  • Configure conda-forge Python 3.12, editable package installation, the test environment, and a pytest task.
  • Commit the pixi format-v7 lockfile and ignore the local pixi environment directory.
pyproject.toml
pixi.lock
.gitignore
Add a local Claude Code Dev Container Feature with host configuration sharing and operational documentation.
  • Install the Claude shim through pixi, bootstrap pixi when absent, and create the target user’s Claude configuration directories.
  • Initialize the host ~/.claude directory and document the shared read-write mount, authentication flow, troubleshooting, and security tradeoffs.
  • Expose the feature metadata and installation behavior for use by the template image build.
.devcontainer/claude-code/README.md
.devcontainer/claude-code/TROUBLESHOOTING.md
.devcontainer/claude-code/devcontainer-feature.json
.devcontainer/claude-code/init-host.sh
.devcontainer/claude-code/install.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@blooop

blooop commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Added 65ce348 (replaces black and pylint with ruff: CI runs ruff check + ruff format --check; deps, pixi.lock, VS Code updated), 3e2f3e5 (ruff 0.17.2 check --fix + format: imports, List -> list, one-line stub bodies) and 35123bf (# noqa: DTZ002 on one datetime.today() call).

Drop black and pylint from the dependabot dev-dependency group; the
project uses ruff only.
…have

pixi run dev-use-local and dev-use-prebuilt are not tasks here, the
commented-out build block pointed at the deleted Dockerfile, and
.devcontainer/ci/ lives only in python_template.
@blooop blooop changed the title devcontainer: move to the shared Ubuntu 26.04 image with pixi (drops emSign ECC G3) devcontainer: shared Ubuntu 26.04 image with pixi; ruff only Oct 25, 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.

1 participant