Blob Blame History Raw
%global srcname nbformat
%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-%{srcname}
Version:        4.3.0
Release:        1%{?dist}
Summary:        The Jupyter Notebook format

License:        BSD
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://files.pythonhosted.org/packages/source/n/%{srcname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

%description
This package contains the base implementation of the Jupyter Notebook format,
and Python APIs for working with notebooks.


%package -n python2-nbformat
Summary:        The Jupyter Notebook format
BuildRequires:  python2-devel
# For tests
BuildRequires:  pytest
BuildRequires:  python-ipython_genutils
BuildRequires:  python-jsonschema
BuildRequires:  python-jupyter_core
BuildRequires:  python-traitlets
Requires:       python-ipython_genutils
Requires:       python-jsonschema
Requires:       python-jupyter_core
Requires:       python-traitlets
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-nbformat
This package contains the base implementation of the Jupyter Notebook format,
and Python APIs for working with notebooks.


%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{srcname}
Summary:        The Jupyter Notebook format
BuildRequires:  python%{python3_pkgversion}-devel
# For tests
BuildRequires:  python%{python3_pkgversion}-pytest
BuildRequires:  python%{python3_pkgversion}-ipython_genutils
BuildRequires:  python%{python3_pkgversion}-jsonschema
BuildRequires:  python%{python3_pkgversion}-jupyter_core
BuildRequires:  python%{python3_pkgversion}-traitlets
Requires:       python%{python3_pkgversion}-ipython_genutils
Requires:       python%{python3_pkgversion}-jsonschema
Requires:       python%{python3_pkgversion}-jupyter_core
Requires:       python%{python3_pkgversion}-traitlets
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python%{python3_pkgversion}-%{srcname}
This package contains the base implementation of the Jupyter Notebook format,
and Python APIs for working with notebooks.
%endif


%prep
%autosetup -p1 -n %{srcname}-%{version}


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif


%install
%if 0%{?with_python3}
%py3_install
%endif
%py2_install


%check
# test_sign.py needs testpath which isn't packaged yet
mv %{srcname}/tests/test_sign.py{,.fail}
py.test-%{python2_version} -v %{srcname}/tests/
%if 0%{?with_python3}
py.test-%{python3_version} -v %{srcname}/tests/
%endif

 
%files -n python2-nbformat
%doc README.md
%license COPYING.md
%if !0%{?with_python3}
%{_bindir}/jupyter-trust
%endif
%{python2_sitelib}/*

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{srcname}
%doc README.md
%license COPYING.md
%{_bindir}/jupyter-trust
%{python3_sitelib}/*
%endif


%changelog
* Wed Feb 22 2017 Orion Poplawski <orion@cora.nwra.com> - 4.3.0-1
- Update to 4.3.0

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 4.2.0-2
- Rebuild for Python 3.6

* Sat Dec 17 2016 Orion Poplawski <orion@cora.nwra.com> - 4.2.0-1
- Update to 4.2.0
- Modernize spec

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Jul 15 2015 Orion Poplawski <orion@cora.nwra.com> - 4.0.0-2
- Fixup BRs and EL7 build

* Mon Jul 13 2015 Orion Poplawski <orion@cora.nwra.com> - 4.0.0-1
- Initial package