Skip to content

Commit

Permalink
update: bump httpx/respx dependencies
Browse files Browse the repository at this point in the history
- Pins `httpx`/respx to current major versions (<1.0.0)
- Will allow users to update their dependencies without us having to keep up
- Fixes broken tests due to latest `httpx` changes
- Removes `respx` dependency from `fastapi` install
  - `fastapi` has no dependency on `respx`
  - We only use `respx` in tests
- Bump version to `0.28.1`
  • Loading branch information
namsnath committed Feb 26, 2025
1 parent 68b9356 commit 0bef696
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.28.1] - 2025-02-26
- Pins `httpx` and `respx` to current major versions (<1.0.0)
- Removes `respx` dependency from `fastapi` install

## [0.28.0]
- **[Breaking] Updates pre-commit hooks to use `pre-commit`**
- Migration:
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ pytest-mock==3.14.0
pytest-rerunfailures==14.0
pyyaml==6.0.2
requests-mock==1.12.1
respx==0.21.1
respx>=0.13.0, <1.0.0
uvicorn==0.32.0
-e .
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# on changes in these frameworks
"fastapi": (
[
"respx==0.21.1",
"fastapi",
"uvicorn",
"python-dotenv==1.0.1",
Expand Down Expand Up @@ -83,7 +82,7 @@

setup(
name="supertokens_python",
version="0.28.0",
version="0.28.1",
author="SuperTokens",
license="Apache 2.0",
author_email="[email protected]",
Expand Down Expand Up @@ -116,7 +115,7 @@
# [crypto] ensures that it installs the `cryptography` library as well
# based on constraints specified in https://github.com/jpadilla/pyjwt/blob/master/setup.cfg#L50
"PyJWT[crypto]>=2.5.0,<3.0.0",
"httpx>=0.15.0,<=0.27.2",
"httpx>=0.15.0,<1.0.0",
"pycryptodome<3.21.0",
"tldextract<5.1.3",
"asgiref>=3.4.1,<4",
Expand Down
2 changes: 1 addition & 1 deletion supertokens_python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

SUPPORTED_CDI_VERSIONS = ["5.2"]
VERSION = "0.28.0"
VERSION = "0.28.1"
TELEMETRY = "/telemetry"
USER_COUNT = "/users/count"
USER_DELETE = "/user/remove"
Expand Down
9 changes: 6 additions & 3 deletions tests/test_querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import asyncio
import json
from typing import Any, Dict, Optional

import httpx
Expand Down Expand Up @@ -86,7 +85,7 @@ def api2_side_effect(_: httpx.Request):
except Exception as e:
if "with status code: 429" in str(
e
) and 'message: {"status": "RATE_ERROR"}' in str(e):
) and 'message: {"status":"RATE_ERROR"}' in str(e):
pass
else:
raise e
Expand Down Expand Up @@ -186,12 +185,16 @@ async def test_querier_text_and_headers():
)

res = await q.send_get_request(NormalisedURLPath("/json-api"), None, None)
assert "content-length" in res["_headers"]
# httpx 0.28.0 seems to have changed their `json.dumps` signature in https://github.com/encode/httpx/issues/3363
# Does not make sense to keep up to date with minor changes like this
# Dropping content-length checks to avoid flake here
res["_headers"].pop("content-length")
assert res == {
"bar": "baz",
"_headers": {
"greet": "hi",
"content-type": "application/json",
"content-length": str(len(json.dumps(body))),
},
}

Expand Down

0 comments on commit 0bef696

Please sign in to comment.