File python-pyramid_mailer.spec of Package python-pyramid_mailer

#
# spec file for package python-pyramid_mailer
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 LISA GmbH, Bingen, 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 http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-pyramid_mailer
Version:        0.15.1
Release:        0
Summary:        Sendmail package for Pyramid
License:        BSD-4-Clause and ZPL-2.1 and MIT
Group:          Development/Languages/Python
URL:            http://docs.pylonsproject.org/projects/pyramid-mailer/en/latest/
Source:         https://files.pythonhosted.org/packages/source/p/pyramid_mailer/pyramid_mailer-%{version}.tar.gz
Source1:        https://docs.pylonsproject.org/projects/pyramid/en/latest/objects.inv
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pyramid} >= 1.4
BuildRequires:  %{python_module repoze.sendmail} >= 4.1
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module transaction}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
# SECTION testing requirements
BuildRequires:  %{python_module WebTest}
BuildRequires:  %{python_module coverage}
BuildRequires:  %{python_module hupper}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module plaster-pastedeploy}
BuildRequires:  %{python_module plaster}
# /SECTION
# SECTION Documentation requirements
BuildRequires:  python3-Sphinx
BuildRequires:  python3-pylons-sphinx-themes >= 0.3
BuildRequires:  python3-repoze.sphinx.autointerface
# /SECTION
Requires:       python-pyramid
Requires:       python-repoze.sendmail >= 4.1
Requires:       python-transaction
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%python_subpackages

%description
pyramid_mailer is a package for sending email from your Pyramid application.
It is compatible with Python 2.7, 3.3, 3.4, and 3.5, as well as PyPy.

This package includes:

1. Wrapping the low-level Python ``email`` library with an easy-to-use
   API, which includes attachments and mulipart content.

2. Send emails immediately or to add to a maildir queue.

3. Managing email sends inside a transaction, to prevent emails being sent
   if your code raises an exception.

4. Features to help with unit testing.

``pyramid_mailer`` uses the ``repoze.sendmail`` library for managing email
sending and transacton management, and borrows code (with permission) from
Zed Shaw's `lamson <https://github.com/zedshaw/lamson>`_  for wrapping email
messages.  See the ``LICENSE.txt`` file for more information.

%package -n %{name}-doc
Summary:        Documentation for Sendmail package for Pyramid
Group:          Development/Languages/Python
Requires:       %{name} = %{version}

%description -n %{name}-doc
This package contains the documentation for %{name}.

%prep
%setup -q -n pyramid_mailer-%{version}
cp %SOURCE1 docs/pyramid.inv
# patch conf.py to pick it up
sed -i 's|        None|"pyramid.inv"|' docs/conf.py

%build
%python_build
python3 setup.py build_sphinx && rm -f build/sphinx/html/.buildinfo

%install
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}

%check
%python_exec setup.py test

%files %python_files
%defattr(-,root,root,-)
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE.txt
%else
%doc LICENSE.txt
%endif
%doc CHANGES.rst README.rst
%{python_sitelib}/*

%files -n %{name}-doc
%defattr(-,root,root,-)
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE.txt
%else
%doc LICENSE.txt
%endif
%doc build/sphinx/html

%changelog
openSUSE Build Service is sponsored by