From 92f01a0581b48c680051c248fc2ccf1dcc876891 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: May 13 2020 17:43:37 +0000 Subject: Enable tests and correct other bits --- diff --git a/python-lfpy.spec b/python-lfpy.spec index 3d54ebd..c1e4bc7 100644 --- a/python-lfpy.spec +++ b/python-lfpy.spec @@ -1,5 +1,5 @@ %global pypi_name lfpy -%global pypi_source LFPy +%global pretty_name LFPy %global desc %{expand: \ LFPy is a Python-module for calculation of extracellular potentials from @@ -9,58 +9,63 @@ classes for setting up your model, running your simulations and calculating the extracellular potentials arising from activity in your model neuron. If you have a model...} -%global py_version python3- -%global py_dist python3dist - - Name: python-lfpy Version: 2.0.7 -Release: 2%{?dist} -Summary: module for extracellular potentials of multicompartment neuron models on NEURON +Release: 3%{?dist} +Summary: Model extracellular potentials of multicompartment neuron models built on NEURON License: GPLv3 URL: http://LFPy.readthedocs.io -Source0: https://files.pythonhosted.org/packages/source/L/%{pypi_source}/%{pypi_source}-%{version}.tar.gz +Source0: %{pypi_source %pretty_name} +# Requires NEURON, so limited to arches that NEURON supports +ExcludeArch: %{arm} mips64r2 mips32r2 s390 s390x %?python_enable_dependency_generator BuildRequires: gcc -BuildRequires: %{py_version}devel -BuildRequires: %{py_dist}(cython) -BuildRequires: %{py_dist}(h5py) -BuildRequires: %{py_version}mpi4py-mpich -BuildRequires: %{py_dist}(nose) -BuildRequires: %{py_dist}(numpy) -BuildRequires: %{py_dist}(scipy) -BuildRequires: %{py_dist}(setuptools) -BuildRequires: %{py_version}mpi4py-openmpi -BuildRequires: mpi4py-common - +BuildRequires: libtool +BuildRequires: readline-devel +BuildRequires: ncurses-devel +BuildRequires: python3-devel +BuildRequires: %{py3_dist cython} +BuildRequires: %{py3_dist h5py} +BuildRequires: %{py3_dist neuron} +BuildRequires: neuron-devel +BuildRequires: %{py3_dist pytest} +BuildRequires: %{py3_dist numpy} +BuildRequires: %{py3_dist scipy} +BuildRequires: %{py3_dist setuptools} + +BuildRequires: python3-mpi4py-openmpi +BuildRequires: python3-mpi4py-mpich +BuildRequires: mpich-devel +BuildRequires: openmpi-devel +BuildRequires: rpm-mpi-hooks %description %{desc} -%package -n %{py_version}%{pypi_name} +%package -n python3-%{pypi_name} Summary: %{summary} -%{?python_provide:%python_provide %{py_version}%{pypi_name}} -Requires: %{py_dist}(h5py) -Requires: %{py_version}mpi4py-mpich -Requires: %{py_version}mpi4py-openmpi -Requires: %{py_dist}(nose) -Requires: %{py_dist}(numpy) -Requires: %{py_dist}(scipy) - -%description -n %{py_version}%{pypi_name} +%description -n python3-%{pypi_name} %{desc} +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: %{py3_dist h5py} +Requires: %{py3_dist numpy} +Requires: %{py3_dist scipy} +Requires: %{py3_dist neuron} +Requires: python3-mpi4py-openmpi +Requires: python3-mpi4py-mpich %prep -%autosetup -n %{pypi_source}-%{version} +%autosetup -n %{pretty_name}-%{version} # Remove bundled egg-info -rm -rf %{pypi_source}.egg-info +rm -rf %{pretty_name}.egg-info # Remove mpi4py from requirements sed -i '/mpi4py/ d' setup.py @@ -78,18 +83,37 @@ done %py3_install -# https://github.com/LFPy/LFPy/issues/139 -# %check -# %{__python3} setup.py test +%check +# https://github.com/LFPy/LFPy/blob/master/continuous_integration/test_script.sh#L16 +%{_mpich_load} +pytest-%{python3_version} LFPy/test/test*py +%{_mpich_unload} +%{_openmpi_load} +pytest-%{python3_version} LFPy/test/test*py +%{_openmpi_unload} -%files -n %{py_version}%{pypi_name} + +# Remove unneeded test files: they include objects and libraries generated from neuron. +rm -rf %{buildroot}/%{python3_sitearch}/%{pretty_name}/test/ +# Remove associated debuginfo files +rm -rf %{buildroot}/usr/lib/debug/%{python3_sitearch}/%{pretty_name}/test/ + + +%files -n python3-%{pypi_name} %license LICENSE %doc README.md -%{python3_sitearch}/%{pypi_source} -%{python3_sitearch}/%{pypi_source}-%{version}-py?.?.egg-info +%{python3_sitearch}/%{pretty_name} +%{python3_sitearch}/%{pretty_name}-%{version}-py%{python3_version}.egg-info %changelog +* Wed May 13 2020 Ankur Sinha - 2.0.7-3 +- Cosmetic changes to spec +- Add missing Requires/BR on neuron +- Enable test +- List supported arches +- Remove unneeded test files + * Wed May 13 2020 Ankur Sinha - 2.0.7-2 - Remove auto-generated mpi4py requires, we use explicitly mention the necessary packages in Requires