fix: declare requests as explicit dependency#5
Merged
Conversation
Authlib's flask_client eagerly imports requests_client at module load, so importing app.extensions fails with ModuleNotFoundError in the hermetic deploy image (pip install --no-index from prebuilt wheels). Authlib does not list requests as a hard install requirement, so it never lands in /wheels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requests>=2.31torequirements.txtso deploys stop failing withModuleNotFoundError: No module named 'requests'on app startup.flask_clientpackage eagerly importsrequests_clientat module load (apps.pydoesfrom ..requests_client import OAuth1Session), so importingapp.extensionstriggers the full requests-based client chain — even though we only use the Flask integration.requestsas a hard install requirement (it's an optional/extra), so the Docker build'spip wheel -r requirements.txtnever produced arequestswheel. The runtime image installs withpip install --no-index --find-links=/wheels, so there's no PyPI fallback at install time — the dep was simply absent.Test plan
docker compose build --no-cache appsucceedsdocker compose run --rm app flask db --helpresolves (no ImportError)/auth/loginround-trips successfully against Keycloak🤖 Generated with Claude Code