9d9e56a
%bcond_without tests
fc75012
# Sphinx-generated HTML documentation is not suitable for packaging; see
fc75012
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
fc75012
#
fc75012
# We would like to generate PDF documentation as a substitute, but have not
fc75012
# been able to successfully build the Sphinx-generated LaTeX for this
fc75012
# particular package.
fc75012
%bcond_with doc_pdf
fc75012
fc75012
%global forgeurl https://github.com/NiaOrg/NiaPy
f69304b
%global tag %{version}
fc75012
fc75012
Name:           python-niapy
a6b1dac
Version:        2.0.1
fc75012
%forgemeta
a6b1dac
Release:        1%{?dist}
fc75012
Summary:        Micro framework for building nature-inspired algorithms
9d9e56a
fc75012
License:        MIT
fc75012
URL:            %{forgeurl}
fc75012
Source0:        %{forgesource}
fc75012
fc75012
BuildArch:      noarch
9d9e56a
9d9e56a
%global _description %{expand:
9d9e56a
Nature-inspired algorithms are a very popular tool for solving optimization
9d9e56a
problems. Numerous variants of nature-inspired algorithms have been developed
9d9e56a
since the beginning of their era. To prove their versatility, those were tested
9d9e56a
in various domains on various applications, especially when they are
9d9e56a
hybridized, modified or adapted. However, implementation of nature-inspired
9d9e56a
algorithms is sometimes a difficult, complex and tedious task. In order to
9d9e56a
break this wall, NiaPy is intended for simple and quick use, without spending
9d9e56a
time for implementing algorithms from scratch.}
9d9e56a
9d9e56a
%description %_description
9d9e56a
fc75012
%package -n python3-niapy
9d9e56a
Summary:        %{summary}
9d9e56a
BuildRequires:  python3-devel
fc75012
663e9a9
%if %{with tests}
fc75012
# setup.py: tests_require
fc75012
#
fc75012
# flake8 ~= 3.7.7
fc75012
# astroid >= 2.0.4
fc75012
# pytest ~= 3.7.1
fc75012
# coverage ~= 4.4.2
fc75012
# coverage-space ~= 1.0.2
fc75012
#
fc75012
# We do not run flake8:
fc75012
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
fc75012
# …nor do we care about test coverage. Furthermore, we must accept any newer
fc75012
# version of pytest.
fc75012
BuildRequires:  python3dist(pytest) >= 3.7.1
663e9a9
%endif
663e9a9
fc75012
%description -n python3-niapy %_description
9d9e56a
9d9e56a
%package doc
fc75012
Summary:        Documentation and examples for %{name}
fc75012
fc75012
%if %{with doc_pdf}
fc75012
BuildRequires:  make
fc75012
BuildRequires:  python3dist(sphinx)
fc75012
BuildRequires:  python3-sphinx-latex
fc75012
BuildRequires:  latexmk
fc75012
BuildRequires:  tex-xetex-bin
fc75012
BuildRequires:  /usr/bin/xindy
fc75012
%endif
9d9e56a
9d9e56a
%description doc
fc75012
%{summary}.
9d9e56a
fc75012
Full HTML documentation is available at
fc75012
https://niapy.readthedocs.io/en/stable/index.html.
9d9e56a
fc75012
%prep
fc75012
%forgeautosetup
fc75012
# Since we aren’t building HTML documentation, we don’t need the HTML theme
fc75012
# dependency:
fc75012
sed -r -i 's/^(sphinx-.*theme)/#\1/' docs/requirements.txt
fc75012
# Since pdflatex cannot handle Unicode inputs in general:
fc75012
echo "latex_engine = 'xelatex'" >> docs/source/conf.py
fc75012
# Avoid: ! LaTeX Error: Too deeply nested.
fc75012
# Normally we could add a preamble like:
fc75012
#
fc75012
#   cat >> docs/source/conf.py <<'EOF'
fc75012
#   latex_elements['preamble'] = r'''
fc75012
#   \usepackage{enumitem}
fc75012
#   \setlistdepth{99}
fc75012
#   '''
fc75012
#   EOF
fc75012
#
fc75012
# but that does not work well (“Undefined control sequence”).
fc75012
#
fc75012
# We can also try:
fc75012
#
fc75012
#   echo "latex_elements['maxlistdepth'] = '10'" >> docs/source/conf.py
fc75012
#
fc75012
# but this produces errors like:
fc75012
#
fc75012
#   ! LaTeX Error: \begin{list} on input line 21785 ended by \end{itemize}.
fc75012
fc75012
%generate_buildrequires
fc75012
%pyproject_buildrequires -r %{?with_pdf_doc:docs/requirements.txt}
9d9e56a
9d9e56a
%build
fc75012
%pyproject_wheel
9d9e56a
fc75012
%if %{with doc_pdf}
fc75012
PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
fc75012
%make_build -C docs/build/latex LATEXMKOPTS='-quiet -f'
fc75012
%endif
9d9e56a
9d9e56a
%install
fc75012
%pyproject_install
fc75012
%pyproject_save_files niapy
9d9e56a
9d9e56a
%check
9d9e56a
%if %{with tests}
fc75012
#k="${k-}${k+ and }not test_to_skip_sample1"
fc75012
#k="${k-}${k+ and }not test_to_skip_sample2"
fc75012
%pytest -ra -k "${k-}"
9d9e56a
%endif
9d9e56a
fc75012
%files -n python3-niapy -f %{pyproject_files}
d454f94
%doc README.rst README.md CHANGELOG.md Algorithms.md Problems.md
9d9e56a
9d9e56a
%files doc
9d9e56a
%license LICENSE
fc75012
%if %{with doc_pdf}
fc75012
%doc docs/build/latex/NiaPy.pdf
fc75012
%endif
2497789
%doc examples/
6424893
%doc paper/
32aaa8f
%doc CONTRIBUTING.md CODE_OF_CONDUCT.md
9d9e56a
9d9e56a
%changelog
a6b1dac
* Sat Mar 5 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.1-1
a6b1dac
- Update to the latest upstream's release
a6b1dac
9dd1cd6
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
9dd1cd6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
9dd1cd6
f69304b
* Fri Dec 31 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-1
f69304b
- Update to the latest upstream's release (second stable release)
f69304b
fc75012
* Mon Nov 29 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 2.0.0-0.3rc18
fc75012
- Port to pyproject-rpm-macros (“new guidelines”)
fc75012
- Drop HTML documentation
fc75012
- Stop skipping tests; they all pass now
fc75012
d454f94
* Wed Aug 18 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc18
d454f94
- Update to the latest upstream's release - rc18
d454f94
6783812
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-0.2rc17
6783812
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
6783812
11035b3
* Fri Jun 11 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc17
11035b3
- Update to the latest upstream's release - rc17
11035b3
- Remove patch
11035b3
812b29c
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.0.0-0.2rc16
812b29c
- Rebuilt for Python 3.10
812b29c
cb84fb6
* Wed May 26 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc16
cb84fb6
- Update to the latest upstream's release - rc16
cb84fb6
32aaa8f
* Fri May 21 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.2rc15
32aaa8f
- Add additional doc files found in repository to docs
32aaa8f
27cbb6a
* Sat May 15 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc15
27cbb6a
- Update to the latest upstream's release - rc15
27cbb6a
6424893
* Fri Apr 23 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.2rc14
6424893
- Removing sed commands - dependencies already removed
6424893
- Added JOSS paper in documents
6424893
3294223
* Fri Apr 23 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc14
3294223
- New version of package
3294223
2497789
* Thu Apr 15 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.5rc13
2497789
- Add examples in subpackage
2497789
a393713
* Tue Apr 6 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.4rc13
a393713
- Install additional docs
a393713
fe00ff1
* Tue Mar 23 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.3rc13
fe00ff1
- Skip one test (it is failing from time to time, because of random)
fe00ff1
663e9a9
* Fri Mar 19 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.2rc13
663e9a9
- Remove dependency generator
663e9a9
- Conditional imports for tests
663e9a9
a1eb001
* Wed Mar 10 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc13
a1eb001
- New version
a1eb001
0f1da5b
* Thu Feb 11 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.5rc12
0f1da5b
- Removing linter errors and typos
0f1da5b
cd02b94
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-0.4rc12
cd02b94
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
cd02b94
ae1129f
* Fri Dec 4 2020 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.3rc12
d386c87
- New release - 2.0.0rc12
d386c87
- Remove dependencies - xlwt, xlsxwriter
d386c87
- New dependency - openpyxl
d386c87
5e713c7
* Fri Nov 20 2020 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 2.0.0-0.1rc11
5e713c7
- New release - 2.0.0rc11
5e713c7
db5f188
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-0.2rc10
db5f188
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
db5f188
9d9e56a
* Thu Jul 02 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.0-0.1rc10
9d9e56a
- Remove dep on enum34
9d9e56a
- Add python_provides for F32
9d9e56a
9d9e56a
* Sat Jun 27 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.0.2-1
9d9e56a
- Initial package
0f1da5b