Skip to content

Commit b28b48b

Browse files
authored
Merge pull request #1 from PlayerData/fix-linting
fix: linting
2 parents ec6da3a + d51f4cf commit b28b48b

17 files changed

Lines changed: 2618 additions & 4246 deletions

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
activate-environment: true
2727

2828
- name: Install Dependencies
29-
run: uv sync --locked
29+
run: uv sync --extra dev --locked
3030

31-
- name: Format Check (Black)
32-
run: uv run --no-sync black . --check
31+
- name: Lint Check (Ruff)
32+
run: uv run --no-sync ruff check .
3333

34-
- name: Import Cleanup Check (Autoflake)
35-
run: uv run --no-sync pautoflake ./ --check --quiet
34+
- name: Format Check (Ruff)
35+
run: uv run --no-sync ruff format --check .

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
activate-environment: true
2727

2828
- name: Install Dependencies
29-
run: uv sync --locked
29+
run: uv sync --extra dev --locked
3030

3131
- name: Run Tests
3232
run: uv run --no-sync pytest

example_direct.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from playerdatapy.gqlclient import Client
33
from playerdatapy.gqlauth import AuthenticationType
44
import asyncio
5+
from playerdatapy.constants import API_BASE_URL
56

67
# Build out the query string.
78
# Our GraphiQL Playground at https://app.playerdata.co.uk/api/graphiql/ is useful for building out and testing the query.
@@ -18,14 +19,15 @@
1819
}
1920
"""
2021

22+
2123
async def main(session_id: str):
2224
auth = GraphqlAuth(
2325
client_id=CLIENT_ID,
2426
client_secret=CLIENT_SECRET,
2527
type=AuthenticationType.CLIENT_CREDENTIALS_FLOW,
2628
)
2729
client = Client(
28-
url="https://app.playerdata.co.uk/api/graphql",
30+
url=f"{API_BASE_URL}/api/graphql",
2931
headers={"Authorization": f"Bearer {auth._get_authentication_token()}"},
3032
)
3133
response = await client.execute(

example_pydantic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import asyncio
32
from datetime import datetime, timedelta
43

playerdatapy/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
VideoRecordingAttributes,
136136
)
137137

138-
139138
# Appended manually
140139
from .playerdata_api import PlayerDataAPI
141140

playerdatapy/auth/authorisation_code_flow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .authorisation_code_flow_base import AuthorisationCodeFlowBase
22

3+
34
class AuthorisationCodeFlow(AuthorisationCodeFlowBase):
45
"""Handles oauth2 authorisation code flow and token management."""
56

playerdatapy/auth/authorisation_code_flow_pcke.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .authorisation_code_flow_base import AuthorisationCodeFlowBase
22

3+
34
class AuthorisationCodeFlowPCKE(AuthorisationCodeFlowBase):
45
"""Handles oauth2 authentication code flow with PKCE and token management."""
56

playerdatapy/auth/base_flow.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
import json
33
import time
44
from oauthlib.oauth2 import TokenExpiredError
5-
from .configuration import API_BASE_URL
5+
from playerdatapy.constants import API_BASE_URL
66

77

88
class BaseAuthFlow:
99
"""Base class for OAuth2 authentication flows with token management."""
1010

11-
1211
def __init__(self, client_id: str, token_file: str = ".token"):
1312
self.client_id = client_id
1413
self.token_file = token_file

playerdatapy/auth/client_credentials_flow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def __init__(self, client_id: str, client_secret: str, token_file: str = ".token
1212
self.client_secret = client_secret
1313

1414
def authenticate(self, save_token: bool = True) -> dict:
15-
1615
client = BackendApplicationClient(client_id=self.client_id)
1716

1817
self.oauth_session = OAuth2Session(

playerdatapy/auth/configuration.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)