-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: drop support for Python3.8 #1848
Conversation
CodSpeed Performance ReportMerging #1848 will not alter performanceComparing Summary
|
Pull Request Test Coverage Report for Build 12879310652Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on replacing List, Dict, etc.!
meta.fields_map = fields_map | ||
meta.fields_db_projection = fields_db_projection | ||
meta._filters = filters | ||
meta.fk_fields = fk_fields | ||
meta.backward_fk_fields = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are backward_fk_fields
, default_connection
and other fields are removed from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there are defined in MetaInfo.__init__
:
tortoise-orm/tortoise/models.py
Line 240 in 71624e7
self.backward_fk_fields: Set[str] = set() |
tortoise/models.py
Outdated
class ModelMeta(type): | ||
__slots__ = () | ||
# Searching for Field attributes in the class hierarchy | ||
def _search_for_field_attributes(base: Type, attrs: dict) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be a static method as parse_custom_pk
and dispatch_fields
, I don't see a reason why we would want to keep it as a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it into ModelMeta as a classmethod, because it's a recursion function that can not be set as staticmethod.
Description
Python3.8 already EOL: https://devguide.python.org/versions/
Motivation and Context
Changes:
typing.List/Tuple/Set/Dict
-->list/tuple/set/dict
typing.Callable/Coroutine/Iterable/...
-->collections.abc.Callable/Coroutine/Iterable/...
functools.lru_cache(maxsize=None)
-->functools.cache
super(xxx, self)
->super()
tortoise.models.ModelMeta
to fix codacy issue (python -m mccabe --min 15 tortoise/models.py
)How Has This Been Tested?
make ci
Checklist: