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

Update .pre-commit-config.yaml #435

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Update .pre-commit-config.yaml #435

merged 3 commits into from
Jan 19, 2024

Conversation

alexted
Copy link
Contributor

@alexted alexted commented Jan 19, 2024

updated pyupgrade argument

updated pyupgrade argument
@@ -20,7 +20,7 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
args: ['--py37-plus']
args: ['--py38-plus']
Copy link
Member

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.

Copy link
Member

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, ;).

Copy link
Member

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.

Copy link
Contributor Author

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
@@ -46,7 +46,7 @@

# Python 3.8+
try:
from typing_extensions import Final
from typing import Final
Copy link
Member

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 ;)

Copy link
Contributor Author

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
Copy link
Member

@nycholas nycholas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@nycholas nycholas merged commit 401f59c into cenobites:master Jan 19, 2024
3 checks passed
nycholas added a commit that referenced this pull request Feb 11, 2024
* 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)
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