File python-django-allauth.spec of Package python-django-allauth

# spec file for package python-django-allauth
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-django-allauth
Version:        0.39.1
Release:        0
Summary:        Django authentication, registration, account management
License:        MIT
Group:          Development/Languages/Python
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-Django >= 1.11
Requires:       python-requests
Requires:       python-requests-oauthlib >= 0.3.0
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module Django >= 1.11}
BuildRequires:  %{python_module requests-oauthlib >= 0.3.0}
BuildRequires:  %{python_module requests}
BuildRequires:  python2-mock >= 1.0.1
BuildRequires:  python2-python-openid >= 2.2.5
BuildRequires:  python3-python3-openid >= 3.0.8
Requires:       python-python-openid >= 2.2.5
Requires:       python-python3-openid >= 3.0.8

%package lang
Summary:        Translations for package %{name}
Group:          System/Localization
Requires:       %{name} = %{version}
Provides:       %{name}-lang-all = %{version}
Supplements:    %{name}
BuildArch:      noarch

%description lang
Provides translations for the "%{name}" package.

Integrated set of Django applications addressing authentication, registration,
account management as well as 3rd party (social) account authentication.

%setup -q -n django-allauth-%{version}

# Five errors reported at

# Cern provider test module fails
rm allauth/socialaccount/providers/cern/

# 2 tests failing with KeyError: 'location' (not in response headers)
sed -i 's/test_login/_test_login/' allauth/socialaccount/providers/openid/


%find_lang django
%python_expand grep -F "%{$python_sitelib}" django.lang > django_%{$python_bin_suffix}.lang
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%python_expand django-admin-%{$python_bin_suffix} test --settings=test_settings

%files %{python_files}
%doc AUTHORS ChangeLog.rst README.rst
%license LICENSE
%exclude %{python_sitelib}/allauth/locale

%if %have_python2 && ! 0%{?skip_python2}
%files -n %{python2_prefix}-django-allauth-lang -f django_%{python2_bin_suffix}.lang
%license LICENSE

%if %have_python2 && ! 0%{?skip_python3}
%files -n %{python3_prefix}-django-allauth-lang -f django_%{python3_bin_suffix}.lang
%license LICENSE

openSUSE Build Service is sponsored by