Skip to content

feat: add pinned Python CLI delivery - #143

Merged
AlexanderLanin merged 1 commit into
mainfrom
python-tool-catalog
Aug 14, 2026
Merged

feat: add pinned Python CLI delivery#143
AlexanderLanin merged 1 commit into
mainfrom
python-tool-catalog

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add a shared catalog for pinned Python command-line tools
  • expose Python tools through Bazel using the pinned uvx binary and a shell launcher
  • add pinned uv tool install support for DevContainer feature installers
  • document and test the catalog, working-directory, runfiles, and version contracts

Rationale

Python distributions need different delivery mechanics from native release binaries. The shared catalog keeps package versions aligned while Bazel executes tools on demand without requiring host Python.

Scope

This is the foundation layer of stack #145. The existing DevContainer installation remains unchanged here; PR #144 adopts this catalog for pre-commit.

Validation

  • full pre-commit suite through //tools:pre-commit
  • //tools:python_tool_runner_test
  • external-module smoke tests with Bazel 8 and Bazel 9

Introduce a shared Python tool catalog, a shell-based Bazel runner backed by pinned uvx, and container installer support backed by pinned uv. Document and test the delivery contracts without requiring Python on Bazel hosts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AlexanderLanin

Copy link
Copy Markdown
Member Author

AI review completed with no major findings.

Independent full-PR reviews of PRs #143 and #144 were performed by:

  • GPT-5.6 Sol
  • Claude Opus 5
  • GPT-5.5

The reviews focused on correctness, regressions, semantics, architecture, security, compatibility, and other merge-blocking issues. Minor/nit-level findings were intentionally ignored.

@lurtz lurtz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am a bit underwhelmed by the added complexity. That complexity was meant to be avoided by using a devcontainer and now we have both.

Comment thread tools/internal/README.md
before the command can run. Its restricted literal form is also valid Python
syntax. The privileged DevContainer installer parses it with
`ast.literal_eval`, preserving a data-only privilege boundary. This shared
format keeps the package, console entrypoint, version, and description in one

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does privileged mean here?


# The explicit assertion verifies the requested release. Subsequent checks use
# the parsed value to keep every expected uv argument aligned with the catalog.
catalog_version="$(python3 "${installer}" version pre-commit)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a shebang

Suggested change
catalog_version="$(python3 "${installer}" version pre-commit)"
catalog_version="$("${installer}" version pre-commit)"

# whichever home directory uv would otherwise infer during image creation.
environment_output="${TEST_TMPDIR}/uvx.env"
OUTPUT_FILE="${output}" ENV_OUTPUT="${environment_output}" \
python3 "${installer}" install-python pre-commit \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
python3 "${installer}" install-python pre-commit \
"${installer}" install-python pre-commit \

# Validate all names before invoking uv. Including a valid name first proves an
# error cannot leave behind a partially installed tool set.
rm -f "${output}"
if OUTPUT_FILE="${output}" python3 "${installer}" install-python \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if OUTPUT_FILE="${output}" python3 "${installer}" install-python \
if OUTPUT_FILE="${output}" "${installer}" install-python \

@AlexanderLanin
AlexanderLanin added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 5cc4a7d Aug 14, 2026
10 checks passed
@AlexanderLanin
AlexanderLanin deleted the python-tool-catalog branch August 14, 2026 11:24
etas-contrib-automation Bot pushed a commit to etas-contrib/score_devcontainer that referenced this pull request Aug 14, 2026
## Summary
- install `pre-commit` 4.5.1 from the shared Python tool catalog with
pinned `uv`
- remove the separate DevContainer feature and its generated lock
entries
- route REUSE helper commands through the catalogued `uvx` runner
- verify the installed command against the catalogued version

## Rationale
The DevContainer PATH and Bazel target now consume one package pin while
retaining delivery mechanisms suited to their environments. The REUSE
workflow uses uvx directly and no longer relies on environment setup
from another feature.

## Scope
This is the DevContainer integration layer of stack #145 and depends on
PR eclipse-score#143. It contains the container wiring and the directly coupled
migration of existing pipx-based REUSE commands.

## Validation
- full pre-commit suite
- isolated `uv tool install` using the catalogued package
- complete local `scripts/test.sh` DevContainer build and feature test

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

etas-contrib-automation Bot pushed a commit to etas-contrib/score_devcontainer that referenced this pull request Aug 17, 2026
Clarify why the DevContainer installer runs with root privileges and how
literal-only catalog parsing prevents executing catalog code with those
privileges.

Also invoke the executable installer directly in its contract test,
consistently using its Python 3 shebang and matching production callers.

Addresses the unresolved review comments from eclipse-score#143.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants