Skip to content

Commit c09209a

Browse files
authored
bump release note and version, update httpx (#1475)
1 parent 2e0c54d commit c09209a

21 files changed

Lines changed: 196 additions & 78 deletions

docs/releases.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Release notes
22

3+
## 0.21.0
4+
5+
### 🐛 Breaking changes
6+
7+
* Drop support for Python 3.8
8+
* Remove the possibility to exclude parents' fields in children models (discouraged as bad practice anyway)
9+
* Add support for Sqlalchemy 2.0 and drop for 1.4
10+
11+
### 💬 Other
12+
* Bump dependencies to newer versions: among others pydantic, databases and fastapi
13+
* Move setuptools to dev dependencies
14+
* Solve vulnerabilities in dependencies
15+
16+
17+
### 🐛 Fixes
18+
19+
* Fix mutable default argument in translate list to dict - thanks @cadlagtrader [#1382](https://github.com/collerek/ormar/pull/1382)
20+
* Fix fastapi docs - thanks @inktrap [#1362](https://github.com/collerek/ormar/pull/1362)
21+
* Fix clashing many to many fields names [#1407](https://github.com/collerek/ormar/pull/1407)
22+
23+
### 💬 Other
24+
* Add official support for python 3.12 - thanks @ChristopherMacGown [#1395](https://github.com/collerek/ormar/pull/1395)
25+
* Unpin pydantic allowing pydantic versions <2.9.0 - thanks @camillol [#1388](https://github.com/collerek/ormar/pull/1388)
26+
27+
328
## 0.20.2
429

530
### 🐛 Fixes

poetry.lock

Lines changed: 104 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "ormar"
33

44
[tool.poetry]
55
name = "ormar"
6-
version = "0.20.2"
6+
version = "0.21.0"
77
description = "An async ORM with fastapi in mind and pydantic validation."
88
authors = ["Radosław Drążkiewicz <collerek@gmail.com>"]
99
license = "MIT"
@@ -125,11 +125,11 @@ pytest-benchmark = "^4.0.0"
125125
nest-asyncio = "^1.6.0"
126126

127127
pre-commit = ">=2.21,<4.0"
128-
httpx = ">=0.24.1,<0.28.0"
128+
httpx = ">=0.28.0"
129129
asgi-lifespan = "^2.1.0"
130130
pydantic-extra-types = "^2.5.0"
131131
watchdog = "<5.0.0"
132-
pytest-codspeed = "^2.2.0"
132+
pytest-codspeed = "^4.2.0"
133133
mike = "^2.0.0"
134134
faker = ">=24.3,<36.0"
135135
email-validator = "^2.1.1"

tests/test_exclude_include_dict/test_excluding_fields_in_fastapi.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sqlalchemy
99
from asgi_lifespan import LifespanManager
1010
from fastapi import FastAPI
11-
from httpx import AsyncClient
11+
from httpx import ASGITransport, AsyncClient
1212
from ormar import post_save
1313
from pydantic import ConfigDict, computed_field
1414

@@ -123,7 +123,8 @@ async def create_user7(user: RandomModel):
123123

124124
@pytest.mark.asyncio
125125
async def test_excluding_fields_in_endpoints():
126-
client = AsyncClient(app=app, base_url="http://testserver")
126+
transport = ASGITransport(app=app)
127+
client = AsyncClient(transport=transport, base_url="http://testserver")
127128
async with client as client, LifespanManager(app):
128129
user = {
129130
"email": "test@domain.com",
@@ -197,7 +198,8 @@ async def test_excluding_fields_in_endpoints():
197198

198199
@pytest.mark.asyncio
199200
async def test_adding_fields_in_endpoints():
200-
client = AsyncClient(app=app, base_url="http://testserver")
201+
transport = ASGITransport(app=app)
202+
client = AsyncClient(transport=transport, base_url="http://testserver")
201203
async with client as client, LifespanManager(app):
202204
user3 = {"last_name": "Test", "full_name": "deleted"}
203205
response = await client.post("/random/", json=user3)
@@ -226,7 +228,8 @@ async def test_adding_fields_in_endpoints():
226228

227229
@pytest.mark.asyncio
228230
async def test_adding_fields_in_endpoints2():
229-
client = AsyncClient(app=app, base_url="http://testserver")
231+
transport = ASGITransport(app=app)
232+
client = AsyncClient(transport=transport, base_url="http://testserver")
230233
async with client as client, LifespanManager(app):
231234
user3 = {"last_name": "Test"}
232235
response = await client.post("/random2/", json=user3)
@@ -249,7 +252,8 @@ async def test_excluding_property_field_in_endpoints2():
249252
async def after_save(sender, instance, **kwargs):
250253
dummy_registry[instance.pk] = instance.model_dump()
251254

252-
client = AsyncClient(app=app, base_url="http://testserver")
255+
transport = ASGITransport(app=app)
256+
client = AsyncClient(transport=transport, base_url="http://testserver")
253257
async with client as client, LifespanManager(app):
254258
user3 = {"last_name": "Test"}
255259
response = await client.post("/random3/", json=user3)

tests/test_fastapi/test_binary_fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from asgi_lifespan import LifespanManager
99
from fastapi import FastAPI
10-
from httpx import AsyncClient
10+
from httpx import ASGITransport, AsyncClient
1111

1212
from tests.lifespan import init_tests, lifespan
1313
from tests.settings import create_config
@@ -54,7 +54,8 @@ async def create_things(thing: BinaryThing):
5454

5555
@pytest.mark.asyncio
5656
async def test_read_main():
57-
client = AsyncClient(app=app, base_url="http://testserver")
57+
transport = ASGITransport(app=app)
58+
client = AsyncClient(transport=transport, base_url="http://testserver")
5859
async with client as client, LifespanManager(app):
5960
response = await client.post(
6061
"/things",

tests/test_fastapi/test_docs_with_multiple_relations_to_one.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66
from asgi_lifespan import LifespanManager
77
from fastapi import FastAPI
8-
from httpx import AsyncClient
8+
from httpx import ASGITransport, AsyncClient
99

1010
from tests.lifespan import init_tests, lifespan
1111
from tests.settings import create_config
@@ -57,7 +57,8 @@ async def get_cb2(): # pragma: no cover
5757

5858
@pytest.mark.asyncio
5959
async def test_all_endpoints():
60-
client = AsyncClient(app=app, base_url="http://testserver")
60+
transport = ASGITransport(app=app)
61+
client = AsyncClient(transport=transport, base_url="http://testserver")
6162
async with client as client, LifespanManager(app):
6263
response = await client.get("/openapi.json")
6364
assert response.status_code == 200, response.text

tests/test_fastapi/test_excludes_with_get_pydantic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55
from asgi_lifespan import LifespanManager
66
from fastapi import FastAPI
7-
from httpx import AsyncClient
7+
from httpx import ASGITransport, AsyncClient
88

99
from tests.lifespan import init_tests, lifespan
1010
from tests.settings import create_config
@@ -75,7 +75,8 @@ async def get_selfref(ref_id: int):
7575

7676
@pytest.mark.asyncio
7777
async def test_read_main():
78-
client = AsyncClient(app=app, base_url="http://testserver")
78+
transport = ASGITransport(app=app)
79+
client = AsyncClient(transport=transport, base_url="http://testserver")
7980
async with client as client, LifespanManager(app):
8081
test_category = dict(name="Foo", id=12)
8182
response = await client.post("/categories/", json=test_category)

tests/test_fastapi/test_excluding_fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55
from asgi_lifespan import LifespanManager
66
from fastapi import FastAPI
7-
from httpx import AsyncClient
7+
from httpx import ASGITransport, AsyncClient
88

99
from tests.lifespan import init_tests, lifespan
1010
from tests.settings import create_config
@@ -64,7 +64,8 @@ async def get_category_no_pk_through(category_id: int):
6464

6565
@pytest.mark.asyncio
6666
async def test_all_endpoints():
67-
client = AsyncClient(app=app, base_url="http://testserver")
67+
transport = ASGITransport(app=app)
68+
client = AsyncClient(transport=transport, base_url="http://testserver")
6869
async with client as client, LifespanManager(app):
6970
item = {
7071
"name": "test",

tests/test_fastapi/test_extra_ignore_parameter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33
from asgi_lifespan import LifespanManager
44
from fastapi import FastAPI
5-
from httpx import AsyncClient
5+
from httpx import ASGITransport, AsyncClient
66
from ormar import Extra
77

88
from tests.lifespan import init_tests, lifespan
@@ -29,7 +29,8 @@ async def create_item(item: Item):
2929

3030
@pytest.mark.asyncio
3131
async def test_extra_parameters_in_request():
32-
client = AsyncClient(app=app, base_url="http://testserver")
32+
transport = ASGITransport(app=app)
33+
client = AsyncClient(transport=transport, base_url="http://testserver")
3334
async with client as client, LifespanManager(app):
3435
data = {"name": "Name", "extraname": "to ignore"}
3536
resp = await client.post("item/", json=data)

tests/test_fastapi/test_fastapi_docs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from asgi_lifespan import LifespanManager
88
from fastapi import FastAPI
9-
from httpx import AsyncClient
9+
from httpx import ASGITransport, AsyncClient
1010
from pydantic import Field
1111

1212
from tests.lifespan import init_tests, lifespan
@@ -76,7 +76,8 @@ async def create_category(category: Category):
7676

7777
@pytest.mark.asyncio
7878
async def test_all_endpoints():
79-
client = AsyncClient(app=app, base_url="http://testserver")
79+
transport = ASGITransport(app=app)
80+
client = AsyncClient(transport=transport, base_url="http://testserver")
8081
async with client as client, LifespanManager(app):
8182
response = await client.post("/categories/", json={"name": "test cat"})
8283
assert response.status_code == 200

0 commit comments

Comments
 (0)