Skip to content

Commit 2022afc

Browse files
authored
update: bump httpx/respx dependencies (supertokens#567)
- 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`
1 parent 68b9356 commit 2022afc

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [unreleased]
1010

11+
## [0.28.1] - 2025-02-26
12+
- Pins `httpx` and `respx` to current major versions (<1.0.0)
13+
- Removes `respx` dependency from `fastapi` install
14+
1115
## [0.28.0]
1216
- **[Breaking] Updates pre-commit hooks to use `pre-commit`**
1317
- Migration:

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ pytest-mock==3.14.0
1818
pytest-rerunfailures==14.0
1919
pyyaml==6.0.2
2020
requests-mock==1.12.1
21-
respx==0.21.1
21+
respx>=0.13.0, <1.0.0
2222
uvicorn==0.32.0
2323
-e .

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# on changes in these frameworks
1616
"fastapi": (
1717
[
18-
"respx==0.21.1",
1918
"fastapi",
2019
"uvicorn",
2120
"python-dotenv==1.0.1",
@@ -83,7 +82,7 @@
8382

8483
setup(
8584
name="supertokens_python",
86-
version="0.28.0",
85+
version="0.28.1",
8786
author="SuperTokens",
8887
license="Apache 2.0",
8988
author_email="team@supertokens.com",
@@ -116,7 +115,7 @@
116115
# [crypto] ensures that it installs the `cryptography` library as well
117116
# based on constraints specified in https://github.com/jpadilla/pyjwt/blob/master/setup.cfg#L50
118117
"PyJWT[crypto]>=2.5.0,<3.0.0",
119-
"httpx>=0.15.0,<=0.27.2",
118+
"httpx>=0.15.0,<1.0.0",
120119
"pycryptodome<3.21.0",
121120
"tldextract<5.1.3",
122121
"asgiref>=3.4.1,<4",

supertokens_python/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from __future__ import annotations
1616

1717
SUPPORTED_CDI_VERSIONS = ["5.2"]
18-
VERSION = "0.28.0"
18+
VERSION = "0.28.1"
1919
TELEMETRY = "/telemetry"
2020
USER_COUNT = "/users/count"
2121
USER_DELETE = "/user/remove"

tests/test_querier.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
import asyncio
15-
import json
1615
from typing import Any, Dict, Optional
1716

1817
import httpx
@@ -84,9 +83,7 @@ def api2_side_effect(_: httpx.Request):
8483
try:
8584
await q.send_get_request(NormalisedURLPath("/api1"), None, None)
8685
except Exception as e:
87-
if "with status code: 429" in str(
88-
e
89-
) and 'message: {"status": "RATE_ERROR"}' in str(e):
86+
if "with status code: 429" in str(e) and '"RATE_ERROR"' in str(e):
9087
pass
9188
else:
9289
raise e
@@ -186,12 +183,16 @@ async def test_querier_text_and_headers():
186183
)
187184

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy