Files
Python/.devcontainer/devcontainer.json
priya-sundaram-devandChristian Clauss 5503767383 ci(devcontainer): Debian 13 Trixie + Python 3.14, Ruff settings, drop .vscode (keeper-safe .json-only) (#15162)
* ci(devcontainer): Debian 13 Trixie + Python 3.14, Ruff settings, drop .vscode

Bumps the base image to 3.14-trixie purely via devcontainer.json's
build.args.VARIANT (the Dockerfile's ARG reads it), so the Dockerfile
itself is untouched and keeps installing requirements + pipx pre-commit/ruff.

- VARIANT 3.13-bookworm -> 3.14-trixie (Debian 13, latest stable CPython).
- Replace removed python.linting.*/blackPath settings with Ruff format-on-save
  + fixAll/organizeImports (matches pre-commit and CI); add the Ruff extension.
- Delete .vscode/settings.json: pre-commit/Ruff cover this now.

Keeps the change to .json files only.

* ci(devcontainer): use prebuilt image instead of broken Dockerfile build

The devcontainer image build fails on main: the Dockerfile does
`COPY requirements.txt`, but that file was removed when the repo moved
its dependencies to pyproject.toml, so there is nothing to copy. Switch
devcontainer.json to pull the upstream mcr.microsoft.com/devcontainers/python
image and install pre-commit/ruff/uv in postCreateCommand. Fully within
.json so it stays keeper-safe; the now-unused Dockerfile can be dropped in
a follow-up once the keeper accepts the Dockerfile filename (#228).

* Update .devcontainer/devcontainer.json

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-02 21:50:40 +02:00

58 lines
2.3 KiB
JSON

{
"name": "Python 3",
// Use a prebuilt dev container image instead of building from a local
// Dockerfile. The repo migrated its dependencies to pyproject.toml, so the
// old Dockerfile's `COPY requirements.txt` step no longer had a file to copy
// and the image build failed. The upstream images already ship Python + a
// full toolchain, so pulling one is both faster and less to maintain.
//
// This repo tracks the latest-and-greatest CPython on the newest stable
// Debian. Images are published per CPython minor version on Debian 13
// "Trixie" (3.11-trixie ... 3.14-trixie); bump this to the newest available
// when a new stable CPython ships.
// NOTE: these images do not publish free-threaded (`t`) variants, so 3.14t
// cannot be selected via the tag alone -- but the repo's `.python-version`
// pins 3.14t, and `uv run`/`uv sync` in the container honor it, so uv gives
// contributors free-threaded 3.14t regardless of the base tag.
"image": "mcr.microsoft.com/devcontainers/python:latest",
// Install the tools post_install and CI expect (pre-commit + ruff), plus uv
// for the free-threaded workflow above, then run the existing setup script.
"postCreateCommand": "pipx install pre-commit ruff uv && zsh .devcontainer/post_install",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
// Formatting/linting is handled by Ruff (matches pre-commit and CI).
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"terminal.integrated.defaultProfile.linux": "zsh"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}