Blob Blame History Raw
%global forgeurl

Name:           python-deap
Version:        1.3.3

Release:        %autorelease
Summary:        Distributed Evolutionary Algorithms in Python
%global ref %version

License:        LGPLv3
Source0:        %{forgesource}

BuildRequires:  gcc
BuildRequires:  gcc-c++

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pypandoc
BuildRequires:  python3-pytest
BuildRequires:  python3-nose
BuildRequires:  python3-numpy

# documentation
BuildRequires:  python3-sphinx
BuildRequires:  texlive-scheme-basic
BuildRequires:  tex(ucs.sty)
BuildRequires:  tex(anyfontsize.sty)
BuildRequires:  python3-numpy
BuildRequires:  python3-matplotlib

%global _description %{expand:
DEAP is a novel evolutionary computation framework for rapid prototyping and
testing of ideas that implements a number of genetic optimization algorithms
behind a common interface.}

%description %_description

%package -n     python3-deap
Requires:       python3-numpy
BuildRequires:  python3-nose
Summary:        %{summary}
%{?python_provide:%python_provide python3-deap}

%description -n python3-deap %_description

%package -n python-deap-doc
Summary:        Documentation for deap
BuildArch:      noarch
%description -n python-deap-doc

%autosetup -n %{extractdir} -p1
sed -i 's/\["git", "rev-parse", "HEAD"\]/["echo", "deap-%{version}-%{release}"]/' \

sed -i -r "s|'matplotlib.sphinxext.only_directives',||" doc/


# generate html docs
PYTHONPATH=build/lib.%{python3_platform}-%{python3_version} sphinx-build-3 doc build/html

# remove the sphinx-build leftovers
rm -rf build/html/.{doctrees,buildinfo}

%global _docdir_fmt %{name}


%ifarch s390x
# Fails with: AssertionError: CMA algorithm did not converged properly.
%global test_options -k 'not test_cma'

PYTHONPATH=%{buildroot}%{python3_sitearch} pytest -v \
  %{buildroot}%{python3_sitearch}/deap/tests \

%files -n python3-deap
%license LICENSE.txt

%files -n python-deap-doc
%license LICENSE.txt
%doc build/html