709d74b
%if 0%{?fedora} >= 30
709d74b
# disabled by default
709d74b
%bcond_with py2
709d74b
%else
709d74b
%bcond_without py2
709d74b
%endif
709d74b
709d74b
# Enabled by default
709d74b
%bcond_without tests
709d74b
709d74b
%global pypi_name pynwb
709d74b
709d74b
%global desc %{expand: \
709d74b
PyNWB is a Python package for working with NWB files. It provides a high-level
709d74b
API for efficiently working with Neurodata stored in the NWB format.
709d74b
https://pynwb.readthedocs.io/en/latest/}
709d74b
709d74b
Name:           python-%{pypi_name}
709d74b
Version:        0.6.1
709d74b
Release:        3%{?dist}
709d74b
Summary:        PyNWB is a Python package for working with NWB files
709d74b
License:        BSD
709d74b
URL:            https://github.com/NeurodataWithoutBorders/pynwb
709d74b
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
709d74b
BuildArch:      noarch
709d74b
709d74b
%{?python_enable_dependency_generator}
709d74b
709d74b
%description
709d74b
%{desc}
709d74b
709d74b
%if %{with py2}
709d74b
%package -n python2-%{pypi_name}
709d74b
Summary:        %{summary}
709d74b
709d74b
BuildRequires:  python2-devel
709d74b
BuildRequires:  python2-setuptools
709d74b
BuildRequires:  python2-certifi
709d74b
BuildRequires:  python2-chardet
709d74b
BuildRequires:  python2-h5py
709d74b
BuildRequires:  python2-idna
709d74b
BuildRequires:  python2-numpy
709d74b
BuildRequires:  python2-dateutil
709d74b
BuildRequires:  python2-requests
709d74b
BuildRequires:  python2-ruamel-yaml
709d74b
BuildRequires:  python2-six
709d74b
BuildRequires:  python2-urllib3
709d74b
BuildRequires:  python2-pandas
709d74b
BuildRequires:	python2-unittest2
709d74b
709d74b
%{?python_provide:%python_provide python2-%{pypi_name}}
709d74b
709d74b
%description -n python2-%{pypi_name}
709d74b
%{desc}
709d74b
%endif
709d74b
709d74b
%package -n python3-%{pypi_name}
709d74b
Summary:        %{summary}
709d74b
709d74b
BuildRequires:  python3-devel
709d74b
BuildRequires:  python3-setuptools
709d74b
BuildRequires:  python3-certifi
709d74b
BuildRequires:	python3-chardet
709d74b
BuildRequires:	python3-h5py
709d74b
BuildRequires:	python3-idna
709d74b
BuildRequires:	python3-numpy
709d74b
BuildRequires:	python3-dateutil
709d74b
BuildRequires:  python3-requests
709d74b
BuildRequires:	python3-ruamel-yaml
709d74b
BuildRequires:	python3-six
709d74b
BuildRequires:  python3-urllib3
709d74b
BUildRequires:  python3-pandas
709d74b
BuildRequires:  python3-unittest2
709d74b
709d74b
%{?python_provide:%python_provide python3-%{pypi_name}}
709d74b
709d74b
%description -n python3-%{pypi_name}
709d74b
%{desc}
709d74b
709d74b
%prep
709d74b
%autosetup -n %{pypi_name}-%{version}
709d74b
rm -rf %{pypi_name}.egg-info
709d74b
709d74b
# Multiple tests fail on this one file:
709d74b
# An issue should be filed upstream
709d74b
# get_build_manager should be get_manager
709d74b
# forms should be pynwb.forms
709d74b
# .. ?
709d74b
rm -f tests/build_fake_data.py
709d74b
709d74b
%build
709d74b
%py3_build
709d74b
%if %{with py2}
709d74b
%py2_build
709d74b
%endif
709d74b
709d74b
%install
709d74b
%if %{with py2}
709d74b
%py2_install
709d74b
%endif
709d74b
%py3_install
709d74b
 
709d74b
%check
709d74b
%if %{with tests}
709d74b
%if %{with py2}
709d74b
%{__python2} setup.py test
709d74b
%endif
709d74b
%{__python3} setup.py test
709d74b
%endif
709d74b
709d74b
%if %{with py2}
709d74b
%files -n python2-%{pypi_name}
709d74b
%license license.txt
709d74b
%doc README.rst
709d74b
%{python2_sitelib}/%{pypi_name}-%{version}-py2.?.egg-info
709d74b
%{python2_sitelib}/%{pypi_name}
709d74b
%endif 
709d74b
709d74b
%files -n python3-%{pypi_name}
709d74b
%license license.txt
709d74b
%doc README.rst
709d74b
%{python3_sitelib}/%{pypi_name}/
709d74b
%{python3_sitelib}/%{pypi_name}-*.egg-info
709d74b
709d74b
%changelog
709d74b
* Mon Nov 26 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.6.1-3
709d74b
- Add buildrequires 
709d74b
- Enable tests (thanks Ankur)
709d74b
709d74b
* Mon Nov 26 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.6.1-2
709d74b
- Fix comment 2 in BZ 1651365
709d74b
709d74b
* Mon Nov 26 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.6.1-1
709d74b
- New upstream