Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

pin python inside devcontainer#776

Merged
mangelajo merged 1 commit intomainfrom
python-fix
Dec 11, 2025
Merged

pin python inside devcontainer#776
mangelajo merged 1 commit intomainfrom
python-fix

Conversation

@mangelajo
Copy link
Copy Markdown
Member

@mangelajo mangelajo commented Dec 9, 2025

When pinned outside via .python-version it will fail as soon as your system python does not match .python-version, which forces you to delete it or to install another python binary which isn't optimal.

This pins python to 3.12 to match the devcontainer installed one.

Summary by CodeRabbit

  • Chores
    • Updated Python environment configuration across development container and CI/CD workflows.
    • Removed standalone Python version specifier file and consolidated version pinning logic.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 9, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit e24b32d
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/693933095a809b0008a934a7
😎 Deploy Preview https://deploy-preview-776--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 9, 2025

Walkthrough

Removed the .python-version file and refactored Python version pinning across the project. Python 3.12 specification is now embedded directly in CI/CD workflows and dev container configurations instead of relying on a centralized pyenv file.

Changes

Cohort / File(s) Summary
Python version management
.python-version, .github/workflows/documentation.yaml, .devcontainer/Dockerfile, .devcontainer/devcontainer.json
Deleted .python-version file containing 3.12 specifier. Updated GitHub Actions workflows to explicitly pin Python 3.12 in Build and Check-warnings jobs. Removed uv-based Python pinning instruction from Dockerfile. Modified devcontainer post-start hook to pin Python 3.12 before running pre-commit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Attention areas:
    • Verify that the removal of .python-version does not break any tooling that depends on it (e.g., pyenv, local development setups)
    • Ensure GitHub Actions workflows correctly pin Python 3.12 across both Build and Check-warnings jobs
    • Confirm the devcontainer post-start sequence (Python pinning before pre-commit) is correctly implemented
    • Check for any other configuration files or documentation that may reference the deleted .python-version file

Suggested reviewers

  • kirkbrauer
  • NickCao
  • bennyz

Poem

🐰 The version file bids its farewell,
No more .python-version to dwell,
3.12 now lives in workflows bright,
In Dockerfiles and containers light,
Configuration dance—all locked in tight!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'pin python inside devcontainer' clearly and accurately summarizes the main objective of the changeset, which involves moving Python version pinning from external configuration files into the devcontainer setup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch python-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 502fa1e and e24b32d.

📒 Files selected for processing (4)
  • .devcontainer/Dockerfile (0 hunks)
  • .devcontainer/devcontainer.json (1 hunks)
  • .github/workflows/documentation.yaml (2 hunks)
  • .python-version (0 hunks)
💤 Files with no reviewable changes (2)
  • .devcontainer/Dockerfile
  • .python-version
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Use `uv run python3` command to run Python code manually, after running `make sync` to ensure dependencies are installed

Applied to files:

  • .github/workflows/documentation.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: build
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: e2e
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
🔇 Additional comments (3)
.github/workflows/documentation.yaml (2)

84-87: Consistent pattern applied to both jobs.

The same pinning pattern from the "build" job is applied here to "check-warnings" job. Once the syntax is verified, this ensures consistent Python version management across both CI workflows.


45-47: No issues found. The command uv python pin 3.12 is correct syntax according to official uv documentation and will properly pin the project to Python 3.12 by writing to the .python-version file.

.devcontainer/devcontainer.json (1)

8-8: Pins Python 3.12 before pre-commit installation.

This is the key change addressing the PR issue. By running uv python pin 3.12 in postStartCommand before pre-commit install, the devcontainer ensures Python 3.12 is selected regardless of the system Python version, which resolves the "uv refused to work" failures mentioned in the PR description.

The sequential execution order (pin → pre-commit install) is correct, as pre-commit setup depends on having the correct Python version available.

Verify that:

  1. The uv python pin 3.12 syntax is correct for the version of uv being used in the project
  2. The uv run pre-commit install invocation is the appropriate way to install pre-commit hooks in this uv-based environment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mangelajo mangelajo requested a review from kirkbrauer December 9, 2025 20:58
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa0a3b5 and ba50ca3.

📒 Files selected for processing (2)
  • .devfile/Containerfile (1 hunks)
  • .python-version (0 hunks)
💤 Files with no reviewable changes (1)
  • .python-version
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
Learning: Use `uv run python3` command to run Python code manually, after running `make sync` to ensure dependencies are installed

Applied to files:

  • .devfile/Containerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: e2e

Comment thread .devfile/Containerfile Outdated
@mangelajo
Copy link
Copy Markdown
Member Author

mangelajo commented Dec 10, 2025

@kirkbrauer this may probably work for all, WDYT?

I was having issues when your system has something different to python 3.12. I had to delete the .python_version, or just tweak it, otherwise uv refused to work and pick the system python.

May be there is a better way?

@mangelajo
Copy link
Copy Markdown
Member Author

@kirkbrauer this may probably work for all, WDYT?

I was having issues when your system has something different to python 3.12. I had to delete the .python_version, or just tweak it, otherwise uv refused to work and pick the system python.

May be there is a better way?

wait, coderabbitai has some hints..

When pinned outside via .python-version it will fail as soon as your
system python does not match .python-version, which forces you to delete
it or to install another python binary which isn't optimal.

This pins python to 3.12 to match the devcontainer installed one.
Copy link
Copy Markdown
Member

@kirkbrauer kirkbrauer left a comment

Choose a reason for hiding this comment

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

I think this is OK, it seems hard to get the Python version right in uv, so if this is the right solution then I think it's good.

@mangelajo
Copy link
Copy Markdown
Member Author

I think this is OK, it seems hard to get the Python version right in uv, so if this is the right solution then I think it's good.

Thanks!, let's see how it works and if you find any issues let's adjust.

@mangelajo mangelajo merged commit 615ddd3 into main Dec 11, 2025
18 checks passed
@mangelajo mangelajo deleted the python-fix branch December 11, 2025 06:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants