-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from CrocoFactory/dev
v0.1.0.rc1
- Loading branch information
Showing
36 changed files
with
1,901 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[run] | ||
omit = | ||
sensei/_internal/_core/_types.py | ||
sensei/types.py | ||
sensei/_compat.py | ||
sensei/params.py | ||
sensei/_base_client.py | ||
tests/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
exclude = | ||
.git, | ||
__pycache__, | ||
sensei/_compat.py | ||
sensei/__init__.py | ||
sensei/client/__init__.py | ||
sensei/_internal/__init__.py | ||
sensei/_internal/tools/__init__.py | ||
sensei/_internal/_core/__init__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = 'sensei' | ||
version = '0.1.0.beta3.post1' | ||
version = '0.1.0.rc1' | ||
description = 'The python framework, providing fast and robust way to build client-side API wrappers.' | ||
authors = ['Alexey <[email protected]>'] | ||
license = 'MIT' | ||
|
@@ -11,27 +11,35 @@ classifiers = [ | |
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Programming Language :: Python :: 3.11', | ||
'Topic :: Software Development :: Libraries :: Application Frameworks', | ||
'Framework :: Pydantic', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: MacOS' | ||
'Operating System :: OS Independent', | ||
'Typing :: Typed' | ||
] | ||
packages = [{ include = 'sensei' }] | ||
|
||
[tool.poetry.dependencies] | ||
python = '^3.11' | ||
pydantic = "^2.9.0" | ||
python = '^3.9' | ||
typing-extensions = "^4.12.2" | ||
httpx = "^0.27.2" | ||
pydantic = "^2.9.2" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^8.2.2" | ||
python-dotenv = "^1.0.1" | ||
build = "^1.2.1" | ||
twine = "^5.1.1" | ||
croco-cli = "^0.3.1" | ||
flake8 = "^7.1.1" | ||
respx = "^0.21.1" | ||
pyjwt = "^2.9.0" | ||
email-validator = "^2.2.0" | ||
coverage = "^7.6.1" | ||
pytest-asyncio = "^0.24.0" | ||
|
||
[build-system] | ||
requires = ['poetry-core'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
from typing import Any | ||
from sensei.types import IRateLimit | ||
|
||
|
||
class RateLimitAttr: | ||
class _Attr: | ||
def __set_name__(self, owner: type, name: str) -> None: | ||
self.name = name | ||
self._name = name | ||
|
||
def __get__(self, obj: object, owner: type) -> Any: | ||
return obj.__dict__[self._name] | ||
|
||
|
||
class RateLimitAttr(_Attr): | ||
def __get__(self, obj: object, owner: type) -> IRateLimit: | ||
return obj.__dict__[self.name] | ||
return super().__get__(obj, owner) | ||
|
||
def __set__(self, obj: object, value: IRateLimit) -> None: | ||
if value is None or isinstance(value, IRateLimit): | ||
obj.__dict__[self.name] = value | ||
obj.__dict__[self._name] = value | ||
else: | ||
raise TypeError(f'Value must implement {IRateLimit} interface') | ||
|
||
|
||
class PortAttr: | ||
def __set_name__(self, owner: type, name: str) -> None: | ||
self.name = name | ||
|
||
def __get__(self, obj: object, owner: type) -> IRateLimit: | ||
return obj.__dict__[self.name] | ||
class PortAttr(_Attr): | ||
def __get__(self, obj: object, owner: type) -> int: | ||
return super().__get__(obj, owner) | ||
|
||
def __set__(self, obj: object, value: IRateLimit) -> None: | ||
def __set__(self, obj: object, value: int) -> None: | ||
if value is None or isinstance(value, int) and 1 <= value <= 65535: | ||
obj.__dict__[self.name] = value | ||
obj.__dict__[self._name] = value | ||
else: | ||
raise ValueError('Port must be between 1 and 65535') | ||
raise ValueError('Port must be between 1 and 65535') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.