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