Skip to content

Commit bfb0346

Browse files
committed
Add ruff instead of black
1 parent 58cb29a commit bfb0346

File tree

7 files changed

+12
-16
lines changed

7 files changed

+12
-16
lines changed

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import os
15+
import sys
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
1819
# documentation root, use os.path.abspath to make it absolute, like shown here.
1920
sys.path.insert(0, os.path.abspath(".."))
20-
from requests_oauthlib import __version__
21+
from requests_oauthlib import __version__ # noqa: E402
2122

2223
# -- General configuration -----------------------------------------------------
2324

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Publishing a release (for maintainer role)
5050
Maintainer tasks should always be kept to minimum. Once a release is ready, the suggested approach can be followed:
5151

5252
#. Create new branch release-X.Y.Z
53-
#. Update the HISTORY.rst file
53+
#. Update HISTORY.rst and AUTHORS.rst if required
5454
#. Update the `request_oauthlib/__init__.py`
5555
#. Raise a pull request to give a chance for all contributors to comment before publishing
5656
#. Create a TAG vX.Y.Z. By doing this, the pipeline will automatically trigger `twine` and will publish the release to PyPi.

requests_oauthlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: F401
12
import logging
23

34
from .oauth1_auth import OAuth1

requests_oauthlib/compliance_fixes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: F401
12
from __future__ import absolute_import
23

34
from .facebook import facebook_compliance_fix

requests_oauthlib/oauth2_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def refresh_token(
476476
r = hook(r)
477477

478478
self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
479-
if not "refresh_token" in self.token:
479+
if "refresh_token" not in self.token:
480480
log.debug("No new refresh token given. Re-using old.")
481481
self.token["refresh_token"] = refresh_token
482482
return self.token

tests/test_oauth1_session.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
if sys.version[0] == "3":
2727
unicode_type = str
2828
else:
29-
unicode_type = unicode
29+
unicode_type = unicode # noqa
3030

3131

3232
TEST_RSA_KEY = (
@@ -308,12 +308,6 @@ def test_authorized_true_rsa(self, generate_nonce, generate_timestamp):
308308

309309
generate_nonce.return_value = "abc"
310310
generate_timestamp.return_value = "123"
311-
signature = (
312-
"OAuth "
313-
'oauth_nonce="abc", oauth_timestamp="123", oauth_version="1.0", '
314-
'oauth_signature_method="RSA-SHA1", oauth_consumer_key="foo", '
315-
'oauth_verifier="bar", oauth_signature="{sig}"'
316-
).format(sig=TEST_RSA_OAUTH_SIGNATURE)
317311
sess = OAuth1Session(
318312
"key",
319313
"secret",

tox.ini

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist=py{38,39,310,311,312,py3},docs,readme,black
2+
envlist=py{38,39,310,311,312,py3},docs,readme,ruff
33

44
[testenv]
55
description=run test on {basepython}
@@ -27,8 +27,7 @@ deps=twine>=1.12.0
2727
commands=
2828
twine check .tox/dist/*
2929

30-
[testenv:black]
31-
description=show diff of code format
30+
[testenv:ruff]
3231
basepython=python3.11
33-
deps=black
34-
commands=black --check --diff .
32+
deps=ruff
33+
commands=ruff .

0 commit comments

Comments
 (0)