Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/flake8.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pre-commit check

on:
push:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- uses: astral-sh/setup-uv@v5

- name: pre-commit (uvx)
run: uvx pre-commit run --all
env:
RUFF_OUTPUT_FORMAT: github
22 changes: 5 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,12 @@ repos:
- id: debug-statements
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: isort
args: [--profile=black]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
4 changes: 1 addition & 3 deletions social_core/backends/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ def public_key(self):
]
)

def user_data(
self, access_token, *args, **kwargs
): # pylint: disable=unused-argument
def user_data(self, access_token, *args, **kwargs): # pylint: disable=unused-argument
"""Decode user data from the access_token

You can specialize this method to e.g. get information
Expand Down
2 changes: 1 addition & 1 deletion social_core/backends/loginradius.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def request_access_token(self, *args, **kwargs):
return self.get_json(
params={"token": self.data.get("token"), "secret": self.setting("SECRET")},
*args,
**kwargs
**kwargs,
)

def user_data(self, access_token, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions social_core/backends/orcid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
ORCID OAuth2 Application backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/orcid.html
ORCID OAuth2 Application backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/orcid.html
"""

from .oauth import BaseOAuth2
Expand Down
2 changes: 1 addition & 1 deletion social_core/backends/scistarter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" SciStarter OAuth2 Auth """
"""SciStarter OAuth2 Auth"""

from .oauth import BaseOAuth2

Expand Down
2 changes: 1 addition & 1 deletion social_core/backends/untappd.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def auth_complete(self, *args, **kwargs):
response["response"]["access_token"],
response=response["response"],
*args,
**kwargs
**kwargs,
)

def get_user_details(self, response):
Expand Down
1 change: 1 addition & 0 deletions social_core/backends/weibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Weibo OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/weibo.html
"""

from .oauth import BaseOAuth2


Expand Down
1 change: 1 addition & 0 deletions social_core/backends/weixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Weixin OAuth2 backend
"""

from urllib.parse import urlencode

from requests import HTTPError
Expand Down
2 changes: 1 addition & 1 deletion social_core/pipeline/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def wrapper(strategy, backend, pipeline_index, *args, **kwargs):
pipeline_index=pipeline_index,
current_partial=current_partial,
*args,
**kwargs
**kwargs,
)
or {}
)
Expand Down
1 change: 0 additions & 1 deletion social_core/tests/backends/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def do_login(self):


class BaseAuthUrlTestMixin:

def check_parameters_in_authorization_url(self, auth_url_key="AUTHORIZATION_URL"):
"""
Check the parameters in authorization url
Expand Down
8 changes: 2 additions & 6 deletions social_core/tests/backends/test_keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
-----BEGIN RSA PRIVATE KEY-----
{_PRIVATE_KEY_HEADERLESS}
-----END RSA PRIVATE KEY-----
""".format(
_PRIVATE_KEY_HEADERLESS=_PRIVATE_KEY_HEADERLESS
)
""".format(_PRIVATE_KEY_HEADERLESS=_PRIVATE_KEY_HEADERLESS)

_PUBLIC_KEY_HEADERLESS = """
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvyo2hx1L3ALHeUd/6xk/
Expand All @@ -55,9 +53,7 @@
-----BEGIN PUBLIC KEY-----
{_PUBLIC_KEY_HEADERLESS}
-----END PUBLIC KEY-----
""".format(
_PUBLIC_KEY_HEADERLESS=_PUBLIC_KEY_HEADERLESS
)
""".format(_PUBLIC_KEY_HEADERLESS=_PUBLIC_KEY_HEADERLESS)

_KEY = "example"
_SECRET = "1234abcd-1234-abcd-1234-abcd1234adcd"
Expand Down
Loading