Skip to content

Commit bb3de54

Browse files
authored
fix import async client error (#143)
* fix import async client error * fix ut * fix ut
1 parent a09ba2b commit bb3de54

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

example/example_aiohttp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"""
44
import asyncio
55
from pydantic import BaseModel
6-
from pydantic_client import AiohttpWebClient, get, post
6+
from pydantic_client import get, post
7+
from pydantic_client.async_client import AiohttpWebClient
78

89
class Order(BaseModel):
910
id: int

example/example_httpx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"""
44
import asyncio
55
from pydantic import BaseModel
6-
from pydantic_client import HttpxWebClient, get, post
6+
from pydantic_client import get, post
7+
from pydantic_client.async_client import HttpxWebClient
78

89
class Product(BaseModel):
910
id: int

pydantic_client/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
from .decorators import delete, get, patch, post, put
22
from .sync_client import RequestsWebClient
3-
from .async_client import AiohttpWebClient, HttpxWebClient
43
from .base import BaseWebClient
54

65
__all__ = [
76
"BaseWebClient",
87
"RequestsWebClient",
9-
"AiohttpWebClient",
10-
"HttpxWebClient",
118
"get",
129
"post",
1310
"put",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pydantic-client"
3-
version = "2.0.3"
3+
version = "2.0.4"
44
description = "Http client base pydantic, with requests or aiohttp"
55
authors = [
66
{name = "ponytailer", email = "huangxiaohen2738@gmail.com"}

tests/test_async_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
from pydantic import BaseModel
3-
from pydantic_client import AiohttpWebClient, HttpxWebClient, get, post
3+
from pydantic_client.async_client import AiohttpWebClient, HttpxWebClient
4+
from pydantic_client import get, post
45

56

67
class User(BaseModel):

tests/test_async_new_features.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import pytest
22
from typing import Optional
33
from pydantic import BaseModel
4-
from pydantic_client import post, AiohttpWebClient
4+
from pydantic_client import post
5+
from pydantic_client.async_client import AiohttpWebClient
56

67

78
class User(BaseModel):

tests/test_decorators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import requests_mock
33
from typing import Optional
44
from pydantic import BaseModel
5-
from pydantic_client import get, post, RequestsWebClient, AiohttpWebClient
5+
from pydantic_client import get, post, RequestsWebClient
6+
from pydantic_client.async_client import AiohttpWebClient
67

78

89
class User(BaseModel):

0 commit comments

Comments
 (0)