A new user interface for you! Read more...

File python-six.spec of Package python-six

#
# spec file for package python-six
#
# Copyright (c) 2018 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 https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# This is not only because of dependency of testsuite, but mostly
# because of cyclical dependencies between six and Sphinx.
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define test 1
%bcond_without test
%else
%bcond_with test
%endif
%if %{with test}
Name:           python-six-%{flavor}
%else
Name:           python-six
%endif
Version:        1.12.0
Release:        0
Summary:        Python 2 and 3 compatibility utilities
License:        MIT
Group:          Development/Libraries/Python
URL:            http://pypi.python.org/pypi/six/
Source:         https://files.pythonhosted.org/packages/source/s/six/six-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python2
BuildRequires:  python3
%if %{with test}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module py}
BuildRequires:  python3-Sphinx
%endif
BuildArch:      noarch
%python_subpackages

%description
Six is a Python 2 and 3 compatibility library. It provides utility
functions for smoothing over the differences between the Python
versions with the goal of writing Python code that is compatible on
both Python versions. See the documentation for more information on
what is provided.

%package -n python-six-doc
Provides:       %{python_module six-doc = %{version}}
Summary:        Documentation files for %name
Group:          Documentation/HTML

%description -n python-six-doc
Six is a Python 2 and 3 compatibility library. It provides utility
functions for smoothing over the differences between the Python
versions with the goal of writing Python code that is compatible on
both Python versions.

This package provides documentation for %{name}.


%prep
%setup -q -n six-%{version}

%build
%if ! %{with test}
%python_build
%else
cd documentation && make html && rm _build/html/.buildinfo
%endif

%install
%if ! %{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif

%check
%if %{with test}
mkdir test
cp test_six.py test
pushd test
%python_exec %{_bindir}/py.test test_six.py
popd
rm -rf test
%endif

%pretrans
# bsc#1057496 - egg-info changed from directory to file
if [ -d %{python_sitelib}/six-*-py%{python_version}.egg-info ]; then
    rm -rf %{python_sitelib}/six-*-py%{python_version}.egg-info
fi

%files %{python_files}
%license LICENSE
%doc README.rst CHANGES
%if %{with test}
%doc documentation/_build/html
%else
%{python_sitelib}/six.py*
%pycache_only %{python3_sitelib}/__pycache__/*
%{python_sitelib}/six-%{version}-py*.egg-info
%endif

%changelog