Resolves: rhbz#1922352 - python-oauthlib requires python-mock

- Update to upstream 3.1.0
- Gets rid of obsolete python-nose dependency
- Nuke the python2/python3 conditionals, let's only support python3
This commit is contained in:
Jakub Hrozek 2021-05-25 09:56:34 +02:00
parent dce260245a
commit c851f859b8
6 changed files with 455 additions and 79 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/oauthlib-2.0.1.tar.gz /oauthlib-2.0.1.tar.gz
/v2.1.0.tar.gz /v2.1.0.tar.gz
/oauthlib-3.0.2.tar.gz /oauthlib-3.0.2.tar.gz
/oauthlib-3.1.0.tar.gz

80
nomock-direct-core.patch Normal file
View File

@ -0,0 +1,80 @@
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py
--- oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py.import_mock_core 2021-05-10 13:45:33.273189402 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py 2021-05-10 13:46:17.883317682 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.tokens import BearerToken
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py
--- oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py.import_mock_core 2021-05-10 13:45:33.276189411 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py 2021-05-10 13:46:05.152281074 +0200
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-import mock
+from unittest import mock
import time
from oauthlib.common import Request
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py
--- oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py.import_mock_core 2021-05-10 13:45:33.278189416 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py 2021-05-10 13:46:12.971303558 +0200
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.common import Request
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py
--- oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py.import_mock_core 2021-05-10 13:45:33.274189405 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py 2021-05-10 13:46:10.072295221 +0200
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.tokens import BearerToken
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py
--- oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py.import_mock_core 2021-05-10 13:45:33.280189422 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py 2021-05-10 13:46:15.650311261 +0200
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
diff -up oauthlib-3.1.0/tests/openid/connect/core/test_server.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/test_server.py
--- oauthlib-3.1.0/tests/openid/connect/core/test_server.py.import_mock_core 2021-05-10 13:45:33.271189396 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/test_server.py 2021-05-10 13:46:23.046332529 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.endpoints.authorization import AuthorizationEndpoint
diff -up oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py.import_mock_core oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py
--- oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py.import_mock_core 2021-05-10 13:45:33.269189391 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py 2021-05-10 13:46:20.348324770 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.openid.connect.core.tokens import JWTToken

197
nomock-direct.patch Normal file
View File

@ -0,0 +1,197 @@
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_client_authentication.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_client_authentication.py.import_mock 2021-05-10 13:29:05.881284703 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_client_authentication.py 2021-05-10 13:34:09.452187326 +0200
@@ -13,7 +13,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
MobileApplicationServer, RequestValidator,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py.import_mock 2021-05-10 13:29:05.877284691 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py 2021-05-10 13:34:02.487166616 +0200
@@ -7,7 +7,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.oauth2 import (MobileApplicationServer, RequestValidator,
WebApplicationServer)
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_error_responses.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_error_responses.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_error_responses.py.import_mock 2021-05-10 13:29:05.879284697 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_error_responses.py 2021-05-10 13:34:04.801173496 +0200
@@ -4,7 +4,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import urlencode
from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py.import_mock 2021-05-10 13:29:05.874284682 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py 2021-05-10 13:33:57.745152516 +0200
@@ -2,7 +2,7 @@
"""
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
MobileApplicationServer, RequestValidator,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py.import_mock 2021-05-10 13:29:05.884284712 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py 2021-05-10 13:34:07.165180526 +0200
@@ -4,7 +4,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
MobileApplicationServer, RequestValidator,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_scope_handling.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_scope_handling.py.import_mock 2021-05-10 13:29:05.872284676 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_scope_handling.py 2021-05-10 13:34:00.218159869 +0200
@@ -7,7 +7,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
MobileApplicationServer, RequestValidator, Server,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_authorization_code.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_authorization_code.py.import_mock 2021-05-10 13:29:05.863284649 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_authorization_code.py 2021-05-10 13:33:06.712000770 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_client_credentials.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_client_credentials.py.import_mock 2021-05-10 13:29:05.865284655 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_client_credentials.py 2021-05-10 13:33:09.931010342 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.grant_types import ClientCredentialsGrant
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_implicit.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_implicit.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_implicit.py.import_mock 2021-05-10 13:29:05.856284628 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_implicit.py 2021-05-10 13:32:57.082972139 +0200
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.grant_types import ImplicitGrant
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_refresh_token.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_refresh_token.py.import_mock 2021-05-10 13:29:05.861284643 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_refresh_token.py 2021-05-10 13:33:03.865992308 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py.import_mock 2021-05-10 13:29:05.858284634 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py 2021-05-10 13:33:00.930983581 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/test_server.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/test_server.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/test_server.py.import_mock 2021-05-10 13:29:05.870284670 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/test_server.py 2021-05-10 13:33:55.289145213 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import json
-import mock
+from unittest import mock
from oauthlib import common
from oauthlib.oauth2.rfc6749 import errors, tokens
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/test_tokens.py.import_mock oauthlib-3.1.0/tests/oauth2/rfc6749/test_tokens.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/test_tokens.py.import_mock 2021-05-10 13:29:05.868284664 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/test_tokens.py 2021-05-10 13:34:19.177216243 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.tokens import (
diff -up oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_claims_handling.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_claims_handling.py
--- oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_claims_handling.py.import_mock 2021-05-10 13:29:05.849284608 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_claims_handling.py 2021-05-10 13:32:42.946930106 +0200
@@ -8,7 +8,7 @@ The claims parameter is an optional quer
"""
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.openid import RequestValidator
from oauthlib.openid.connect.core.endpoints.pre_configured import Server
diff -up oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py
--- oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py.import_mock 2021-05-10 13:29:05.851284613 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py 2021-05-10 13:32:47.634944046 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
from oauthlib.oauth2 import InvalidRequestError
from oauthlib.oauth2.rfc6749.endpoints.authorization import \
diff -up oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py
--- oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py.import_mock 2021-05-10 13:29:05.853284619 +0200
+++ oauthlib-3.1.0/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py 2021-05-10 13:32:51.005954069 +0200
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
import json
from oauthlib.openid import RequestValidator
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_authorization_code.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_base.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_dispatchers.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_hybrid.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/grant_types/test_implicit.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/test_server.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/test_server.py
diff -up oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py.import_mock oauthlib-3.1.0/tests/openid/connect/core/test_tokens.py

162
nomock-indirect.patch Normal file
View File

@ -0,0 +1,162 @@
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_access_token.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_access_token.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_access_token.py.mock_indirect 2021-05-10 12:43:55.343919797 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_access_token.py 2021-05-10 12:46:56.336475872 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
from oauthlib.oauth1 import RequestValidator
from oauthlib.oauth1.rfc5849 import Client
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_authorization.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_authorization.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_authorization.py.mock_indirect 2021-05-10 12:43:55.340919787 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_authorization.py 2021-05-10 12:46:53.640467589 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import MagicMock
+from unittest.mock import MagicMock
from oauthlib.oauth1 import RequestValidator
from oauthlib.oauth1.rfc5849 import errors
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_base.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_base.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_base.py.mock_indirect 2021-05-10 12:43:55.347919809 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_base.py 2021-05-10 12:46:43.396436116 +0200
@@ -2,7 +2,7 @@ from __future__ import absolute_import,
from re import sub
-from mock import MagicMock
+from unittest.mock import MagicMock
from oauthlib.common import CaseInsensitiveDict, safe_string_equals
from oauthlib.oauth1 import Client, RequestValidator
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_request_token.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_request_token.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_request_token.py.mock_indirect 2021-05-10 12:43:55.345919802 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_request_token.py 2021-05-10 12:46:59.010484087 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
from oauthlib.oauth1 import RequestValidator
from oauthlib.oauth1.rfc5849 import Client
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_resource.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_resource.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_resource.py.mock_indirect 2021-05-10 12:43:55.338919781 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_resource.py 2021-05-10 12:46:48.398451483 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
from oauthlib.oauth1 import RequestValidator
from oauthlib.oauth1.rfc5849 import Client
diff -up oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_signature_only.py.mock_indirect oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_signature_only.py
--- oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_signature_only.py.mock_indirect 2021-05-10 12:43:55.342919793 +0200
+++ oauthlib-3.1.0/tests/oauth1/rfc5849/endpoints/test_signature_only.py 2021-05-10 12:46:50.956459343 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
from oauthlib.oauth1 import RequestValidator
from oauthlib.oauth1.rfc5849 import Client
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_backend_application.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_backend_application.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_backend_application.py.mock_indirect 2021-05-10 12:43:55.326919744 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_backend_application.py 2021-05-10 12:47:06.771507932 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import os
-from mock import patch
+from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import BackendApplicationClient
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_legacy_application.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_legacy_application.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_legacy_application.py.mock_indirect 2021-05-10 12:43:55.320919726 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_legacy_application.py 2021-05-10 12:48:21.082736247 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import os
-from mock import patch
+from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import LegacyApplicationClient
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_mobile_application.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_mobile_application.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_mobile_application.py.mock_indirect 2021-05-10 12:43:55.328919750 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_mobile_application.py 2021-05-10 12:47:04.255500202 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
import os
-from mock import patch
+from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import MobileApplicationClient
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_service_application.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_service_application.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_service_application.py.mock_indirect 2021-05-10 12:43:55.323919735 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_service_application.py 2021-05-10 12:47:09.375515932 +0200
@@ -5,7 +5,7 @@ import os
from time import time
import jwt
-from mock import patch
+from unittest.mock import patch
from oauthlib.common import Request
from oauthlib.oauth2 import ServiceApplicationClient
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_web_application.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_web_application.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_web_application.py.mock_indirect 2021-05-10 12:43:55.330919757 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/clients/test_web_application.py 2021-05-10 12:47:01.696492340 +0200
@@ -5,7 +5,7 @@ import datetime
import os
import warnings
-from mock import patch
+from unittest.mock import patch
from oauthlib import common, signals
from oauthlib.oauth2 import (BackendApplicationClient, Client,
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py.mock_indirect 2021-05-10 12:43:55.336919775 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py 2021-05-10 12:48:12.888711068 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
from json import loads
-from mock import MagicMock
+from unittest.mock import MagicMock
from oauthlib.common import urlencode
from oauthlib.oauth2 import RequestValidator, IntrospectEndpoint
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py.mock_indirect 2021-05-10 12:43:55.333919766 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py 2021-05-10 12:48:10.078702435 +0200
@@ -3,7 +3,7 @@ from __future__ import absolute_import,
from json import loads
-from mock import MagicMock
+from unittest.mock import MagicMock
from oauthlib.common import urlencode
from oauthlib.oauth2 import RequestValidator, RevocationEndpoint
diff -up oauthlib-3.1.0/tests/oauth2/rfc6749/test_parameters.py.mock_indirect oauthlib-3.1.0/tests/oauth2/rfc6749/test_parameters.py
--- oauthlib-3.1.0/tests/oauth2/rfc6749/test_parameters.py.mock_indirect 2021-05-10 12:43:55.349919815 +0200
+++ oauthlib-3.1.0/tests/oauth2/rfc6749/test_parameters.py 2021-05-10 12:48:36.576783620 +0200
@@ -1,6 +1,6 @@
from __future__ import absolute_import, unicode_literals
-from mock import patch
+from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2.rfc6749.errors import *

View File

@ -1,26 +1,8 @@
%if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7)
%bcond_without python2
%bcond_without python3
%endif
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_with python2
%bcond_without python3
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py2_build: %global py2_build %{__python2} setup.py build --executable="%{__python2} -s" %{?*}}
%{!?py2_install: %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot} %{?*}}
%endif
%global modname oauthlib %global modname oauthlib
Name: python-oauthlib Name: python-oauthlib
Version: 3.0.2 Version: 3.1.0
Release: 10%{?dist} Release: 1%{?dist}
Summary: An implementation of the OAuth request-signing logic Summary: An implementation of the OAuth request-signing logic
License: BSD License: BSD
@ -34,6 +16,9 @@ URL: https://github.com/oauthlib/oauthlib
# the reason why the full URL was not used. # the reason why the full URL was not used.
#Source0: https://github.com/oauthlib/oauthlib/archive/v%{modname}-%{version}.tar.gz #Source0: https://github.com/oauthlib/oauthlib/archive/v%{modname}-%{version}.tar.gz
Source0: %{modname}-%{version}.tar.gz Source0: %{modname}-%{version}.tar.gz
Patch0001: nomock-indirect.patch
Patch0002: nomock-direct.patch
Patch0003: nomock-direct-core.patch
BuildArch: noarch BuildArch: noarch
@ -45,35 +30,6 @@ onto your favourite web framework. If you're a maintainer of such a
library, write a thin veneer on top of OAuthLib and get OAuth support for library, write a thin veneer on top of OAuthLib and get OAuth support for
very little effort. very little effort.
%if %{with python2}
%package -n python2-oauthlib
Summary: An implementation of the OAuth request-signing logic
%{?python_provide:%python_provide python2-oauthlib}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-nose
BuildRequires: python2-mock
BuildRequires: python2-blinker
BuildRequires: python2-jwt >= 1.6.0
BuildRequires: python2-cryptography >= 1.4.0
Requires: python2-jwt >= 1.6.0
Requires: python2-cryptography >= 1.4.0
%description -n python2-oauthlib
OAuthLib is a generic utility which implements the logic of OAuth without
assuming a specific HTTP request object or web framework. Use it to graft
OAuth client support onto your favorite HTTP library, or provider support
onto your favourite web framework. If you're a maintainer of such a
library, write a thin veneer on top of OAuthLib and get OAuth support for
very little effort.
%endif # with python2
%if %{with python3}
%package -n python3-oauthlib %package -n python3-oauthlib
Summary: An implementation of the OAuth request-signing logic Summary: An implementation of the OAuth request-signing logic
%{?python_provide:%python_provide python3-oauthlib} %{?python_provide:%python_provide python3-oauthlib}
@ -81,8 +37,6 @@ Summary: An implementation of the OAuth request-signing logic
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-mock
BuildRequires: python3-blinker BuildRequires: python3-blinker
BuildRequires: python3-jwt >= 1.6.0 BuildRequires: python3-jwt >= 1.6.0
@ -102,10 +56,11 @@ very little effort.
%{?python_extras_subpkg:%python_extras_subpkg -n python3-oauthlib -i %{python3_sitelib}/%{modname}-%{version}-*.egg-info signedtoken} %{?python_extras_subpkg:%python_extras_subpkg -n python3-oauthlib -i %{python3_sitelib}/%{modname}-%{version}-*.egg-info signedtoken}
%endif # with python3
%prep %prep
%setup -q -n %{modname}-%{version} %setup -q -n %{modname}-%{version}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
# python-unittest2 is now provided by "python" package and python-unittest is retired # python-unittest2 is now provided by "python" package and python-unittest is retired
# adapt setup.py to reflect this fact downstream # adapt setup.py to reflect this fact downstream
@ -115,46 +70,27 @@ sed -i "s/'unittest2', //" setup.py
rm -rf %{modname}.egg-info rm -rf %{modname}.egg-info
%build %build
%if %{with python2}
%py2_build
%endif # with python2
%if %{with python3}
%py3_build %py3_build
%endif # with python3
%install %install
%if %{with python2}
%py2_install
%endif # with python2
%if %{with python3}
%py3_install %py3_install
%endif # with python3
%check %check
%if %{with python2}
%{__python2} setup.py test
%endif # with python2
%if %{with python3}
%{__python3} setup.py test %{__python3} setup.py test
%endif # with python3
%if %{with python2}
%files -n python2-oauthlib
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*
%endif # with python2
%if %{with python3}
%files -n python3-oauthlib %files -n python3-oauthlib
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
%{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}-* %{python3_sitelib}/%{modname}-%{version}-*
%endif # with python3
%changelog %changelog
* Tue May 25 2021 Jakub Hrozek <jhrozek@redhat.com> - 3.1.0-1
- Resolves: rhbz#1922352 - python-oauthlib requires python-mock
- Update to upstream 3.1.0
- Gets rid of obsolete python-nose dependency
- Nuke the python2/python3 conditionals, let's only support python3
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.0.2-10 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.0.2-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937

View File

@ -1 +1 @@
SHA512 (oauthlib-3.0.2.tar.gz) = 7a91696d4fa753c2075449a9ca6122d49042ec4a318051f75c6c80b4b77caac17a91e7c4e861f6c1d697c5c80b91f7d4a0c95736cbe386857faad8467b161310 SHA512 (oauthlib-3.1.0.tar.gz) = 40c79204bc3588e4c654f27380e427478959b33887ce29ca6dcef212356a4aaf4f5035534612f11a15b724028b4331cc66c75c3a03d75306d0d1362c4519810a