Added poetry integration.

Description:
* Fixed github actions;
* Removed requirements.txt;
* Fixed CONTRIBUTING.md;
* Fixed black and flake8.

Signed-off-by: Pavel <win10@list.ru>
This commit is contained in:
Pavel
2021-10-08 15:57:22 +04:00
parent 80c6ff38a1
commit b2541bed1e
52 changed files with 2685 additions and 377 deletions

View File

@ -99,7 +99,7 @@ class AliasManager:
return table.alias(f"{alias}_{table.name}")
def add_relation_type(
self, source_model: Type["Model"], relation_name: str, reverse_name: str = None,
self, source_model: Type["Model"], relation_name: str, reverse_name: str = None
) -> None:
"""
Registers the relations defined in ormar models.

View File

@ -294,7 +294,7 @@ class QuerysetProxy(Generic[T]):
:type fields: Union[List, str, Set, Dict]
"""
return await self.queryset.values(
fields=fields, exclude_through=exclude_through,
fields=fields, exclude_through=exclude_through
)
async def values_list(
@ -479,8 +479,7 @@ class QuerysetProxy(Generic[T]):
await child.update(**kwargs) # type: ignore
if self.type_ == ormar.RelationType.MULTIPLE and through_kwargs:
await self.update_through_instance(
child=child, # type: ignore
**through_kwargs,
child=child, **through_kwargs # type: ignore
)
return len(children)

View File

@ -57,7 +57,7 @@ class RelationsManager:
return None # pragma nocover
@staticmethod
def add(parent: "Model", child: "Model", field: "ForeignKeyField",) -> None:
def add(parent: "Model", child: "Model", field: "ForeignKeyField") -> None:
"""
Adds relation on both sides -> meaning on both child and parent models.
One side of the relation is always weakref proxy to avoid circular refs.
@ -73,7 +73,7 @@ class RelationsManager:
:param field: field with relation definition
:type field: ForeignKeyField
"""
(parent, child, child_name, to_name,) = get_relations_sides_and_names(
(parent, child, child_name, to_name) = get_relations_sides_and_names(
field, parent, child
)

View File

@ -8,7 +8,7 @@ if TYPE_CHECKING: # pragma no cover
def get_relations_sides_and_names(
to_field: ForeignKeyField, parent: "Model", child: "Model",
to_field: ForeignKeyField, parent: "Model", child: "Model"
) -> Tuple["Model", "Model", str, str]:
"""
Determines the names of child and parent relations names, as well as