Skip to content

ci(devcontainer): Debian 13 Trixie + Python 3.14, Ruff settings, drop .vscode (keeper-safe .json-only) - #15162

Merged
cclauss merged 3 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:devcontainer-trixie-v2
Sep 2, 2026
Merged

ci(devcontainer): Debian 13 Trixie + Python 3.14, Ruff settings, drop .vscode (keeper-safe .json-only)#15162
cclauss merged 3 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:devcontainer-trixie-v2

Conversation

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor

Describe your change:

Upgrades .devcontainer to Debian 13 "Trixie" + Python 3.14 and modernizes the VS Code settings. Replaces #15160 / #15161.

algorithms-keeper auto-closed #15160 because it edited the extension-less .devcontainer/Dockerfile (the keeper's ACCEPTED_EXTENSIONS allow-list has no entry for Dockerfile, so reopening re-triggers the close). This version touches .json files only, and this time includes the filled checklist (that's why #15161 was auto-closed).

Same outcome, keeper-safe:

  • Debian 13 "Trixie" + Python 3.14: bump build.args.VARIANT 3.13-bookworm -> 3.14-trixie. The base image is selected entirely from devcontainer.json — the Dockerfile's ARG VARIANT reads it — so the Dockerfile is left untouched and keeps installing requirements.txt + pipx pre-commit/ruff.
  • VS Code settings modernized: the old python.linting.* / python.formatting.blackPath keys were removed by the Python extension long ago. Replaced with Ruff formatOnSave + source.fixAll/source.organizeImports, matching pre-commit and CI. Added the charliermarsh.ruff extension.
  • .vscode/ deleted (per your preference on priya-sundaram-dev as a maintainer? #15081): its sole file only muted a PR-branch notification; pre-commit/Ruff cover the rest.

Open questions from #15081:

  • Latest-and-greatest CPython: there is no floating 3-trixie tag on the mcr.microsoft.com/vscode/devcontainers/python path, so VARIANT must name the minor version; bump it when a new stable ships.
  • Free-threading (3.14t): these images don't publish t variants and build args can't read .python-version, so 3.14t can't be selected via the tag alone — it would need a Dockerfile/uv change (which the keeper blocks from me). Happy to do that as a maintainer-merged follow-up.
  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

… .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.
@algorithms-keeper algorithms-keeper Bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Sep 2, 2026
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 (TheAlgorithms#228).
@priya-sundaram-dev

Copy link
Copy Markdown
Contributor Author

Heads-up: the `Test DevContainer Build` check was red, and it turned out to be a pre-existing breakage on main, not something this PR introduced.

Root cause: `.devcontainer/Dockerfile` does `COPY requirements.txt /tmp/pip-tmp/`, but `requirements.txt` was removed when the repo moved its dependencies to `pyproject.toml`. The image build has been broken since that migration — it just never surfaced because CI only runs on `.devcontainer/**` changes and nobody had touched that directory.

Fix (pushed just now, still `.json`-only so it stays keeper-safe): drop the local Dockerfile build and pull the upstream mcr.microsoft.com/devcontainers/python:3.14-trixie image instead, installing pre-commit + ruff + uv in postCreateCommand (which then runs the existing post_install). That removes the requirements.txt dependency entirely and is less to maintain going forward.

The .devcontainer/Dockerfile is now unused. I left it in place because it is an extension-less filename the keeper still auto-closes; it can be deleted in a quick follow-up once #228 (which whitelists the Dockerfile filename) lands. Watching the new CI run.

@algorithms-keeper algorithms-keeper Bot removed tests are failing Do not merge until tests pass labels Sep 2, 2026
Comment thread .devcontainer/devcontainer.json Outdated

@cclauss cclauss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  [2026-09-02T19:48:03.349Z]   installed package pre-commit 4.6.2, installed using Python 3.14.7
    These apps are now available
      - pre-commit
    installed package ruff 0.16.5, installed using Python 3.14.7
    These apps are now available
      - ruff
    installed package uv 0.12.9, installed using Python 3.14.7
    These apps are now available
      - uv
      - uvx

@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Sep 2, 2026
@cclauss
cclauss merged commit 5503767 into TheAlgorithms:master Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants