-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Update .pre-commit-config.yaml #435
Conversation
updated pyupgrade argument
@@ -20,7 +20,7 @@ repos: | |||
rev: v3.15.0 | |||
hooks: | |||
- id: pyupgrade | |||
args: ['--py37-plus'] | |||
args: ['--py38-plus'] |
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.
It will generate a impact on code, see below:
diff --git a/src/flask_jsonrpc/types.py b/src/flask_jsonrpc/types.py
index 01d09cd..23c3733 100644
--- a/src/flask_jsonrpc/types.py
+++ b/src/flask_jsonrpc/types.py
@@ -46,7 +46,7 @@ except ImportError: # pragma: no cover
# Python 3.8+
try:
- from typing_extensions import Final
+ from typing import Final
except ImportError: # pragma: no cover
from typing import Final # type: ignore # pylint: disable=C0412
Because of that, I didn't this change, and for now it isn't a big deal.
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.
Moreover, run the pre-commit
command and commit the changes,
$ pre-commit run --all-files
Let see if that change will not break the code, ;).
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 mean, to push the code to this branch for GitHub Actions run the tests around the Python 3.8 version.
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 mean, to push the code to this branch for GitHub Actions run the tests around the Python 3.8 version.
looks fine!
apply result of run pyupgrade --py38-plus
src/flask_jsonrpc/types.py
Outdated
@@ -46,7 +46,7 @@ | |||
|
|||
# Python 3.8+ | |||
try: | |||
from typing_extensions import Final | |||
from typing import Final |
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.
As this line is the same that inside the except
block, please put this import on top of file (according to isort rules ;)
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.
As this line is the same that inside the
except
block, please put this import on top of file (according to isort rules ;)
fixed!
deleted extra import
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!
* Build Python wheels for all the platforms (#447) * Add experimental support to Mypyc (#442) * Bump the python-requirements group in /requirements with 1 update (#446) * Bump the python-requirements group in /requirements with 8 updates (#445) * Bump the python-requirements group in /requirements with 2 updates (#438) * Migrate from pylint, flake8, isort and black to ruff (#437) * Remove Py37 compability (#435)
updated pyupgrade argument