-
Notifications
You must be signed in to change notification settings - Fork 20
Upgrade FastAPI to 0.114.0 and fix dependency compatibility issues #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: pamelafox <[email protected]>
Co-authored-by: pamelafox <[email protected]>
Co-authored-by: pamelafox <[email protected]>
UPGRADE_NOTES.md
Outdated
@@ -0,0 +1,71 @@ | |||
# FastAPI 0.114.0 Upgrade Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Remove this file from the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the UPGRADE_NOTES.md file from the PR in commit f7e8a85.
Co-authored-by: pamelafox <[email protected]>
@copilot You need to update the snapshots from pytest-snapshot now that the openAI client has changed. A few new fields were added. |
Co-authored-by: pamelafox <[email protected]>
Updated the pytest snapshots to accommodate the new fields introduced in OpenAI 1.97.1. The library upgrade added |
This PR upgrades FastAPI from 0.111.0 to 0.114.0 to accomplish the same goal as the failing Dependabot PR #74, but with proper dependency compatibility fixes to ensure CI passes.
Root Cause
The original Dependabot PR #74 was failing because upgrading FastAPI brought in a newer version of the
httpx
library that had breaking changes with the olderopenai
library (version 1.33.0). The specific error was:This happened because the older
openai
library was passing aproxies
parameter tohttpx.AsyncClient
, but newer versions ofhttpx
no longer accept this parameter.Solution
Updated both FastAPI and OpenAI libraries plus related dependencies for full compatibility:
Dependency Updates
[all]
extras for full feature support)Configuration Fixes
select
andisort
settings to the new[tool.ruff.lint]
sectionfastapi[all]
entry fromrequirements-dev.txt
Documentation
UPGRADE_NOTES.md
explaining the changes and installation processInstallation
To install the updated dependencies:
python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip pip install -r requirements-dev.txt
Verification
The changes can be verified by running the CI checks:
All APIs remain backward compatible - the OpenAI usage (
AsyncOpenAI
,AsyncAzureOpenAI
) and FastAPI usage remain unchanged.Fixes #79.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Azure-Samples/openai-chat-backend-fastapi/pulls/74
curl -s REDACTED
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.