Skip to content

Commit eaeae46

Browse files
authored
feat: add pyupgrade pre-commit hook
1 parent 6905d45 commit eaeae46

12 files changed

+23
-3
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ repos:
2525
rev: 21.5b1
2626
hooks:
2727
- id: black
28+
29+
- repo: https://github.com/asottile/pyupgrade
30+
rev: v2.29.0
31+
hooks:
32+
- id: pyupgrade
33+
args: ['--py37-plus', '--keep-runtime-typing']

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ def pytest_runtest_setup(item):
4848
# if name found, test has failed for the combination of
4949
# class name & test name
5050
if test_name is not None:
51-
pytest.xfail("previous test failed ({})".format(test_name))
51+
pytest.xfail(f"previous test failed ({test_name})")

gotrue/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
__version__ = "0.2.0"
24

35
from ._async.api import AsyncGoTrueAPI # noqa: F401

gotrue/_async/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from __future__ import annotations

gotrue/_async/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def _unsubscribe(self, *, id: str) -> None:
455455
def on_auth_state_change(
456456
self,
457457
*,
458-
callback: Callable[["AuthChangeEvent", Optional[Session]], None],
458+
callback: Callable[[AuthChangeEvent, Optional[Session]], None],
459459
) -> Subscription:
460460
"""Receive a notification every time an auth event happens.
461461

gotrue/_async/storage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from abc import ABC, abstractmethod
24
from typing import Dict, Optional
35

gotrue/_sync/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from __future__ import annotations

gotrue/_sync/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def _unsubscribe(self, *, id: str) -> None:
453453
def on_auth_state_change(
454454
self,
455455
*,
456-
callback: Callable[["AuthChangeEvent", Optional[Session]], None],
456+
callback: Callable[[AuthChangeEvent, Optional[Session]], None],
457457
) -> Subscription:
458458
"""Receive a notification every time an auth event happens.
459459

gotrue/_sync/storage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from abc import ABC, abstractmethod
24
from typing import Dict, Optional
35

gotrue/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
GOTRUE_URL = "http://localhost:9999"
24
AUDIENCE = ""
35
DEFAULT_HEADERS = {}

gotrue/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from time import time
24
from typing import Any, Callable, TypeVar, Union
35
from urllib.parse import quote

gotrue/http_clients.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from httpx import AsyncClient # noqa: F401
24
from httpx import Client as BaseClient # noqa: F401
35

0 commit comments

Comments
 (0)