]>
Commit | Line | Data |
---|---|---|
c69a5a94 JB |
1 | # TODO: finish doc and tests (BRs) |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_with doc # Sphinx documentation | |
5 | %bcond_with tests # unit tests | |
6 | ||
7 | Summary: Correctly generate plurals, singular nouns, ordinals, indefinite articles | |
8 | Summary(pl.UTF-8): Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, przedimków nieokreślonych | |
9 | Name: python3-inflect | |
10 | Version: 5.4.0 | |
d6215f54 | 11 | Release: 2 |
c69a5a94 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/inflect/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/i/inflect/inflect-%{version}.tar.gz | |
16 | # Source0-md5: 98e2983eba8db51c77adace0bc16b711 | |
17 | URL: https://pypi.org/project/inflect/ | |
18 | BuildRequires: python3-modules >= 1:3.7 | |
19 | BuildRequires: python3-setuptools >= 1:31.0.1 | |
20 | BuildRequires: python3-setuptools_scm >= 3.4.1 | |
21 | BuildRequires: python3-toml | |
22 | %if %{with tests} | |
23 | BuildRequires: python3-pygments | |
24 | BuildRequires: python3-pytest >= 6 | |
25 | BuildRequires: python3-pytest-black >= 0.3.7 | |
26 | #BuildRequires: python3-pytest-checkdocs >= 2.4 | |
27 | BuildRequires: python3-pytest-cov | |
28 | BuildRequires: python3-pytest-enabler >= 1.0.1 | |
29 | BuildRequires: python3-pytest-flake8 | |
30 | BuildRequires: python3-pytest-mypy | |
31 | %endif | |
32 | BuildRequires: rpm-pythonprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
34 | %if %{with doc} | |
35 | BuildRequires: python3-jaraco.packaging >= 8.2 | |
36 | BuildRequires: python3-jaraco.tidelift >= 1.4 | |
37 | BuildRequires: python3-rst.linker >= 1.9 | |
38 | BuildRequires: sphinx-pdg-3 | |
39 | %endif | |
40 | Requires: python3-modules >= 1:3.7 | |
41 | BuildArch: noarch | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | Correctly generate plurals, singular nouns, ordinals, indefinite | |
46 | articles; convert numbers to words. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, | |
50 | przedimków nieokreślonych; przekształcanie liczb na słowa. | |
51 | ||
52 | %package apidocs | |
53 | Summary: API documentation for Python inflect module | |
54 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona inflect | |
55 | Group: Documentation | |
56 | ||
57 | %description apidocs | |
58 | API documentation for Python inflect module. | |
59 | ||
60 | %description apidocs -l pl.UTF-8 | |
61 | Dokumentacja API modułu Pythona inflect. | |
62 | ||
63 | %prep | |
64 | %setup -q -n inflect-%{version} | |
65 | ||
66 | %build | |
67 | %py3_build | |
68 | ||
69 | %if %{with tests} | |
70 | ln -snf ../tests build-3/tests | |
71 | cd build-3 | |
72 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
73 | PYTEST_PLUGINS=pytest_black_multipy,pytest_flake8,pytest_cov.plugin \ | |
74 | PYTHONPATH=$(echo $(pwd)/build-3/lib) \ | |
75 | %{__python3} -m pytest tests | |
76 | cd .. | |
77 | %endif | |
78 | ||
79 | %if %{with doc} | |
80 | PYTHONPATH=$(pwd) \ | |
81 | sphinx-build-3 -b html docs docs/build/html | |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %py3_install | |
88 | ||
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %files | |
93 | %defattr(644,root,root,755) | |
94 | %doc CHANGES.rst LICENSE README.rst | |
95 | %{py3_sitescriptdir}/inflect | |
96 | %{py3_sitescriptdir}/inflect-%{version}-py*.egg-info | |
97 | ||
98 | %if %{with doc} | |
99 | %files apidocs | |
100 | %defattr(644,root,root,755) | |
101 | %doc docs/build/html/{_static,*.html,*.js} | |
102 | %endif |