Blob Blame Raw
%if 0%{?fedora} >= 30
# disabled by default
%bcond_with py2
%bcond_without py2

# Enabled by default
%bcond_without tests

%global pypi_name pynwb

%global desc %{expand: \
PyNWB is a Python package for working with NWB files. It provides a high-level
API for efficiently working with Neurodata stored in the NWB format.}

Name:           python-%{pypi_name}
Version:        0.6.1
Release:        3%{?dist}
Summary:        PyNWB is a Python package for working with NWB files
License:        BSD
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch



%if %{with py2}
%package -n python2-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-certifi
BuildRequires:  python2-chardet
BuildRequires:  python2-h5py
BuildRequires:  python2-idna
BuildRequires:  python2-numpy
BuildRequires:  python2-dateutil
BuildRequires:  python2-requests
BuildRequires:  python2-ruamel-yaml
BuildRequires:  python2-six
BuildRequires:  python2-urllib3
BuildRequires:  python2-pandas
BuildRequires:	python2-unittest2

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}

%package -n python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-certifi
BuildRequires:	python3-chardet
BuildRequires:	python3-h5py
BuildRequires:	python3-idna
BuildRequires:	python3-numpy
BuildRequires:	python3-dateutil
BuildRequires:  python3-requests
BuildRequires:	python3-ruamel-yaml
BuildRequires:	python3-six
BuildRequires:  python3-urllib3
BUildRequires:  python3-pandas
BuildRequires:  python3-unittest2

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}

%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info

# Multiple tests fail on this one file:
# An issue should be filed upstream
# get_build_manager should be get_manager
# forms should be pynwb.forms
# .. ?
rm -f tests/

%if %{with py2}

%if %{with py2}
%if %{with tests}
%if %{with py2}
%{__python2} test
%{__python3} test

%if %{with py2}
%files -n python2-%{pypi_name}
%license license.txt
%doc README.rst

%files -n python3-%{pypi_name}
%license license.txt
%doc README.rst

* Mon Nov 26 2018 Luis Bazan <> - 0.6.1-3
- Add buildrequires 
- Enable tests (thanks Ankur)

* Mon Nov 26 2018 Luis Bazan <> - 0.6.1-2
- Fix comment 2 in BZ 1651365

* Mon Nov 26 2018 Luis Bazan <> - 0.6.1-1
- New upstream