Skip to content

Feat: Add Python 3.13 support alongside Python 3.12 compatibility #945

@prashikGavali

Description

@prashikGavali

Describe the feature

Issue Overview

PictoPy currently doesn't officially support Python 3.13. As Python 3.13 becomes more widely adopted and new team members may use it, we need to ensure full compatibility while maintaining support for Python 3.12.

Problem

  • Some users may attempt to use Python 3.13 but encounter compatibility issues
  • Current dependencies may not work with Python 3.13
  • Logging module has recursion issues in Python 3.13

Solution

  • Use flexible version ranges in requirements.txt to allow pip to select compatible versions for both Python 3.12 and 3.13
  • Fix logging recursion bug in InterceptHandler
  • Update setup scripts to accept both Python versions

Additional Problem: Fragmented Development Workflow

Current development setup requires developers to:

  1. Open Terminal 1 for backend setup and running
  2. Open Terminal 2 for frontend setup and running
  3. Manually run multiple commands in correct order
  4. Remember which ports each server uses
  5. Handle dependency installation separately for each component

This creates friction for new contributors:

  • ❌ Confusing onboarding experience
  • ❌ Easy to make mistakes (wrong order, missing steps)
  • ❌ Takes ~15 minutes to get servers running
  • ❌ Inconsistent setup across team members
  • ❌ Difficult to document ("follow these 10 steps...")

Example of Current Workflow:

# Terminal 1 - Manual backend setup
cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python main.py

# Terminal 2 - Manual frontend setup
cd frontend
npm install
npm run dev

# Result: 2 terminals, 7+ commands, 15+ minutes ⏱️

## Changes Needed
1. **backend/requirements.txt** - Convert exact versions to ranges (e.g., `onnxruntime>=1.17.1,<2.0`)
2. **scripts/setup.ps1** - Update Python version regex to accept 3.12 AND 3.13
3. **backend/app/logging/setup_logging.py** - Fix recursion in InterceptHandler.emit()
4. **frontend/package.json** - Add baseline-browser-mapping dependency

## Testing
- [x] All tests pass with Python 3.13
- [x] All tests pass with Python 3.12
- [x] Version ranges work: both Python versions install identical compatible package versions
- [x] Backend server starts without recursion errors

## Benefits
✅ New team members using Python 3.13 won't face setup issues
✅ Python 3.12 users continue to work without changes
✅ Future Python 3.14+ compatibility easier to add
✅ Reduces support burden for mentors and maintainers

### Add ScreenShots

## Problem Description

### Current Situation
PictoPy's `requirements.txt` currently uses **exact package versions** that may not have Python 3.13 support:

**Example from main branch:**

<img width="216" height="175" alt="Image" src="https://github.com/user-attachments/assets/2eb6e3fb-9ad8-4b4e-a90b-13c08b355f4d" />


### Issues This Causes

#### Issue 1: Installation Failures on Python 3.13
When users with Python 3.13 try to install:

```bash
$ python --version
Python 3.13.3

$ pip install -r 
ERROR: Could not find a version that satisfies the requirement onnxruntime==1.17.1
ERROR: No matching distribution found for onnxruntime==1.17.1

$ scripts\setup.ps1
❌ Python 3.13.3 is not supported. Please install Python 3.12.x

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions