Skip to content
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 Python 3.8 and add support for Python 3.12 #153

Merged
merged 9 commits into from
Nov 14, 2023

Conversation

carloslubbers
Copy link
Contributor

@carloslubbers carloslubbers commented Oct 5, 2023

BREAKING CHANGE for users of Python 3.8, please update to the latest version of Python (3.12)

Carlos Lubbers added 6 commits October 5, 2023 13:20
BREAKING CHANGE for users of Python 3.8, please update to the latest version of Python (3.12)
@yurnih
Copy link
Collaborator

yurnih commented Oct 13, 2023

In addition, since Python 3.9 will be the minimum required version, they polyfill created in utils could be removed too (and some of those references).

if sys.version_info < (3, 9):
# Python 3.9 does not include `_special`, so use the function from typing instead
def get_args(tp):
"""Get type arguments with all substitutions performed.
For unions, basic simplifications used by Union constructor are performed.
Examples:
get_args(Dict[str, int]) == (str, int)
get_args(int) == ()
get_args(Union[int, Union[T, int], str][int]) == (int, str)
get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
get_args(Callable[[], T][int]) == ([], int)
"""
if isinstance(tp, (_GenericAlias, _SpecialForm)) and not tp._special:
res = tp.__args__
if tp.__origin__ is collections.abc.Callable and res[0] is not Ellipsis:
res = (list(res[:-1]), res[-1])
return res
return ()
else:
from typing import get_args as get_args # NOQA

@carloslubbers carloslubbers changed the title feat: Drop support for Python 3.8 feat: Drop support for Python 3.8 and add support for Python 3.12 Nov 14, 2023
Copy link

sonarcloud bot commented Nov 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@carloslubbers carloslubbers merged commit 2e2f298 into master Nov 14, 2023
15 of 16 checks passed
ElhMah pushed a commit that referenced this pull request Jan 26, 2024
BREAKING CHANGE for users of Python 3.8, please update to the latest version of Python (3.12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants