Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa9f239

Browse files
committed
Update pre-commit and CircleCI config
Update `CircleCI` config, to run `pre-commit` on python>=3.8 Update `pyupgrade` to last version (`3.3.1`) Update `black` to last version (`23.1.0`) and apply code formatting Update `isort` to last version (`5.12.0`), fixing build fail with `pre-commit` Update `flake8` to last version (`6.0.0`)`
1 parent 44d6d0e commit fa9f239

11 files changed

+10
-25
lines changed

.circleci/config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
- checkout
1818
- python/install-packages:
1919
pkg-manager: pip
20-
- run: pre-commit run --all-files
20+
- when:
21+
condition:
22+
not:
23+
equal: ["3.7", << parameters.py_version >> ]
24+
steps:
25+
- run: pre-commit run --all-files
2126
- run: coverage run -m unittest
2227
- run: bash <(curl -s https://codecov.io/bash)
2328
- when:

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
repos:
22
- repo: https://github.com/PyCQA/flake8
3-
rev: 4.0.1
3+
rev: 6.0.0
44
hooks:
55
- id: flake8
66
- repo: https://github.com/asottile/pyupgrade
7-
rev: v1.6.1
7+
rev: v3.3.1
88
hooks:
99
- id: pyupgrade
1010
- repo: https://github.com/PyCQA/isort
11-
rev: 5.10.1
11+
rev: 5.12.0
1212
hooks:
1313
- id: isort
1414
args: ["--profile", "black"]
1515
- repo: https://github.com/psf/black
16-
rev: 22.1.0
16+
rev: 23.1.0
1717
hooks:
1818
- id: black
1919
additional_dependencies: ['click<8.1.0']
20-

auth0/authentication/delegated.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def get_token(
1717
refresh_token=None,
1818
scope="openid",
1919
):
20-
2120
"""Obtain a delegation token."""
2221

2322
if id_token and refresh_token:

auth0/authentication/users.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def __init__(
3232
"""
3333

3434
def userinfo(self, access_token):
35-
3635
"""Returns the user information based on the Auth0 access token.
3736
This endpoint will work only if openid was granted as a scope for the access_token.
3837

auth0/test/authentication/test_delegated.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class TestDelegated(unittest.TestCase):
88
@mock.patch("auth0.authentication.delegated.Delegated.post")
99
def test_get_token_id_token(self, mock_post):
10-
1110
d = Delegated("my.domain.com", "cid")
1211

1312
d.get_token(
@@ -35,7 +34,6 @@ def test_get_token_id_token(self, mock_post):
3534

3635
@mock.patch("auth0.authentication.delegated.Delegated.post")
3736
def test_get_token_refresh_token(self, mock_post):
38-
3937
d = Delegated("my.domain.com", "cid")
4038

4139
d.get_token(
@@ -62,7 +60,6 @@ def test_get_token_refresh_token(self, mock_post):
6260

6361
@mock.patch("auth0.authentication.delegated.Delegated.post")
6462
def test_get_token_value_error(self, mock_post):
65-
6663
d = Delegated("my.domain.com", "cid")
6764

6865
with self.assertRaises(ValueError):

auth0/test/authentication/test_enterprise.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class TestEnterprise(unittest.TestCase):
88
@mock.patch("auth0.authentication.enterprise.Enterprise.get")
99
def test_saml_metadata(self, mock_get):
10-
1110
e = Enterprise("my.domain.com", "cid")
1211

1312
e.saml_metadata()
@@ -16,7 +15,6 @@ def test_saml_metadata(self, mock_get):
1615

1716
@mock.patch("auth0.authentication.enterprise.Enterprise.get")
1817
def test_wsfed_metadata(self, mock_get):
19-
2018
e = Enterprise("my.domain.com", "cid")
2119

2220
e.wsfed_metadata()

auth0/test/authentication/test_get_token.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def get_private_key():
2222
class TestGetToken(unittest.TestCase):
2323
@mock.patch("auth0.rest.RestClient.post")
2424
def test_authorization_code(self, mock_post):
25-
2625
g = GetToken("my.domain.com", "cid", client_secret="clsec")
2726

2827
g.authorization_code(
@@ -47,7 +46,6 @@ def test_authorization_code(self, mock_post):
4746

4847
@mock.patch("auth0.rest.RestClient.post")
4948
def test_authorization_code_with_client_assertion(self, mock_post):
50-
5149
g = GetToken(
5250
"my.domain.com", "cid", client_assertion_signing_key=get_private_key()
5351
)
@@ -71,7 +69,6 @@ def test_authorization_code_with_client_assertion(self, mock_post):
7169

7270
@mock.patch("auth0.rest.RestClient.post")
7371
def test_authorization_code_pkce(self, mock_post):
74-
7572
g = GetToken("my.domain.com", "cid")
7673

7774
g.authorization_code_pkce(
@@ -97,7 +94,6 @@ def test_authorization_code_pkce(self, mock_post):
9794

9895
@mock.patch("auth0.rest.RestClient.post")
9996
def test_client_credentials(self, mock_post):
100-
10197
g = GetToken("my.domain.com", "cid", client_secret="clsec")
10298

10399
g.client_credentials(audience="aud", grant_type="gt")
@@ -139,7 +135,6 @@ def test_client_credentials_with_client_assertion(self, mock_post):
139135

140136
@mock.patch("auth0.rest.RestClient.post")
141137
def test_login(self, mock_post):
142-
143138
g = GetToken("my.domain.com", "cid", client_secret="clsec")
144139

145140
g.login(
@@ -194,7 +189,6 @@ def test_refresh_token(self, mock_post):
194189

195190
@mock.patch("auth0.rest.RestClient.post")
196191
def test_passwordless_login_with_sms(self, mock_post):
197-
198192
g = GetToken("my.domain.com", "cid", client_secret="csec")
199193

200194
g.passwordless_login(

auth0/test/authentication/test_passwordless.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class TestPasswordless(unittest.TestCase):
88
@mock.patch("auth0.rest.RestClient.post")
99
def test_send_email(self, mock_post):
10-
1110
p = Passwordless("my.domain.com", "cid")
1211

1312
p.email(email="[email protected]", send="snd")
@@ -27,7 +26,6 @@ def test_send_email(self, mock_post):
2726

2827
@mock.patch("auth0.rest.RestClient.post")
2928
def test_send_email_with_auth_params(self, mock_post):
30-
3129
p = Passwordless("my.domain.com", "cid")
3230

3331
p.email(email="[email protected]", send="snd", auth_params={"a": "b"})
@@ -48,7 +46,6 @@ def test_send_email_with_auth_params(self, mock_post):
4846

4947
@mock.patch("auth0.rest.RestClient.post")
5048
def test_send_email_with_client_secret(self, mock_post):
51-
5249
p = Passwordless("my.domain.com", "cid", client_secret="csecret")
5350

5451
p.email(email="[email protected]", send="snd")

auth0/test/authentication/test_revoke_token.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class TestRevokeToken(unittest.TestCase):
88
@mock.patch("auth0.rest.RestClient.post")
99
def test_revoke_refresh_token(self, mock_post):
10-
1110
a = RevokeToken("my.domain.com", "cid")
1211

1312
# regular apps

auth0/test/authentication/test_token_verifier.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def test_symmetric_verifier_fetches_key(self):
7777
self.assertEqual(key, "some secret")
7878

7979
def test_asymmetric_verifier_fetches_key(self):
80-
8180
mock_fetcher = JwksFetcher("some URL")
8281
mock_fetcher.get_key = MagicMock("get_key")
8382
mock_fetcher.get_key.return_value = RSA_PUB_KEY_1_JWK

auth0/test/authentication/test_users.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class TestUsers(unittest.TestCase):
88
@mock.patch("auth0.rest.RestClient.get")
99
def test_userinfo(self, mock_get):
10-
1110
u = Users("my.domain.com")
1211

1312
u.userinfo(access_token="atk")

0 commit comments

Comments
 (0)