]> git.pld-linux.org Git - packages/python-wcwidth.git/blob - python-wcwidth.spec
rebuild with python 3.10
[packages/python-wcwidth.git] / python-wcwidth.spec
1 # TODO: finish doc
2 #
3 # Conditional build:
4 %bcond_with     doc     # Sphinx documentation
5 %bcond_without  tests   # unit tests
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module  wcwidth
10 Summary:        Measure the number of terminal column cells of wide-character codes
11 Summary(pl.UTF-8):      Pomiar liczby kolumn terminala koniecznych do wyświetlenia znaków
12 Name:           python-%{module}
13 Version:        0.2.5
14 Release:        2
15 License:        MIT
16 Group:          Libraries/Python
17 #Source0Download: https://github.com/jquast/wcwidth/releases
18 Source0:        https://github.com/jquast/wcwidth/archive/%{version}/%{module}-%{version}.tar.gz
19 # Source0-md5:  c82382572afdbba64470f56374502952
20 URL:            https://pypi.org/project/wcwidth/
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-backports.functools_lru_cache >= 1.2.1
26 BuildRequires:  python-pytest
27 BuildRequires:  python-pytest-cov
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-modules >= 1:3.4
32 BuildRequires:  python3-setuptools
33 %if %{with tests}
34 BuildRequires:  python3-pytest
35 BuildRequires:  python3-pytest-cov
36 %endif
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 %if %{with doc}
41 BuildRequires:  python3-sphinx-paramlinks
42 BuildRequires:  python3-sphinx_rtd_theme
43 BuildRequires:  python3-sphinxcontrib-manpage
44 BuildRequires:  sphinx-pdg-3
45 %endif
46 Requires:       python-modules >= 1:2.7
47 BuildArch:      noarch
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 This library is mainly for those implementing a Terminal Emulator, or
52 programs that carefully produce output to be interpreted by one.
53
54 %description -l pl.UTF-8
55 Ta biblioteka przydaje się głównie implementującym emulator terminala
56 lub programom uważnie tworzących wyjście do interpretowania przez
57 takowy.
58
59 %package -n python3-%{module}
60 Summary:        Measure the number of terminal column cells of wide-character codes
61 Summary(pl.UTF-8):      Pomiar liczby kolumn terminala koniecznych do wyświetlenia znaków
62 Group:          Libraries/Python
63 Requires:       python3-modules >= 1:3.4
64
65 %description -n python3-%{module}
66 This library is mainly for those implementing a Terminal Emulator, or
67 programs that carefully produce output to be interpreted by one.
68
69 %description -n python3-%{module} -l pl.UTF-8
70 Ta biblioteka przydaje się głównie implementującym emulator terminala
71 lub programom uważnie tworzących wyjście do interpretowania przez
72 takowy.
73
74 %prep
75 %setup -q -n %{module}-%{version}
76
77 %build
78 %if %{with python2}
79 %py_build
80
81 %if %{with tests}
82 # test_package_version refers to distribution, fails without installed package
83 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
84 PYTEST_PLUGINS=pytest_cov.plugin \
85 PYTHONPATH=$(pwd) \
86 %{__python} -m pytest tests -k 'not test_package_version'
87 %endif
88 %endif
89
90 %if %{with python3}
91 %py3_build
92
93 %if %{with tests}
94 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
95 PYTEST_PLUGINS=pytest_cov.plugin \
96 PYTHONPATH=$(pwd) \
97 %{__python3} -m pytest tests -k 'not test_package_version'
98 %endif
99 %endif
100
101 %if %{with doc}
102 sphinx-build-3 -b html docs docs/build/html
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107
108 %if %{with python2}
109 %py_install
110
111 %py_postclean
112 %endif
113
114 %if %{with python3}
115 %py3_install
116 %endif
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with python2}
122 %files
123 %defattr(644,root,root,755)
124 %doc LICENSE README.rst
125 %{py_sitescriptdir}/wcwidth
126 %{py_sitescriptdir}/wcwidth-%{version}-py*.egg-info
127 %endif
128
129 %if %{with python3}
130 %files -n python3-%{module}
131 %defattr(644,root,root,755)
132 %doc LICENSE README.rst
133 %{py3_sitescriptdir}/wcwidth
134 %{py3_sitescriptdir}/wcwidth-%{version}-py*.egg-info
135 %endif
This page took 0.070666 seconds and 3 git commands to generate.