]> git.pld-linux.org Git - packages/python-inflect.git/blame - python-inflect.spec
rebuild with tests and docs
[packages/python-inflect.git] / python-inflect.spec
CommitLineData
7656dadf 1# TODO: finish tests
66c2cdfd
JB
2#
3# Conditional build:
4%bcond_without doc # Sphinx documentation
7656dadf 5%bcond_with tests # unit tests
66c2cdfd 6%bcond_without python2 # CPython 2.x module
9bf4e666 7%bcond_with python3 # CPython 3.x module (built from python3-inflect.spec)
66c2cdfd
JB
8
9Summary: Correctly generate plurals, singular nouns, ordinals, indefinite articles
10Summary(pl.UTF-8): Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, przedimków nieokreślonych
11Name: python-inflect
12# keep 3.x here for python2 support
13Version: 3.0.2
16b82bee 14Release: 2
66c2cdfd
JB
15License: MIT
16Group: Libraries/Python
17#Source0Download: https://pypi.org/simple/inflect/
18Source0: https://files.pythonhosted.org/packages/source/i/inflect/inflect-%{version}.tar.gz
19# Source0-md5: 29c60edf9917762e24c3b9aef63701c5
20URL: https://pypi.org/project/inflect/
21%if %{with python2}
22BuildRequires: python-modules >= 1:2.7
23BuildRequires: python-setuptools >= 1:31.0.1
24BuildRequires: python-setuptools_scm >= 1.15.0
25%if %{with tests}
26BuildRequires: python-importlib_metadata
27BuildRequires: python-nose
28BuildRequires: python-pytest >= 3.5
29BuildRequires: python-pytest-black-multipy
30#BuildRequires: python-pytest-checkdocs >= 1.2.3
31BuildRequires: python-pytest-cov
32BuildRequires: python-pytest-flake8
33%endif
34%endif
35%if %{with python3}
36BuildRequires: python3-modules >= 1:3.5
37BuildRequires: python3-setuptools >= 1:31.0.1
38BuildRequires: python3-setuptools_scm >= 1.15.0
39%if %{with tests}
40BuildRequires: python3-importlib_metadata
41BuildRequires: python3-nose
42BuildRequires: python3-pytest >= 3.5
43BuildRequires: python3-pytest-black-multipy
44#BuildRequires: python3-pytest-checkdocs >= 1.2.3
45BuildRequires: python3-pytest-cov
46BuildRequires: python3-pytest-flake8
47%endif
48%endif
49BuildRequires: rpm-pythonprov
50BuildRequires: rpmbuild(macros) >= 1.714
51%if %{with doc}
52BuildRequires: python-jaraco.packaging >= 3.2
53BuildRequires: python-rst.linker >= 1.9
54BuildRequires: sphinx-pdg-2
55%endif
56Requires: python-modules >= 1:2.7
57BuildArch: noarch
58BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60%description
61Correctly generate plurals, singular nouns, ordinals, indefinite
62articles; convert numbers to words.
63
64%description -l pl.UTF-8
65Poprawne generowanie liczby mnogiej i pojedynczej, liczebników,
66przedimków nieokreślonych; przekształcanie liczb na słowa.
67
68%package -n python3-inflect
69Summary: Correctly generate plurals, singular nouns, ordinals, indefinite articles
70Summary(pl.UTF-8): Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, przedimków nieokreślonych
71Group: Libraries/Python
72Requires: python3-modules >= 1:3.5
73
74%description -n python3-inflect
75Correctly generate plurals, singular nouns, ordinals, indefinite
76articles; convert numbers to words.
77
78%description -n python3-inflect -l pl.UTF-8
79Poprawne generowanie liczby mnogiej i pojedynczej, liczebników,
80przedimków nieokreślonych; przekształcanie liczb na słowa.
81
82%package apidocs
83Summary: API documentation for Python inflect module
84Summary(pl.UTF-8): Dokumentacja API modułu Pythona inflect
85Group: Documentation
86
87%description apidocs
88API documentation for Python inflect module.
89
90%description apidocs -l pl.UTF-8
91Dokumentacja API modułu Pythona inflect.
92
93%prep
94%setup -q -n inflect-%{version}
95
96%build
97%if %{with python2}
98%py_build
99
100%if %{with tests}
101ln -snf ../tests build-2/tests
102cd build-2
103PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
104PYTEST_PLUGINS=pytest_black_multipy,pytest_flake8,pytest_cov.plugin \
105PYTHONPATH=$(echo $(pwd)/lib) \
106%{__python} -m pytest tests
107cd ..
108%endif
109%endif
110
111%if %{with python3}
112%py3_build
113
114%if %{with tests}
8c8b7444 115ln -snf ../tests build-3/tests
66c2cdfd
JB
116cd build-3
117PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
118PYTEST_PLUGINS=pytest_black_multipy,pytest_flake8,pytest_cov.plugin \
119PYTHONPATH=$(echo $(pwd)/lib) \
120%{__python3} -m pytest tests
121cd ..
122%endif
123%endif
124
125%if %{with doc}
126PYTHONPATH=$(pwd) \
127sphinx-build-2 -b html docs docs/build/html
128%endif
129
130%install
131rm -rf $RPM_BUILD_ROOT
132
133%if %{with python2}
134%py_install
135
136%py_postclean
137%endif
138
139%if %{with python3}
140%py3_install
141%endif
142
143%clean
144rm -rf $RPM_BUILD_ROOT
145
146%if %{with python2}
147%files
148%defattr(644,root,root,755)
149%doc CHANGES.rst LICENSE README.rst
150%{py_sitescriptdir}/inflect.py[co]
151%{py_sitescriptdir}/inflect-%{version}-py*.egg-info
152%endif
153
154%if %{with python3}
155%files -n python3-inflect
156%defattr(644,root,root,755)
157%doc CHANGES.rst LICENSE README.rst
158%{py3_sitescriptdir}/inflect.py
159%{py3_sitescriptdir}/__pycache__/inflect.cpython-*.py[co]
160%{py3_sitescriptdir}/inflect-%{version}-py*.egg-info
161%endif
162
163%if %{with doc}
164%files apidocs
165%defattr(644,root,root,755)
166%doc docs/build/html/{_static,*.html,*.js}
167%endif
This page took 0.135072 seconds and 4 git commands to generate.