]>
Commit | Line | Data |
---|---|---|
8a462a50 | 1 | # |
a9d72cbd AM |
2 | # Conditional build: |
3 | %bcond_without doc # API documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module natsort | |
7 | Summary: Simple yet flexible natural sorting in Python | |
8a462a50 | 8 | Summary(pl.UTF-8): Proste, ale elastyczne naturalne sortowanie w Pythonie |
a9d72cbd | 9 | Name: python3-%{module} |
8a462a50 JB |
10 | Version: 8.4.0 |
11 | Release: 1 | |
a9d72cbd AM |
12 | License: MIT |
13 | Group: Libraries/Python | |
8a462a50 JB |
14 | #Source0Download: https://pypi.org/simple/natsort/ |
15 | Source0: https://files.pythonhosted.org/packages/source/n/natsort/%{module}-%{version}.tar.gz | |
16 | # Source0-md5: e2e5314ac58cb7b48ca1680c02637893 | |
a9d72cbd | 17 | URL: https://pypi.org/project/natsort/ |
8a462a50 JB |
18 | BuildRequires: python3-modules >= 1:3.7 |
19 | BuildRequires: python3-setuptools | |
a9d72cbd | 20 | %if %{with tests} |
4799ce98 | 21 | BuildRequires: python3-hypothesis |
8a462a50 JB |
22 | BuildRequires: python3-pytest |
23 | BuildRequires: python3-pytest-cov | |
24 | BuildRequires: python3-pytest-mock | |
a9d72cbd AM |
25 | %endif |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | %if %{with doc} | |
8a462a50 | 29 | BuildRequires: python3-sphinx_rtd_theme |
a9d72cbd AM |
30 | BuildRequires: sphinx-pdg-3 |
31 | %endif | |
8a462a50 | 32 | Requires: python3-modules >= 1:3.7 |
a9d72cbd AM |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Simple yet flexible natural sorting in Python. | |
38 | ||
8a462a50 JB |
39 | %description -l pl.UTF-8 |
40 | Proste, ale elastyczne naturalne sortowanie w Pythonie. | |
41 | ||
a9d72cbd AM |
42 | %package apidocs |
43 | Summary: API documentation for Python %{module} module | |
44 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
45 | Group: Documentation | |
46 | ||
47 | %description apidocs | |
48 | API documentation for Python %{module} module. | |
49 | ||
50 | %description apidocs -l pl.UTF-8 | |
51 | Dokumentacja API modułu Pythona %{module}. | |
52 | ||
53 | %prep | |
54 | %setup -q -n %{module}-%{version} | |
55 | ||
56 | %build | |
57 | %py3_build | |
58 | ||
59 | %if %{with tests} | |
8a462a50 JB |
60 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
61 | PYTEST_PLUGINS=pytest_mock \ | |
a9d72cbd AM |
62 | %{__python3} -m pytest tests |
63 | %endif | |
64 | ||
65 | %if %{with doc} | |
8a462a50 | 66 | sphinx-build-3 -b html docs docs/_build/html |
a9d72cbd AM |
67 | %endif |
68 | ||
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %py3_install | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc CHANGELOG.md README.rst | |
80 | %attr(755,root,root) %{_bindir}/natsort | |
8a462a50 JB |
81 | %{py3_sitescriptdir}/natsort |
82 | %{py3_sitescriptdir}/natsort-%{version}-py*.egg-info | |
a9d72cbd AM |
83 | |
84 | %if %{with doc} | |
85 | %files apidocs | |
86 | %defattr(644,root,root,755) | |
8a462a50 | 87 | %doc docs/_build/html/{_static,*.html,*.js} |
a9d72cbd | 88 | %endif |