Skip to content

FIX: Move .python-version to backend directory#60

Merged
wicky-zipstack merged 1 commit into
mainfrom
fix/move-python-version-to-backend
Apr 15, 2026
Merged

FIX: Move .python-version to backend directory#60
wicky-zipstack merged 1 commit into
mainfrom
fix/move-python-version-to-backend

Conversation

@tahierhussain

Copy link
Copy Markdown
Contributor

What

  • Moved the .python-version file from the root directory to the backend/ directory

Why

  • When running uv sync from the backend/ directory, uv was not detecting the correct Python version (3.11)
  • uv looks for .python-version relative to the project root (where pyproject.toml is located)
  • Since pyproject.toml is in backend/, the .python-version file in the root was not being used
  • This caused uv to potentially use a different Python version than intended

How

  • Moved .python-version from visitran/ (root) to visitran/backend/
  • Now the file is in the same directory as pyproject.toml, ensuring uv correctly detects Python 3.11

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No, this PR will not break existing features
  • This is a configuration file move that only affects the development environment
  • The Python version specified (3.11) remains the same
  • uv sync will now correctly use Python 3.11 when run from the backend/ directory

Database Migrations

  • None required

Env Config

  • None required

Relevant Docs

Related Issues or PRs

  • Fixes Python version detection when running uv sync from backend/

Dependencies Versions

  • No dependency changes

Notes on Testing

Testing Checklist:

  • Run uv sync from backend/ directory and verify Python 3.11 is used
  • Verify virtual environment is created with correct Python version

How to Test:

  1. Navigate to backend/ directory
  2. Run uv sync
  3. Verify the output shows Python 3.11 being used
  4. Check .venv/bin/python --version shows 3.11.x

Screenshots

NA

Checklist

I have read and understood the Contribution Guidelines.

Move the .python-version file from root to backend/ so that uv
correctly detects Python 3.11 when running uv sync from backend/.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tahierhussain tahierhussain self-assigned this Apr 15, 2026
@tahierhussain tahierhussain requested review from a team as code owners April 15, 2026 10:34
@tahierhussain tahierhussain added the bug Something isn't working label Apr 15, 2026
@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown

Greptile Summary

Moves .python-version from the repo root to backend/, co-locating it with backend/pyproject.toml so uv correctly pins Python 3.11 when uv sync is run from the backend/ directory. CI workflows are unaffected since they pass python-version explicitly to astral-sh/setup-uv, and Docker is unaffected since the Dockerfile never copies .python-version (and scrubs .python* files at build time anyway).

Confidence Score: 5/5

Safe to merge — single-file config move with no runtime impact.

The change is a one-line file relocation that fixes a developer-environment issue. CI explicitly pins Python 3.11 via matrix parameters, Docker doesn't copy this file, and the backend/pyproject.toml already requires >=3.10,<3.13. No logic, migrations, or API surface is touched.

No files require special attention.

Important Files Changed

Filename Overview
backend/.python-version .python-version file (content: 3.11) moved from repo root to backend/ — correct fix so uv detects Python 3.11 when running uv sync from the backend/ directory where pyproject.toml lives.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer runs: uv sync] --> B{Working directory?}
    B -- "backend/" --> C[uv searches for .python-version\nrelative to pyproject.toml]
    C -- "Before PR\n(.python-version at repo root)" --> D["uv cannot find .python-version\n→ uses default Python"]
    C -- "After PR\n(.python-version at backend/)" --> E["uv finds backend/.python-version\n→ uses Python 3.11 ✓"]
    D --> F["Wrong Python version used\n(potential env mismatch)"]
    E --> G["Correct Python 3.11 venv created"]
Loading

Reviews (1): Last reviewed commit: "FIX: Move .python-version to backend dir..." | Re-trigger Greptile

@wicky-zipstack wicky-zipstack merged commit 48e42e4 into main Apr 15, 2026
6 checks passed
@wicky-zipstack wicky-zipstack deleted the fix/move-python-version-to-backend branch April 15, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants