File of Package

# spec file for package
# 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

%define skip_python3 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Version:        0.1.1
Release:        0
Summary:        Backport of Python 3's package
License:        Python-2.0
Group:          Development/Languages/Python
BuildRequires:  %{python_module setuptools_scm}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-backports.os
Requires:       python-future
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module backports.os}
BuildRequires:  %{python_module future}
BuildRequires:  python2-mock

Backport of Python 3's package.

%setup -q -n{version}


# belongs in 'python-backports' package
%python_expand rm %{buildroot}%{$python_sitelib}/backports/*.py*
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%{python_expand cp %{$python_sitelib}/backports/ %{$python_sitelib}/backports/ %{buildroot}%{$python_sitelib}/backports/
PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m unittest discover tests
rm %{buildroot}%{$python_sitelib}/backports/*.py*
rm -rf %{buildroot}%{$python_sitelib}/backports/__pycache__/

%files %{python_files}
%doc README.rst
%license LICENSE