Skip to content

Upgrade Python from 3.8 to 3.11#3

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1759206546-upgrade-python-3.11
Open

Upgrade Python from 3.8 to 3.11#3
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1759206546-upgrade-python-3.11

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Upgrade Python from 3.8 to 3.11

Summary

This PR upgrades the FastAPI application from Python 3.8 to Python 3.11, updating the Docker base image, dependency versions, and application version. All core functionality has been verified to work with the new Python version through Docker-based testing.

Key Changes:

  • Docker: Updated base image to tiangolo/uvicorn-gunicorn-fastapi:python3.11 and modernized Poetry installer
  • Version: Bumped application version from 0.1.0 to 0.2.0
  • Dependencies: Updated several packages for Python 3.11 compatibility:
    • FastAPI: 0.54.1 → 0.68.0
    • Uvicorn: 0.11.5 → 0.15.0
    • Pytest: 5.2 → 7.0
    • MyPy: 0.770 → 0.910
    • Black: 19.10b0 → 22.0
  • Lock file: Removed poetry.lock (will regenerate with new constraints)

Review & Testing Checklist for Human

⚠️ 4 critical items to verify before merging:

  • End-to-end testing: Run full application workflow with real data/API calls to verify FastAPI 0.54→0.68 upgrade didn't break endpoints
  • Database operations: Verify all CRUD operations and migrations work correctly with the new Python/dependency versions
  • Production deployment: Test actual deployment process to ensure Docker image builds and runs properly in production environment
  • Performance baseline: Compare response times/resource usage vs Python 3.8 version to check for performance regressions

Notes

  • Basic tests (pytest, flake8, black) all pass with Python 3.11.13
  • MyPy shows false positive errors in third-party ZMQ type stubs (not application code)
  • Application successfully starts and runs in Docker containers
  • Dependency version jumps are significant, especially FastAPI which may have API changes between 0.54 and 0.68

Requested by: Sam Fertig (@samfert-codeium)
Link to Devin run: https://app.devin.ai/sessions/8ee48f73ffe44c2380b969d9c5aa7af1

- Update Dockerfile base image to tiangolo/uvicorn-gunicorn-fastapi:python3.11
- Update Poetry installer to modern official installer
- Bump application version from 0.1.0 to 0.2.0
- Update Python constraint to ^3.11 in pyproject.toml
- Update dependencies for Python 3.11 compatibility:
  - fastapi: ^0.54.1 -> ^0.68.0
  - uvicorn: ^0.11.5 -> ^0.15.0
  - pytest: ^5.2 -> ^7.0
  - mypy: ^0.770 -> ^0.910
  - black: ^19.10b0 -> ^22.0
- Update test assertion for new version
- Apply black formatting to app/main.py
- Remove poetry.lock (will be regenerated)

All tests pass with Python 3.11.13. Application builds and runs successfully.

Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@sonarqubecloud

Copy link
Copy Markdown

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.

0 participants