Skip to content

Commit 4206fa1

Browse files
committed
release
1 parent 01e1bd0 commit 4206fa1

File tree

8 files changed

+150
-66
lines changed

8 files changed

+150
-66
lines changed

dev/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
isort . $1
33
black . --exclude "venv|build|dev|dist" $1
44
flake8
5-
mypy metablock
5+
mypy metablock tests

metablock/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .spaces import Block, Service, Space, SpaceExtension
66
from .user import User
77

8-
__version__ = "0.5.1"
8+
__version__ = "0.5.2"
99

1010
__all__ = [
1111
"Metablock",

metablock/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ async def execute(
100100
data = await response.json()
101101
return wrap(data) if wrap else data
102102

103-
async def get_user(self, callback: Callback | None = None) -> dict:
103+
async def get_user(self, callback: Callback | None = None) -> User:
104104
return await self.get(f"{self.url}/user", callback=callback, wrap=self._user)
105105

106-
async def get_space(self, callback: Callback | None = None) -> dict:
106+
async def get_space(self, callback: Callback | None = None) -> Space:
107107
return await self.get(f"{self.url}/space", callback=callback, wrap=self._space)
108108

109-
async def update_user(self, callback: Callback | None = None, **data: Any) -> dict:
109+
async def update_user(self, callback: Callback | None = None, **data: Any) -> User:
110110
return await self.patch(
111111
f"{self.url}/user", json=data, callback=callback, wrap=self._user
112112
)

metablock/components.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def __contains__(self, item: str) -> bool:
9191
def __eq__(self, other: Any) -> bool:
9292
return isinstance(other, self.__class__) and self.data == other.data
9393

94+
def _asdict(self) -> dict:
95+
return self.data
96+
9497
@property
9598
def cli(self) -> Metablock:
9699
return self.root.cli
@@ -185,11 +188,11 @@ async def paginate(self, **params: Any) -> AsyncIterator[MetablockEntity]:
185188
for d in data["data"]:
186189
yield self.wrap(d)
187190

188-
def get_list(self, **params: Any) -> list[MetablockEntity]:
191+
async def get_list(self, **params: Any) -> list[MetablockEntity]:
189192
url = self.list_create_url()
190193
return cast(
191194
list[MetablockEntity],
192-
self.execute(url, params=as_params(**params), wrap=self.wrap_list),
195+
await self.execute(url, params=as_params(**params), wrap=self.wrap_list),
193196
)
194197

195198
async def get_full_list(self, **params: Any) -> list[MetablockEntity]:

poetry.lock

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

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "metablock"
3-
version = "0.5.1"
3+
version = "0.5.2"
44
description = "Metablock cloud python client"
55
authors = ["Luca <luca@quantmind.com>"]
66
license = "BSD"
@@ -11,16 +11,16 @@ python = ">=3.10,<3.12"
1111
aiohttp = "^3.8.3"
1212

1313
[tool.poetry.group.dev.dependencies]
14-
pytest-asyncio = "^0.20.3"
14+
pytest-asyncio = "^0.21.0"
1515
pytest = "^7.0.1"
1616
pytest-cov = "^4.0.0"
17-
mypy = "^0.991"
18-
black = "^22.12.0"
17+
mypy = "^1.2.0"
18+
black = "^23.3.0"
1919
isort = "^5.11.3"
2020
flake8 = "^6.0.0"
2121
flake8-builtins = "^2.0.1"
2222
codecov = "^2.1.12"
23-
python-dotenv = "^0.21.0"
23+
python-dotenv = "^1.0.0"
2424

2525
[build-system]
2626
requires = ["poetry-core>=1.0.0"]

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ warn_no_return=True
2020
[tool:pytest]
2121
asyncio_mode = auto
2222
testpaths = tests
23+
24+
25+
[mypy-tests.*]
26+
disallow_untyped_defs=False

tests/test_spaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from metablock import Metablock
22

33

4-
async def test_list_spaces(cli: Metablock):
4+
async def test_list_spaces(cli: Metablock) -> None:
55
spaces = await cli.spaces.get_list()
66
assert spaces

0 commit comments

Comments
 (0)