File python-CherryPy.spec of Package python-CherryPy.13436

#
# spec file for package python-CherryPy
#
# Copyright (c) 2019 SUSE LLC
#
# 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-%{**}}
%define oldpython python
%bcond_without python2
Name:           python-CherryPy
Version:        10.2.1
Release:        0
Summary:        Object-Oriented HTTP framework
License:        BSD-3-Clause
Group:          Development/Languages/Python
URL:            http://www.cherrypy.org
Source:         https://files.pythonhosted.org/packages/source/C/CherryPy/CherryPy-%{version}.tar.gz
# PATCH-FIX-UPSTREAM compatibility_w_Python_fix.patch gh#cherrypy/cherrypy#1781 mcepl@suse.com
# make a test suite compatible with the more recent versions of Python
Patch0:         compatibility_w_Python_fix.patch
BuildRequires:  %{python_module setuptools_scm}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-cheroot >= 5.2.0
Requires:       python-portend >= 1.6.1
Requires:       python-six
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends:     python-Routes
Recommends:     python-flup
Recommends:     python-memcached >= 1.58
Recommends:     python-pyOpenSSL
Recommends:     python-simplejson
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  %{python_module cheroot >= 5.2.0}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module portend >= 1.6.1}
BuildRequires:  %{python_module pytest-runner}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module six}
%if %{with python2}
BuildRequires:  python2-backports.unittest_mock
%endif
# /SECTION
%ifpython2
Provides:       %{oldpython}-cherrypy = %{version}
Obsoletes:      %{oldpython}-cherrypy < %{version}
%endif
%python_subpackages

%description
CherryPy is a pythonic, object-oriented HTTP framework.

CherryPy allows developers to build web applications in much the same way they
would build any other object-oriented Python program. This usually results in
smaller source code developed in less time.

CherryPy is now more than three years old and it is has proven very fast and
stable. It is being used in production by many sites, from the simplest ones
to the most demanding ones.

Oh, and most importantly: CherryPy is fun to work with :-)

%prep
%setup -q -n CherryPy-%{version}
%autopatch -p1


%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/cherryd
%fdupes %{buildroot}%{_prefix}

%check
%pytest cherrypy/test -k 'not test_null_bytes'

%post
%python_install_alternative cherryd

%postun
%python_uninstall_alternative cherryd

%files %{python_files}
%license LICENSE.md
%doc README.rst CHANGES.rst
%python_alternative %{_bindir}/cherryd
%{python_sitelib}/cherrypy/
%{python_sitelib}/CherryPy-%{version}-py%{python_version}.egg-info

%changelog
openSUSE Build Service is sponsored by