Skip to content

fix(setup): pin dev venv to Python 3.12 to not break setup step - #1031

Open
dhananjaypai08 wants to merge 3 commits into
jamiepine:mainfrom
dhananjaypai08:fix/dev-venv-python-312
Open

fix(setup): pin dev venv to Python 3.12 to not break setup step#1031
dhananjaypai08 wants to merge 3 commits into
jamiepine:mainfrom
dhananjaypai08:fix/dev-venv-python-312

Conversation

@dhananjaypai08

@dhananjaypai08 dhananjaypai08 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

just setup built the venv from whatever python3 resolved to, so on a 3.13/3.14
machine the install failed immediately:

ERROR: No matching distribution found for kokoro>=0.9.4
download

The venv is now pinned to 3.12, and one built on the wrong interpreter is recreated
on the next just setup instead of staying broken.

Changes

  • Setup requires 3.12 and picks an interpreter by building the venv with it, falling
    through to the next candidate when that fails — reporting the right version isn't
    enough. Debian packages ensurepip separately, and current Homebrew python@3.12
    bottles carry a pyexpat that won't load on macOS 26. If none work it exits with
    the install command for the platform.
  • An existing venv is recreated when it's on the wrong version or its pip doesn't
    run. A moved venv keeps console scripts whose shebangs point nowhere.
  • Windows resolves 3.12 via the py -3.12 launcher; installers don't create a
    python3.12 command.
  • requires-python = ">=3.12,<3.13" in backend/pyproject.toml, now the single
    place the pin is explained — the justfile and docs point at it.
  • Docs: README, CONTRIBUTING, developer setup, architecture, troubleshooting.

Testing

Exercised on macOS (arm64), where python3 is 3.14 and Homebrew's python@3.12
can't build a venv — just setup still completes end to end, and ruff, uvicorn,
numpy, numba, kokoro and misaki all load afterward. Venv handling covered for fresh,
reuse, wrong version, dead pip (a moved venv), and no 3.12 available at all, which
exits 1 with install instructions rather than leaving a half-built venv behind.

Linux shares the same bash recipe but wasn't run, and the Windows PowerShell path is
unexercised.

Summary by CodeRabbit

  • New Features

    • Setup now requires Python 3.12 and automatically validates or recreates incompatible virtual environments.
    • Improved setup support across Unix and Windows, including interpreter discovery and clearer installation guidance.
    • Setup troubleshooting now provides more actionable instructions when Python 3.12 is unavailable.
    • Dependency installation now consistently uses the configured Python 3.12 environment.
  • Documentation

    • Updated prerequisites, architecture, setup, troubleshooting, and contribution guidance to reflect Python 3.12.
    • Clarified supported Python versions and virtual-environment behavior.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bb8a7664-77a3-4fc0-aa05-7643fc6e2a1e

📥 Commits

Reviewing files that changed from the base of the PR and between 8c86d90 and b7380e4.

📒 Files selected for processing (1)
  • justfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • justfile

📝 Walkthrough

Walkthrough

The project now requires Python 3.12. just setup validates and repairs virtual environments on Unix and Windows. Dependency installation uses the virtual environment’s Python interpreter. Project metadata and documentation reflect the new constraint.

Changes

Python 3.12 setup enforcement

Layer / File(s) Summary
Python 3.12 contract
backend/pyproject.toml, justfile, CHANGELOG.md
Project metadata requires >=3.12,<3.13. Setup pins the virtual environment to Python 3.12.
Environment validation and dependency installation
justfile
Unix and Windows setup discover Python 3.12, validate interpreter and pip health, recreate invalid environments, and install dependencies through the virtual environment’s Python interpreter.
Documentation and release notes
CONTRIBUTING.md, README.md, docs/content/docs/developer/*, docs/content/docs/overview/troubleshooting.mdx, CHANGELOG.md
Documentation describes the Python 3.12 requirement, platform-specific installation guidance, virtual-environment behavior, and troubleshooting steps.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant JustSetup as just setup
  participant Python312 as Python 3.12 candidates
  participant Venv as virtual environment
  participant Pip as venv Python pip
  Developer->>JustSetup: run setup
  JustSetup->>Python312: discover and validate interpreter
  Python312->>Venv: create or recreate environment
  Venv->>Pip: validate and install dependencies
  Pip-->>JustSetup: return setup status
  JustSetup-->>Developer: complete setup or show installation guidance
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: pinning the development virtual environment to Python 3.12 to improve setup reliability.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/docs/developer/setup.mdx`:
- Around line 35-40: Update the Python setup guidance in
docs/content/docs/developer/setup.mdx lines 35-40 to include the Windows
verification command using py -3.12 --version; add the Windows manual
virtual-environment command using py -3.12 -m venv venv at lines 218-219; and
update docs/content/docs/overview/troubleshooting.mdx lines 295-307 with the
Windows version check and installation guidance.

In `@justfile`:
- Around line 47-49: Update the pip validation and dependency-installation flows
in justfile at lines 47-49 and 149-153 to invoke pip through the selected {{
python }} interpreter: replace {{ pip }} --version and every subsequent {{ pip
}} installation command with {{ python }} -m pip, ensuring both validation and
installs target the same virtual environment.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f6ecc5be-0a74-43f9-9718-811fb485f6ad

📥 Commits

Reviewing files that changed from the base of the PR and between 51f49de and c202d1b.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • backend/pyproject.toml
  • docs/content/docs/developer/architecture.mdx
  • docs/content/docs/developer/setup.mdx
  • docs/content/docs/overview/troubleshooting.mdx
  • justfile

Comment thread docs/content/docs/developer/setup.mdx
Comment thread justfile

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 185-200: Update the PowerShell pip-install flow in setup-python to
stop immediately when any pip command fails, including the earlier installation
around line 178 and every subsequent command using “& "{{ python }}" -m pip”.
Add or reuse a small Invoke-Pip helper that checks $LASTEXITCODE after each
invocation, exits with the failure code, and prevents the success message from
being printed after an installation failure.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7a5b797-019a-4a0c-b05b-b9f3c51d1a73

📥 Commits

Reviewing files that changed from the base of the PR and between c202d1b and 8c86d90.

📒 Files selected for processing (3)
  • docs/content/docs/developer/setup.mdx
  • docs/content/docs/overview/troubleshooting.mdx
  • justfile
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/content/docs/overview/troubleshooting.mdx
  • docs/content/docs/developer/setup.mdx

Comment thread justfile Outdated
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