#4 Bump release to 4.2.0-1
Closed 2 years ago by cqi. Opened 2 years ago by cqi.

Bump release to 4.2.0-1
Chenxiong Qi • 2 years ago  
file modified
+1
@@ -2,3 +2,4 @@ 

  /social-auth-core-3.3.3.tar.gz

  /social-auth-core-4.0.2.tar.gz

  /social-auth-core-4.1.0.tar.gz

+ /social-auth-core-4.2.0.tar.gz

@@ -1,65 +0,0 @@ 

- From cfd4861795ac7cc2fa2d28382b1464d9c09a3aac Mon Sep 17 00:00:00 2001

- From: Chenxiong Qi <qcxhome@gmail.com>

- Date: Mon, 14 Jun 2021 11:25:47 +0800

- Subject: [PATCH 1/4] Fix issue 'Too many open files' for tests

- 

- The root problem is the HTTPretty is not reset properly.

- 

- I'm running Fedora 34, and `ulimit -n' reports 1024. This problem

- happens after around 58% of tests run.

- 

- HTTPretty opens temporary file for the internal FakeSocketFile, and all

- of such file descriptors are stored inside __internals__.temp_files.

- HTTPretty.reset must be called to release those fds as well as other

- internal used resources.

- 

- Meanwhile, HTTPretty provides a decorator httprettized, which also has

- the pattern to have the following pair of calls when exiting the context:

- 

-     httpretty.disable()

-     httpretty.reset()

- 

- This change ensures all the HTTPretty internal resources including the

- created temporary files are released after every test method.

- 

- Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

- ---

-  social_core/tests/backends/base.py    | 1 +

-  social_core/tests/backends/open_id.py | 2 +-

-  2 files changed, 2 insertions(+), 1 deletion(-)

- 

- diff --git a/social_core/tests/backends/base.py b/social_core/tests/backends/base.py

- index 040c5b88..fe2b7aa0 100644

- --- a/social_core/tests/backends/base.py

- +++ b/social_core/tests/backends/base.py

- @@ -42,6 +42,7 @@ class BaseBackendTest(unittest.TestCase):

-  

-      def tearDown(self):

-          HTTPretty.disable()

- +        HTTPretty.reset()

-          self.backend = None

-          self.strategy = None

-          self.name = None

- diff --git a/social_core/tests/backends/open_id.py b/social_core/tests/backends/open_id.py

- index b3698b9b..830e05a6 100644

- --- a/social_core/tests/backends/open_id.py

- +++ b/social_core/tests/backends/open_id.py

- @@ -13,7 +13,6 @@ from ..models import TestStorage, User, TestUserSocialAuth, \

-  from ..strategy import TestStrategy

-  from .base import BaseBackendTest

-  

- -

-  sys.path.insert(0, '..')

-  

-  

- @@ -69,6 +68,7 @@ class OpenIdTest(BaseBackendTest):

-          TestNonce.reset_cache()

-          TestAssociation.reset_cache()

-          HTTPretty.disable()

- +        HTTPretty.reset()

-  

-      def get_form_data(self, html):

-          parser = FormHTMLParser()

- -- 

- 2.31.1

- 

@@ -1,120 +0,0 @@ 

- From 98bc71cabf0b6677d391d99d82949b86bb8591a7 Mon Sep 17 00:00:00 2001

- From: Chenxiong Qi <qcxhome@gmail.com>

- Date: Mon, 14 Jun 2021 12:29:10 +0800

- Subject: [PATCH 2/4] Do not allow tests to connect network

- 

- By disabling the network connection, also fix some tests to add missed

- URI regisgration.

- 

- Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

- ---

-  social_core/tests/backends/base.py                   |  2 +-

-  social_core/tests/backends/open_id.py                |  2 +-

-  social_core/tests/backends/test_amazon.py            | 10 ++++++++++

-  social_core/tests/backends/test_github.py            |  4 ++++

-  social_core/tests/backends/test_github_enterprise.py |  5 +++++

-  social_core/tests/backends/test_yahoo.py             |  4 ++++

-  6 files changed, 25 insertions(+), 2 deletions(-)

- 

- diff --git a/social_core/tests/backends/base.py b/social_core/tests/backends/base.py

- index fe2b7aa0..daf4aa7b 100644

- --- a/social_core/tests/backends/base.py

- +++ b/social_core/tests/backends/base.py

- @@ -18,7 +18,7 @@ class BaseBackendTest(unittest.TestCase):

-      raw_complete_url = '/complete/{0}'

-  

-      def setUp(self):

- -        HTTPretty.enable()

- +        HTTPretty.enable(allow_net_connect=False)

-          Backend = module_member(self.backend_path)

-          self.strategy = TestStrategy(TestStorage)

-          self.backend = Backend(self.strategy, redirect_uri=self.complete_url)

- diff --git a/social_core/tests/backends/open_id.py b/social_core/tests/backends/open_id.py

- index 830e05a6..8a4efdf3 100644

- --- a/social_core/tests/backends/open_id.py

- +++ b/social_core/tests/backends/open_id.py

- @@ -44,7 +44,7 @@ class OpenIdTest(BaseBackendTest):

-      raw_complete_url = '/complete/{0}/'

-  

-      def setUp(self):

- -        HTTPretty.enable()

- +        HTTPretty.enable(allow_net_connect=False)

-          Backend = module_member(self.backend_path)

-          self.strategy = TestStrategy(TestStorage)

-          self.complete_url = self.raw_complete_url.format(Backend.name)

- diff --git a/social_core/tests/backends/test_amazon.py b/social_core/tests/backends/test_amazon.py

- index f78c4ea2..c1573b02 100644

- --- a/social_core/tests/backends/test_amazon.py

- +++ b/social_core/tests/backends/test_amazon.py

- @@ -1,5 +1,7 @@

-  import json

-  

- +from httpretty import HTTPretty

- +

-  from .oauth import OAuth2Test

-  

-  

- @@ -41,6 +43,14 @@ class AmazonOAuth2BrokenServerResponseTest(OAuth2Test):

-          }

-      })

-  

- +    def setUp(self):

- +        super().setUp()

- +        HTTPretty.register_uri(HTTPretty.GET,

- +                               'https://api.amazon.com/user/profile',

- +                               status=200,

- +                               body=self.user_data_body,

- +                               content_type='application/json')

- +

-      def test_login(self):

-          self.do_login()

-  

- diff --git a/social_core/tests/backends/test_github.py b/social_core/tests/backends/test_github.py

- index 53009f69..eb06b5fe 100644

- --- a/social_core/tests/backends/test_github.py

- +++ b/social_core/tests/backends/test_github.py

- @@ -104,6 +104,10 @@ class GithubOAuth2NoEmailTest(GithubOAuth2Test):

-          self.do_login()

-  

-      def test_partial_pipeline(self):

- +        url = 'https://api.github.com/user/emails'

- +        HTTPretty.register_uri(HTTPretty.GET, url, status=200,

- +                               body=json.dumps([{'email': 'foo@bar.com'}]),

- +                               content_type='application/json')

-          self.do_partial_pipeline()

-  

-  

- diff --git a/social_core/tests/backends/test_github_enterprise.py b/social_core/tests/backends/test_github_enterprise.py

- index 12f67997..6196558f 100644

- --- a/social_core/tests/backends/test_github_enterprise.py

- +++ b/social_core/tests/backends/test_github_enterprise.py

- @@ -124,6 +124,11 @@ class GithubEnterpriseOAuth2NoEmailTest(GithubEnterpriseOAuth2Test):

-              'SOCIAL_AUTH_GITHUB_ENTERPRISE_URL': 'https://www.example.com'})

-          self.strategy.set_settings({

-              'SOCIAL_AUTH_GITHUB_ENTERPRISE_API_URL': 'https://www.example.com/api/v3'})

- +        HTTPretty.register_uri(HTTPretty.GET,

- +                               'https://www.example.com/api/v3/user/emails',

- +                               status=200,

- +                               body=json.dumps([{'email': 'foo@bar.com'}]),

- +                               content_type='application/json')

-          self.do_partial_pipeline()

-  

-  

- diff --git a/social_core/tests/backends/test_yahoo.py b/social_core/tests/backends/test_yahoo.py

- index cd7c3778..96cad929 100644

- --- a/social_core/tests/backends/test_yahoo.py

- +++ b/social_core/tests/backends/test_yahoo.py

- @@ -67,6 +67,10 @@ class YahooOAuth1Test(OAuth1Test):

-          self.do_login()

-  

-      def test_partial_pipeline(self):

- +        HTTPretty.register_uri(HTTPretty.GET,

- +                               'https://social.yahooapis.com/v1/me/guid?format=json',

- +                               status=200,

- +                               body=self.guid_body)

-          self.do_partial_pipeline()

-  

-      def test_get_user_details(self):

- -- 

- 2.31.1

- 

@@ -1,28 +0,0 @@ 

- From 99ed1bd184fe9ef2027d96ac1a4ef235fa08bdee Mon Sep 17 00:00:00 2001

- From: Chenxiong Qi <qcxhome@gmail.com>

- Date: Mon, 14 Jun 2021 12:33:35 +0800

- Subject: [PATCH 3/4] Use utcnow for JANRAIN_NONCE

- 

- The OpenIdStore.useNonce uses non-local time.

- 

- Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

- ---

-  social_core/tests/backends/test_livejournal.py | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/social_core/tests/backends/test_livejournal.py b/social_core/tests/backends/test_livejournal.py

- index 33859a54..30d1f661 100644

- --- a/social_core/tests/backends/test_livejournal.py

- +++ b/social_core/tests/backends/test_livejournal.py

- @@ -8,7 +8,7 @@ from ...exceptions import AuthMissingParameter

-  from .open_id import OpenIdTest

-  

-  

- -JANRAIN_NONCE = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')

- +JANRAIN_NONCE = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')

-  

-  

-  class LiveJournalOpenIdTest(OpenIdTest):

- -- 

- 2.31.1

- 

@@ -1,29 +0,0 @@ 

- From 6e4383a667d7a23df22e765cc72b935db5e2929c Mon Sep 17 00:00:00 2001

- From: Chenxiong Qi <qcxhome@gmail.com>

- Date: Mon, 14 Jun 2021 12:36:21 +0800

- Subject: [PATCH 4/4] Fix wrong HTTP method for Xrds request in test

- 

- The https://accounts.ngpvan.com/Home/Xrds accepts GET but POST was set

- in the test.

- 

- Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>

- ---

-  social_core/tests/backends/test_ngpvan.py | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/social_core/tests/backends/test_ngpvan.py b/social_core/tests/backends/test_ngpvan.py

- index e5f58bbc..50e940e9 100644

- --- a/social_core/tests/backends/test_ngpvan.py

- +++ b/social_core/tests/backends/test_ngpvan.py

- @@ -87,7 +87,7 @@ class NGPVANActionIDOpenIDTest(OpenIdTest):

-  

-          # Mock out the NGP VAN endpoints

-          HTTPretty.register_uri(

- -            HTTPretty.POST,

- +            HTTPretty.GET,

-              'https://accounts.ngpvan.com/Home/Xrds',

-              status=200,

-              body=self.discovery_body

- -- 

- 2.31.1

- 

@@ -1,26 +0,0 @@ 

- --- social_core/tests/backends/test_livejournal.py.orig 2020-07-18 09:42:43.906804958 +0800

- +++ social_core/tests/backends/test_livejournal.py      2020-07-18 09:44:38.426901387 +0800

- @@ -8,6 +8,8 @@

-  

-  from .open_id import OpenIdTest

-  

- +import unittest

- +

-  

-  JANRAIN_NONCE = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')

-  

- @@ -82,12 +84,14 @@

-              body=self.discovery_body

-          )

-  

- +    @unittest.skip('For building Fedora package since tihs test accesses real google service.')

-      def test_login(self):

-          self.strategy.set_request_data({'openid_lj_user': 'foobar'},

-                                         self.backend)

-          self._setup_handlers()

-          self.do_login()

-  

- +    @unittest.skip('For building Fedora package since tihs test accesses real google service.')

-      def test_partial_pipeline(self):

-          self.strategy.set_request_data({'openid_lj_user': 'foobar'},

-                                         self.backend)

file modified
+6 -9
@@ -19,25 +19,19 @@ 

  responsibilities and improve reusability.

  

  Documentation: https://python-social-auth.readthedocs.io/en/latest/

- Release notes: https://github.com/python-social-auth/%{module_name}/releases/tag/4.1.0

+ Release notes: https://github.com/python-social-auth/%{module_name}/releases/tag/4.2.0

  }

  

  %global summary Python Social Auth is an easy to setup social authentication\/registration mechanism with support for several frameworks and auth providers.

  

  Name:           python-%{pypi_name}

- Version:        4.1.0

- Release:        4%{?dist}

+ Version:        4.2.0

+ Release:        1%{?dist}

  Summary:        %{summary}

  License:        BSD

  URL:            https://github.com/python-social-auth/social-core/

  Source0:        %{pypi_source}

  

- # Remove this patch when fixed in upstream

- Patch1:         0001-Fix-issue-Too-many-open-files-for-tests.patch

- Patch2:         0002-Do-not-allow-tests-to-connect-network.patch

- Patch3:         0003-Use-utcnow-for-JANRAIN_NONCE.patch

- Patch4:         0004-Fix-wrong-HTTP-method-for-Xrds-request-in-test.patch

- 

  BuildArch:      noarch

  BuildRequires:  python3-devel

  BuildRequires:  python3dist(setuptools)
@@ -136,6 +130,9 @@ 

  %ghost %{python3_sitelib}/*.egg-info

  

  %changelog

+ * Fri Jan 21 2022 Chenxiong Qi <qcxhome@gmail.com> - 4.2.0-1

+ - Bump release to 4.2.0-1

+ 

  * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (social-auth-core-4.1.0.tar.gz) = 8322c982b4ebc867b2690289a6c6448ea5f4ef6603d317ba4e72a080b36a6c848c783008947651c5ffef791ec7b103e991ad799b8c1172a468eb15377831a445

+ SHA512 (social-auth-core-4.2.0.tar.gz) = a112752847fc9c46ca21706adf3a597d987ac310247ec5dad88c0e4ee9d2ac3ace4531a02b46acfa29ea6374112a151e0d4f912b84e2985db9b72d1871eecade