-
Notifications
You must be signed in to change notification settings - Fork 8
[Feat] migrate to httpx #664
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: feat/async-support
Are you sure you want to change the base?
Conversation
Replaced the 'requests' library with 'httpx' for all HTTP operations in the codebase, updated SSL context handling, and adjusted method signatures and usage accordingly. Updated dependencies in pyproject.toml and poetry.lock to include httpx and certifi. Also added missing __all__ to descope/__init__.py and created tests/testutils.py.
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.
Pull Request Overview
This PR migrates the Descope Python SDK from using requests
library to httpx
for making HTTP requests. This migration modernizes the HTTP client while maintaining the same functionality.
- Replaces all
requests.get
,requests.post
,requests.patch
, andrequests.delete
calls with theirhttpx
equivalents - Updates parameter names from
allow_redirects
tofollow_redirects
andok
tois_success
- Introduces
SSLMatcher
utility for SSL context verification in tests
Reviewed Changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/testutils.py | Adds SSLMatcher helper class for SSL context verification in tests |
Multiple test files | Updates HTTP library imports and method calls throughout test suite |
samples/magiclink_web_sample_app.py | Updates Flask imports to use modern patterns |
pyproject.toml | Replaces requests dependency with httpx in project configuration |
descope/descope_client.py | Updates type annotations and parameter names for httpx compatibility |
descope/authmethod/ files | Updates imports and type annotations for httpx compatibility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Coverage reportThe coverage rate went from
Diff Coverage details (click to unfold)descope/authmethod/enchantedlink.py
descope/authmethod/webauthn.py
descope/auth.py
descope/init.py
descope/descope_client.py
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Related Issues
https://github.com/descope/etc/issues/5922
Description
This change is made as preparation for async support in the SDK
Replaced the 'requests' library with 'httpx' for all HTTP operations in the codebase, updated SSL context handling, and adjusted method signatures and usage accordingly.
Updated dependencies in pyproject.toml and poetry.lock to include httpx and certifi. Also added missing all to descope/init.py and created tests/testutils.py.
Must