diff --git a/oauth-no-appengine.patch b/oauth-no-appengine.patch new file mode 100644 index 0000000..df01fca --- /dev/null +++ b/oauth-no-appengine.patch @@ -0,0 +1,43 @@ +Index: google-auth-1.4.1/tests/test__oauth2client.py +=================================================================== +--- google-auth-1.4.1.orig/tests/test__oauth2client.py ++++ google-auth-1.4.1/tests/test__oauth2client.py +@@ -93,25 +93,6 @@ def mock_oauth2client_gae_imports(mock_n + mock_non_existent_module('webapp2') + + +-@mock.patch('google.auth.app_engine.app_identity') +-def test__convert_appengine_app_assertion_credentials( +- app_identity, mock_oauth2client_gae_imports): +- +- import oauth2client.contrib.appengine +- +- service_account_id = 'service_account_id' +- old_credentials = oauth2client.contrib.appengine.AppAssertionCredentials( +- scope='one two', service_account_id=service_account_id) +- +- new_credentials = ( +- _oauth2client._convert_appengine_app_assertion_credentials( +- old_credentials)) +- +- assert new_credentials.scopes == ['one', 'two'] +- assert (new_credentials._service_account_id == +- old_credentials.service_account_id) +- +- + class FakeCredentials(object): + pass + +@@ -143,12 +124,6 @@ def reset__oauth2client_module(): + reload_module(_oauth2client) + + +-def test_import_has_app_engine( +- mock_oauth2client_gae_imports, reset__oauth2client_module): +- reload_module(_oauth2client) +- assert _oauth2client._HAS_APPENGINE +- +- + def test_import_without_oauth2client(monkeypatch, reset__oauth2client_module): + monkeypatch.setitem(sys.modules, 'oauth2client', None) + with pytest.raises(ImportError) as excinfo: diff --git a/python-google-auth.changes b/python-google-auth.changes index aede9bb..8617b60 100644 --- a/python-google-auth.changes +++ b/python-google-auth.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue May 8 10:23:49 UTC 2018 - tchvatal@suse.com + +- Add patch to not check for oauth appengine which we disable in + openSUSE: + * oauth-no-appengine.patch + +------------------------------------------------------------------- +Mon May 7 13:56:36 UTC 2018 - tchvatal@suse.com + +- Fix fdupes call and run tests + ------------------------------------------------------------------- Mon May 7 12:58:39 UTC 2018 - adrian.glaubitz@suse.com diff --git a/python-google-auth.spec b/python-google-auth.spec index 694cd24..517ecd0 100644 --- a/python-google-auth.spec +++ b/python-google-auth.spec @@ -23,26 +23,40 @@ Release: 0 Summary: Google Authentication Library License: Apache-2.0 Group: Development/Languages/Python -Url: https://github.com/GoogleCloudPlatform/google-auth-library-python -Source: https://pypi.python.org/packages/83/f2/9dc87be31962a58c84e844c1f47d52a4e2811ba2e15253a036be3ae8acd8/google-auth-%{version}.tar.gz +URL: https://github.com/GoogleCloudPlatform/google-auth-library-python +Source: https://files.pythonhosted.org/packages/source/g/google-auth/google-auth-%{version}.tar.gz +Patch0: oauth-no-appengine.patch +BuildRequires: %{python_module Flask} BuildRequires: %{python_module cachetools} +BuildRequires: %{python_module cryptography} BuildRequires: %{python_module devel} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module oauth2client-gce} +BuildRequires: %{python_module oauth2client} BuildRequires: %{python_module pyasn1-modules} BuildRequires: %{python_module pyasn1} +BuildRequires: %{python_module pytest-localserver} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests} BuildRequires: %{python_module rsa} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +BuildRequires: %{python_module urllib3} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-Flask Requires: python-cachetools +Requires: python-cryptography +Requires: python-oauth2client +Requires: python-oauth2client-gce Requires: python-pyasn1 Requires: python-pyasn1-modules +Requires: python-requests Requires: python-rsa Requires: python-setuptools Requires: python-six -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: python-urllib3 BuildArch: noarch - %python_subpackages %description @@ -50,16 +64,21 @@ This library simplifies using Google’s various server-to-server authentication %prep %setup -q -n google-auth-%{version} +%patch0 -p1 %build %python_build %install %python_install -%fdupes %{buildroot}%{_prefix} +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%python_expand py.test-%{$python_bin_suffix} %files %{python_files} -%defattr(-,root,root,-) +%license LICENSE +%doc README.rst %{python_sitelib}/* %changelog