]> git.pld-linux.org Git - packages/python-inflect.git/blob - python-inflect.spec
rebuild with tests and docs
[packages/python-inflect.git] / python-inflect.spec
1 # TODO: finish tests
2 #
3 # Conditional build:
4 %bcond_without  doc     # Sphinx documentation
5 %bcond_with     tests   # unit tests
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_with     python3 # CPython 3.x module (built from python3-inflect.spec)
8
9 Summary:        Correctly generate plurals, singular nouns, ordinals, indefinite articles
10 Summary(pl.UTF-8):      Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, przedimków nieokreślonych
11 Name:           python-inflect
12 # keep 3.x here for python2 support
13 Version:        3.0.2
14 Release:        2
15 License:        MIT
16 Group:          Libraries/Python
17 #Source0Download: https://pypi.org/simple/inflect/
18 Source0:        https://files.pythonhosted.org/packages/source/i/inflect/inflect-%{version}.tar.gz
19 # Source0-md5:  29c60edf9917762e24c3b9aef63701c5
20 URL:            https://pypi.org/project/inflect/
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools >= 1:31.0.1
24 BuildRequires:  python-setuptools_scm >= 1.15.0
25 %if %{with tests}
26 BuildRequires:  python-importlib_metadata
27 BuildRequires:  python-nose
28 BuildRequires:  python-pytest >= 3.5
29 BuildRequires:  python-pytest-black-multipy
30 #BuildRequires: python-pytest-checkdocs >= 1.2.3
31 BuildRequires:  python-pytest-cov
32 BuildRequires:  python-pytest-flake8
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules >= 1:3.5
37 BuildRequires:  python3-setuptools >= 1:31.0.1
38 BuildRequires:  python3-setuptools_scm >= 1.15.0
39 %if %{with tests}
40 BuildRequires:  python3-importlib_metadata
41 BuildRequires:  python3-nose
42 BuildRequires:  python3-pytest >= 3.5
43 BuildRequires:  python3-pytest-black-multipy
44 #BuildRequires: python3-pytest-checkdocs >= 1.2.3
45 BuildRequires:  python3-pytest-cov
46 BuildRequires:  python3-pytest-flake8
47 %endif
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 %if %{with doc}
52 BuildRequires:  python-jaraco.packaging >= 3.2
53 BuildRequires:  python-rst.linker >= 1.9
54 BuildRequires:  sphinx-pdg-2
55 %endif
56 Requires:       python-modules >= 1:2.7
57 BuildArch:      noarch
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %description
61 Correctly generate plurals, singular nouns, ordinals, indefinite
62 articles; convert numbers to words.
63
64 %description -l pl.UTF-8
65 Poprawne generowanie liczby mnogiej i pojedynczej, liczebników,
66 przedimków nieokreślonych; przekształcanie liczb na słowa.
67
68 %package -n python3-inflect
69 Summary:        Correctly generate plurals, singular nouns, ordinals, indefinite articles
70 Summary(pl.UTF-8):      Poprawne generowanie liczby mnogiej i pojedynczej, liczebników, przedimków nieokreślonych
71 Group:          Libraries/Python
72 Requires:       python3-modules >= 1:3.5
73
74 %description -n python3-inflect
75 Correctly generate plurals, singular nouns, ordinals, indefinite
76 articles; convert numbers to words.
77
78 %description -n python3-inflect -l pl.UTF-8
79 Poprawne generowanie liczby mnogiej i pojedynczej, liczebników,
80 przedimków nieokreślonych; przekształcanie liczb na słowa.
81
82 %package apidocs
83 Summary:        API documentation for Python inflect module
84 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona inflect
85 Group:          Documentation
86
87 %description apidocs
88 API documentation for Python inflect module.
89
90 %description apidocs -l pl.UTF-8
91 Dokumentacja 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}
101 ln -snf ../tests build-2/tests
102 cd build-2
103 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
104 PYTEST_PLUGINS=pytest_black_multipy,pytest_flake8,pytest_cov.plugin \
105 PYTHONPATH=$(echo $(pwd)/lib) \
106 %{__python} -m pytest tests
107 cd ..
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 ln -snf ../tests build-3/tests
116 cd build-3
117 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
118 PYTEST_PLUGINS=pytest_black_multipy,pytest_flake8,pytest_cov.plugin \
119 PYTHONPATH=$(echo $(pwd)/lib) \
120 %{__python3} -m pytest tests
121 cd ..
122 %endif
123 %endif
124
125 %if %{with doc}
126 PYTHONPATH=$(pwd) \
127 sphinx-build-2 -b html docs docs/build/html
128 %endif
129
130 %install
131 rm -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
144 rm -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.113191 seconds and 3 git commands to generate.