Blob Blame History Raw
# Multiple tests currently failing.
# Temporarily disabling tests
# https://github.com/SmokinCaterpillar/pypet/issues/63
%bcond tests 0

%global _description %{expand:
The new python parameter exploration toolkit: pypet manages exploration of the
parameter space of any numerical simulation in python, thereby storing your
data into HDF5 files for you. Moreover, pypet offers a new data container which
lets you access all your parameters and results from a single source. Data I/O
of your simulations and analyses becomes a piece of cake!}

Name:           python-pypet
Version:        0.5.2
Release:        %autorelease
Summary:        Parameter exploration toolbox

License:        BSD
URL:            https://github.com/SmokinCaterpillar/pypet
Source:         %{url}/archive/%{version}/pypet-%{version}.tar.gz

BuildArch:      noarch

%description %_description

%package -n python3-pypet
Summary:        %{summary}
BuildRequires:  make
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist setuptools}
BuildRequires:  google-benchmark-devel
# For tests
%if %{with tests}
BuildRequires:  %{py3_dist brian2}
BuildRequires:  %{py3_dist deap}
BuildRequires:  hdf5
BuildRequires:  %{py3_dist matplotlib}
BuildRequires:  %{py3_dist numpy}
BuildRequires:  %{py3_dist pandas}
BuildRequires:  %{py3_dist scipy}
BuildRequires:  %{py3_dist tables}
%endif

# For documentation
BuildRequires:  %{py3_dist sphinx}
BuildRequires:  tex(anyfontsize.sty)
BuildRequires:  tex(amsthm.sty)
BuildRequires:  /usr/bin/dvipng

%description -n python3-pypet %_description

%package doc
Summary:        %{summary}

%description doc
Documentation for %{name}.

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

# Remove gitignore files
rm -fv  examples/{,example_17_wrapping_an_existing_project,example_24_large_scale_brian2_simulation}/.gitignore

%build
%py3_build

make -C doc SPHINXBUILD=sphinx-build-3 html
rm -rf doc/build/html/{.doctrees,.buildinfo} -vf

%install
%py3_install

%check
# https://github.com/SmokinCaterpillar/pypet/blob/develop/ciscripts/travis/runtests.sh
# Scoop is unmaintained. I've asked upstream to drop support for it:
# https://github.com/SmokinCaterpillar/pypet/issues/56
%if %{with tests}
export HDF5_DISABLE_VERSION_CHECK=1
# Memory issues on s390x: OverflowError: Python int too large to convert to C int
%if "%{_host_cpu}" == "s390x"
echo "Skip tests on s390x"
%else
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} pypet/tests/all_single_core_tests.py
%endif
%endif

%files -n python3-pypet
%license LICENSE
%doc README.md
%{python3_sitelib}/pypet-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/pypet

%files doc
%license LICENSE CHANGES.txt
%doc doc/build/html examples/

%changelog
%autochangelog