Blame python-neatdend.spec

08daab2
Name:       python-neatdend
08daab2
Version:    0.9.2
08daab2
Release:    %autorelease
08daab2
Summary:    NEAT (NEural Analysis Toolkit)
08daab2
08daab2
License:    GPLv3
08daab2
URL:        https://github.com/unibe-cns/NEAT
08daab2
Source0:    %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
08daab2
# Patches: https://github.com/sanjayankur31/NEAT/tree/fedora-v0.9.2
08daab2
# Support all arches for Neuron libs
08daab2
# issue filed: https://github.com/unibe-cns/NEAT/issues/142
08daab2
Patch0:     0001-feat-support-all-arches.patch
c3bb49d
Patch1:	    https://github.com/unibe-cns/NEAT/commit/504b39822b9913e5a8c6aff65df840cc2e31167d.patch	    
d356e5d
# Fix compatibility with recent Matplotlib
d356e5d
Patch2:     https://github.com/unibe-cns/NEAT/commit/8eb1f4be85da0c8fdbcbac627c5198a67e29b22c.patch
08daab2
08daab2
BuildRequires:  python3-devel
08daab2
BuildRequires:  python3-pytest
08daab2
BuildRequires:  gcc gcc-c++
08daab2
BuildRequires:  git-core
08daab2
BuildRequires:  python3-neuron
08daab2
BuildRequires:  neuron-devel
08daab2
1b308d1
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
1b308d1
ExcludeArch:    %{ix86}
1b308d1
08daab2
%global _description %{expand:
08daab2
NEAT is a python library for the study,
08daab2
simulation and simplification of morphological neuron models.}
08daab2
08daab2
%description %_description
08daab2
08daab2
%package -n python3-neatdend
08daab2
Summary:        %{summary}
08daab2
08daab2
%description -n python3-neatdend %_description
08daab2
08daab2
08daab2
%prep
08daab2
%autosetup -n NEAT-%{version} -S git
08daab2
08daab2
sed -i 's/^numpy~=1.20.2/numpy>=1.20.2/' requirements/requirements.txt
08daab2
sed -i 's/^matplotlib~=3.4.1/matplotlib>=3.4.1/' requirements/requirements.txt
08daab2
sed -i 's/^pytest~=5.3.2/pytest>=5.3.2/' requirements/requirements.txt
08daab2
sed -i 's/^scikit_learn~=0.24.2/scikit_learn>=0.24.2/' requirements/requirements.txt
08daab2
sed -i 's/^scipy~=1.6.3/scipy>=1.6.3/' requirements/requirements.txt
08daab2
sed -i 's/^sympy~=1.7.1/sympy>=1.7.1/' requirements/requirements.txt
08daab2
08daab2
%generate_buildrequires
08daab2
%pyproject_buildrequires -r
08daab2
08daab2
08daab2
%build
08daab2
%pyproject_wheel
08daab2
08daab2
08daab2
%install
08daab2
%pyproject_install
08daab2
%pyproject_save_files neat
08daab2
08daab2
%check
08daab2
# a few tests fail on i686.
08daab2
# Upstream report: https://github.com/unibe-cns/NEAT/issues/142#issuecomment-1107874903
08daab2
%ifnarch %{ix86}
08daab2
# we need to run these in a different directory to ensure that the module isn't
08daab2
# imported from the source directory
08daab2
mkdir testdir && pushd testdir
08daab2
# Python path must be defined so that compilechannels uses the installed module
08daab2
PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib}:$RPM_BUILD_ROOT/%{python3_sitearch} $RPM_BUILD_ROOT/%{_bindir}/compilechannels default
08daab2
%pytest ../
08daab2
popd
08daab2
%endif
08daab2
08daab2
# remove files generated for the tests
08daab2
rm -rf find $RPM_BUILD_ROOT/%{python3_sitearch}/neat/tools/simtools/neuron/mech/*.mod
08daab2
rm -rf find $RPM_BUILD_ROOT/%{python3_sitearch}/neat/tools/simtools/neuron/%{_arch}
08daab2
08daab2
%files -n python3-neatdend -f %{pyproject_files}
08daab2
%doc README.rst CODE_OF_CONDUCT.rst CONTRIBUTING.rst CONTRIBUTORS.rst
08daab2
%{_bindir}/compilechannels
08daab2
08daab2
%changelog
08daab2
%autochangelog