Upgrade Python from 3.11 to 3.14

Aperta
#1,939 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
fastapi, gcp, numpy, pandas, postgresql, python, sqlalchemy

Direzione di ricerca

Start with the dependency table in the issue and the pinned versions in the project's requirements files, then bump the listed packages on Python 3.11 first, as the issue's first step asks. The generated modules feeds_gen and user_service_gen and the sqlacodegen models will need regenerating and their diffs reviewed. Done means the test suite passes on 3.11 and 3.14 under -W error::DeprecationWarning, and the change is deployed through dev and QA. The issue is a multi-PR plan, so coordinate with maintainers before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

tech debt
Describe the problem

The API, CI and Cloud Functions run on Python 3.11, which is security-only and reaches end of life in October 2027.

Proposed solution

Upgrade to Python 3.14 (supported until October 2030; Cloud Run functions python314 runtime is GA).

Expected improvements: interpreter speedups from 3.12 to 3.14, incremental garbage collection, compression.zstd, asyncio introspection, clearer error messages.

Breaking-change risks:

  • Dependencies below their first 3.14-compatible version:

    Package Current Minimum
    pydantic 2.11.7 2.12.0
    fastapi 0.111.0 0.118.3
    starlette 0.37.2 0.48.0
    SQLAlchemy 2.0.23 2.0.45
    psycopg2-binary 2.9.6 2.9.11
    pandas unpinned / ~=2.2.3 2.3.3
    numpy unpinned 2.3.2
    shapely unpinned 2.1.2

    fastapi-filter, sqlacodegen and geoalchemy2 not yet confirmed.

  • Language changes (3.12 to 3.14): removed modules (distutils, imp, PEP 594), deferred annotations (PEP 649), forkserver as the Linux multiprocessing default, asyncio.get_event_loop() changes.

  • Generated code (feeds_gen, user_service_gen, sqlacodegen models) may change with new dependency versions.

  • Cloud Functions buildpack installs with uv by default for python314.

Validation plan:

  1. Upgrade dependencies to the minimums above on Python 3.11 first, in a separate PR.
  2. Run test suites with -W error::DeprecationWarning and search for removed APIs.
  3. Regenerate generated code and review the diff.
  4. Run CI on 3.11 and 3.14 during the transition.
  5. Deploy to dev, then QA, running integration tests on each before production.
Alternatives you've considered
  • 3.15: Cloud Run functions runtime still in Preview; library wheel coverage incomplete.
  • 3.12 / 3.13: support ends earlier (2028-10 / 2029-10).
Additional context
Lingua principale
Python
Stelle
34
Fork
7
Merge medio
2g 22h
PR unite (30g)
21

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MobilityData/mobility-feed-api

Tutte le issue di MobilityData/mobility-feed-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.