1057da6
%global modname marshmallow
1057da6
%global _docdir_fmt %{name}
1057da6
1057da6
Name:           python-%{modname}
1057da6
Version:        2.8.0
1057da6
Release:        1%{?dist}
4326bfd
Summary:        Python library for converting complex datatypes to and from primitive types
4326bfd
License:        MIT
4326bfd
URL:            http://marshmallow.readthedocs.org/
4326bfd
# Using Github instead of PyPI because the PyPI tarballs don't include tests, 
4326bfd
# docs, or examples, and upstream does not want to change that.
4326bfd
# https://github.com/marshmallow-code/marshmallow/issues/201
1057da6
Source0:        https://github.com/marshmallow-code/marshmallow/archive/%{version}/%{modname}-%{version}.tar.gz
1057da6
4326bfd
BuildArch:      noarch
1057da6
1057da6
%global _description \
1057da6
Marshmallow is a framework-agnostic library for converting complex datatypes,\
1057da6
such as objects, to and from primitive Python datatypes.\
1057da6
\
1057da6
Marshmallow schemas can be used to:\
1057da6
* Validate input data.\
1057da6
* Deserialize input data to app-level objects.\
1057da6
* Serialize app-level objects to primitive Python types. The serialized objects\
1057da6
  can then be rendered to standard formats such as JSON for use in an HTTP API.
1057da6
1057da6
%description %{_description}
1057da6
1057da6
%package doc
1057da6
Summary:        Documentation for %{name}
1057da6
Obsoletes:      python3-%{modname}-doc < 2.8.0-1
1057da6
BuildRequires:  /usr/bin/sphinx-build
1057da6
1057da6
%description doc
1057da6
Documentation for %{name}.
1057da6
1057da6
%package -n python2-%{modname}
1057da6
Summary:        %{summary}
1057da6
%{?python_provide:%python_provide python2-%{modname}}
4326bfd
BuildRequires:  python2-devel
1057da6
BuildRequires:  python2-setuptools
4326bfd
# for tests
1057da6
BuildRequires:  python2-pytest
1057da6
BuildRequires:  python2-pytz
4326bfd
BuildRequires:  python-ordered-set
1057da6
BuildRequires:  python2-dateutil
336fe9a
BuildRequires:  python-simplejson
1057da6
Requires:       python-ordered-set
1057da6
Recommends:     python2-dateutil
1057da6
Recommends:     python-simplejson
1057da6
1057da6
%description -n python2-%{modname} %{_description}
1057da6
1057da6
Python 2 version.
1057da6
1057da6
%package -n python3-%{modname}
1057da6
Summary:        %{summary}
1057da6
%{?python_provide:%python_provide python3-%{modname}}
4326bfd
BuildRequires:  python3-devel
4326bfd
BuildRequires:  python3-setuptools
4326bfd
# for tests
4326bfd
BuildRequires:  python3-pytest
4326bfd
BuildRequires:  python3-pytz
4326bfd
BuildRequires:  python3-ordered-set
1057da6
BuildRequires:  python3-dateutil
336fe9a
BuildRequires:  python3-simplejson
4326bfd
Requires:       python3-ordered-set
1057da6
Recommends:     python3-dateutil
1057da6
Recommends:     python3-simplejson
4326bfd
1057da6
%description -n python3-%{modname} %{_description}
4326bfd
1057da6
Python 3 version.
4326bfd
4326bfd
%prep
1057da6
%autosetup -n %{modname}-%{version}
4326bfd
4326bfd
# remove bundled library
4326bfd
# instead of orderedsett we patch code to usu python-ordered-set
4326bfd
# ordereddict.py is used only for compatibility with python2.6,
4326bfd
# which we do not need
4326bfd
rm -f ./marshmallow/ordereddict.py ./marshmallow/orderedset.py
1057da6
sed -i -e "s/from marshmallow.orderedset/from ordered_set/g" %{modname}/schema.py
4326bfd
1057da6
# Drop support for sphinx-issues as it's not yet packaged
1057da6
sed -i -e "/sphinx_issues/d" docs/conf.py
4326bfd
4326bfd
%build
4326bfd
%py2_build
4326bfd
%py3_build
1057da6
sphinx-build -b html docs html
4326bfd
4326bfd
%install
4326bfd
%py2_install
4326bfd
%py3_install
1057da6
rm -rf html/{.buildinfo,.doctrees}
4326bfd
4326bfd
%check
1057da6
py.test-%{python2_version} -v
1057da6
py.test-%{python3_version} -v
4326bfd
4326bfd
%files doc
4326bfd
%license LICENSE
1057da6
%doc html examples
1057da6
1057da6
%files -n python2-%{modname}
4326bfd
%license LICENSE
1057da6
%doc CHANGELOG.rst README.rst
1057da6
%{python2_sitelib}/%{modname}/
1057da6
%{python2_sitelib}/%{modname}-*.egg-info/
4326bfd
1057da6
%files -n python3-%{modname}
4326bfd
%license LICENSE
1057da6
%doc CHANGELOG.rst README.rst
1057da6
%{python3_sitelib}/%{modname}/
1057da6
%{python3_sitelib}/%{modname}-*.egg-info/
4326bfd
4326bfd
%changelog
1057da6
* Wed Jul 06 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 2.8.0-1
1057da6
- Update to 2.8.0
1057da6
- Add recommends
1057da6
- Modernize spec
1057da6
989c952
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-0.3.gitea1def9
989c952
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
989c952
336fe9a
* Wed Nov 18 2015 Miroslav Suchý <msuchy@redhat.com> 2.2.1-0.2.gitea1def9
336fe9a
- add BR simplejson
336fe9a
- add BR python-tox
336fe9a
b48e7f2
* Wed Nov 18 2015 Miroslav Suchý <msuchy@redhat.com> 2.2.1-0.1.gitea1def9
b48e7f2
- rebase to 2.2.1
b48e7f2
b48e7f2
* Wed Nov 18 2015 Miroslav Suchý <miroslav@suchy.cz> 2.2.1-0.0.gitea1def9
b48e7f2
- rebase to 2.2.1
5e909d3
4326bfd
* Fri Sep 11 2015 Miroslav Suchý <miroslav@suchy.cz> 2.0.0-0.6.gita8b3385
4326bfd
- 1219288 - fix ownership of docdir and use correct release number
4326bfd
4326bfd
* Fri Sep 11 2015 Miroslav Suchý <msuchy@redhat.com> 2.0.0-0.5.a8b3385
4326bfd
- add short git hash to release number
4326bfd
4326bfd
* Fri Sep 11 2015 Miroslav Suchý <msuchy@redhat.com> 2.0.0b5-4
4326bfd
- create -doc subpackages
4326bfd
- 1219288 - reorganize spec file
4326bfd
4326bfd
* Mon Sep 07 2015 Miroslav Suchý <msuchy@redhat.com> 2.0.0b5-3
4326bfd
- explicitely list docdir
4326bfd
4326bfd
* Mon Sep 07 2015 Miroslav Suchý <msuchy@redhat.com> 2.0.0b5-2
4326bfd
- unbundle ordereddict and ordered set
4326bfd
- add documentation
4326bfd
4326bfd
* Mon Aug 24 2015 Valentin Gologuzov <vgologuz@redhat.com> - 2.0.0b5-1
4326bfd
- Rebuild with the newest upstream version
4326bfd
4326bfd
* Thu May 07 2015 Dan Callaghan <dcallagh@redhat.com> - 1.2.6-1
4326bfd
- initial version