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

Skip to content

Commit 8212562

Browse files
authored
Merge branch 'v4' into remove-ro
2 parents b9e2387 + 7be0630 commit 8212562

File tree

6 files changed

+50
-28
lines changed

6 files changed

+50
-28
lines changed

.circleci/config.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,34 @@ orbs:
55
ship: auth0/[email protected]
66
codecov: codecov/codecov@3
77

8-
executors:
9-
python_3_10:
10-
docker:
11-
- image: cimg/python:3.10
12-
138
jobs:
14-
build:
15-
executor: python_3_10
9+
build_and_test:
10+
parameters:
11+
py_version:
12+
type: string
13+
default: "3.10"
14+
docker:
15+
- image: cimg/python:<< parameters.py_version >>
1616
steps:
1717
- checkout
1818
- python/install-packages:
1919
pkg-manager: pip
2020
- run: pre-commit run --all-files
2121
- run: coverage run -m unittest
2222
- run: bash <(curl -s https://codecov.io/bash)
23-
- run: make -C docs html
23+
- when:
24+
condition:
25+
equal: [ "3.10", << parameters.py_version >> ]
26+
steps:
27+
- run: make -C docs html
2428

2529
workflows:
2630
main:
2731
jobs:
28-
- build
32+
- build_and_test:
33+
matrix:
34+
parameters:
35+
py_version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
2936
- ship/python-publish:
3037
prefix-tag: false
3138
context:
@@ -36,4 +43,4 @@ workflows:
3643
only:
3744
- master
3845
requires:
39-
- build
46+
- build_and_test

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ You can install the auth0 Python SDK using the following command.
2222
pip install auth0-python
2323
```
2424

25-
For python3, use the following command
26-
```
27-
pip3 install auth0-python
28-
```
29-
Python 3.2 and 3.3 have reached [EOL](https://en.wikipedia.org/wiki/CPython#Version_history) and support will be removed in the near future.
25+
> Requires Python 3.7 or higher.
3026
3127
### Usage
3228

auth0/v3/test_async/test_async_auth0.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import platform
44
import re
55
import sys
6+
import unittest
67
from tempfile import TemporaryFile
7-
from unittest import IsolatedAsyncioTestCase
88

99
import aiohttp
1010
from aioresponses import CallbackResult, aioresponses
@@ -27,7 +27,11 @@ def callback(url, **kwargs):
2727
return callback, mock
2828

2929

30-
class TestAsyncify(IsolatedAsyncioTestCase):
30+
@unittest.skipIf(
31+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
32+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
33+
)
34+
class TestAuth0(getattr(unittest, "IsolatedAsyncioTestCase", object)):
3135
@aioresponses()
3236
async def test_get(self, mocked):
3337
callback, mock = get_callback()

auth0/v3/test_async/test_async_token_verifier.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ def get_pem_bytes(rsa_public_key):
5454
)
5555

5656

57-
class TestAsyncAsymmetricSignatureVerifier(unittest.IsolatedAsyncioTestCase):
57+
@unittest.skipIf(
58+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
59+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
60+
)
61+
class TestAsyncAsymmetricSignatureVerifier(
62+
getattr(unittest, "IsolatedAsyncioTestCase", object)
63+
):
5864
@aioresponses()
5965
async def test_async_asymmetric_verifier_fetches_key(self, mocked):
6066
callback, mock = get_callback(200, JWKS_RESPONSE_SINGLE_KEY)
@@ -67,7 +73,11 @@ async def test_async_asymmetric_verifier_fetches_key(self, mocked):
6773
self.assertEqual(get_pem_bytes(key), RSA_PUB_KEY_1_PEM)
6874

6975

70-
class TestAsyncJwksFetcher(unittest.IsolatedAsyncioTestCase):
76+
@unittest.skipIf(
77+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
78+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
79+
)
80+
class TestAsyncJwksFetcher(getattr(unittest, "IsolatedAsyncioTestCase", object)):
7181
@aioresponses()
7282
@unittest.mock.patch(
7383
"auth0.v3.authentication.token_verifier.time.time", return_value=0
@@ -218,7 +228,11 @@ async def test_async_fails_to_fetch_jwks_json_after_retrying_twice(self, mocked)
218228
self.assertEqual(mock.call_count, 2)
219229

220230

221-
class TestAsyncTokenVerifier(unittest.IsolatedAsyncioTestCase):
231+
@unittest.skipIf(
232+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
233+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
234+
)
235+
class TestAsyncTokenVerifier(getattr(unittest, "IsolatedAsyncioTestCase", object)):
222236
@aioresponses()
223237
async def test_RS256_token_signature_passes(self, mocked):
224238
callback, mock = get_callback(200, {"keys": [PUBLIC_KEY]})

auth0/v3/test_async/test_asyncify.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import platform
44
import re
55
import sys
6+
import unittest
67
from tempfile import TemporaryFile
7-
from unittest import IsolatedAsyncioTestCase
88

99
import aiohttp
1010
from aioresponses import CallbackResult, aioresponses
@@ -50,7 +50,11 @@ def callback(url, **kwargs):
5050
return callback, mock
5151

5252

53-
class TestAsyncify(IsolatedAsyncioTestCase):
53+
@unittest.skipIf(
54+
not hasattr(unittest, "IsolatedAsyncioTestCase"),
55+
"python 3.7 doesn't have IsolatedAsyncioTestCase",
56+
)
57+
class TestAsyncify(getattr(unittest, "IsolatedAsyncioTestCase", object)):
5458
@aioresponses()
5559
async def test_get(self, mocked):
5660
callback, mock = get_callback()

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@ def find_version():
2929
author_email="[email protected]",
3030
license="MIT",
3131
packages=find_packages(),
32-
install_requires=["requests>=2.14.0", "pyjwt[crypto]>=1.7.1"],
32+
install_requires=["requests>=2.14.0", "pyjwt[crypto]>=2.6.0"],
3333
extras_require={"test": ["coverage", "mock>=1.3.0", "pre-commit"]},
34-
python_requires=">=2.7, !=3.0.*, !=3.1.*",
34+
python_requires=">=3.7",
3535
classifiers=[
36-
"Development Status :: 4 - Beta",
36+
"Development Status :: 5 - Production/Stable",
3737
"Intended Audience :: Developers",
3838
"Operating System :: OS Independent",
3939
"License :: OSI Approved :: MIT License",
40-
"Programming Language :: Python :: 3",
41-
"Programming Language :: Python :: 3 :: Only",
42-
"Programming Language :: Python :: 3.6",
4340
"Programming Language :: Python :: 3.7",
4441
"Programming Language :: Python :: 3.8",
4542
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)