Skip to content

Commit 1200265

Browse files
committed
Rename Client to PostgrestClient and deprecate the old name
1 parent 040ad6c commit 1200265

File tree

6 files changed

+205
-9
lines changed

6 files changed

+205
-9
lines changed

CHANGELOG.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22

33
### Unreleased
44

5-
#### Features
5+
#### Added
66

77
- Support basic authentication
88
- Support stored procedures (RPC)
99

10+
#### Changed
11+
12+
- Rename `Client` to `PostgrestClient` and deprecate the old name
13+
1014
### v0.1.1
1115

12-
#### Bugfixes
16+
#### Fixed
1317

1418
- Fix a typo in `Client.from_()`
1519

1620
### v0.1.0
1721

18-
#### Features
22+
#### Added
1923

2024
- Add basic features

poetry.lock

+184-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postgrest_py/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
from postgrest_py.client import Client
1+
from postgrest_py.__version__ import __version__
2+
from postgrest_py.client import Client, PostgrestClient

postgrest_py/__version__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.1"

postgrest_py/client.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
from deprecation import deprecated
12
from httpx import AsyncClient, Response
23

4+
from postgrest_py.__version__ import __version__
35
from postgrest_py.request_builder import RequestBuilder
46

57

6-
class Client:
8+
class PostgrestClient:
79
def __init__(self, base_url: str, *, schema="public") -> None:
810
headers = {
911
"Accept": "application/json",
@@ -51,3 +53,9 @@ async def rpc(self, func: str, params: dict) -> Response:
5153
path = f"/rpc/{func}"
5254
r = await self.session.post(path, json=params)
5355
return r
56+
57+
58+
class Client(PostgrestClient):
59+
@deprecated("0.2.0", "1.0.0", __version__, "Use PostgrestClient instead")
60+
def __init__(self, *args, **kwargs):
61+
super().__init__(*args, **kwargs)

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ license = "MIT"
88
[tool.poetry.dependencies]
99
python = "^3.7"
1010
httpx = "^0.13.3"
11+
deprecation = "^2.1.0"
1112

1213
[tool.poetry.dev-dependencies]
1314
black = {version = "^19.10b0", allow-prereleases = true}
15+
pylint = "^2.5.3"
1416

1517
[build-system]
1618
requires = ["poetry>=0.12"]

0 commit comments

Comments
 (0)