Blob Blame History Raw
%bcond tests 1

# Sphinx-generated HTML documentation is not suitable for packaging; see
# for discussion.
# We can generate PDF documentation as a substitute.
%bcond doc_pdf 1

%global _description %{expand:
sklearn-genetic is a genetic feature selection module for scikit-learn.
Genetic algorithms mimic the process of natural selection to search
for optimal values of a function.}

Name:           python-sklearn-genetic
Version:        0.6.0
Release:        %autorelease
Summary:        A genetic feature selection module for scikit-learn

License:        LGPL-3.0-only
Source:         %{url}/archive/%{version}/sklearn-genetic-%{version}.tar.gz

BuildArch:      noarch

%description %_description

%package -n python3-sklearn-genetic
Summary:        %{summary}

BuildRequires:  make
BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  python3dist(pytest)

%description -n python3-sklearn-genetic %_description

%package doc
Summary:        %{summary}

%if %{with doc_pdf}
BuildRequires:  make
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
BuildRequires:  %{py3_dist sphinx}
BuildRequires:  %{py3_dist sphinx-rtd-theme}
BuildRequires:  %{py3_dist sphinxcontrib-bibtex}

%description doc
Documentation for %{name}.

%autosetup -n sklearn-genetic-%{version}



%if %{with doc_pdf}
%make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'

%pyproject_save_files -l genetic_selection

%if %{with tests}

%files -n python3-sklearn-genetic -f %{pyproject_files}
%doc README.rst

%files doc
%license LICENSE.txt
%if %{with doc_pdf}
%doc docs/build/latex/sklearn-genetic.pdf