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