%global _empty_manifest_terminate_build 0 Name: python-cwcwidth Version: 0.1.8 Release: 1 Summary: Python bindings for wc(s)width License: MIT URL: https://github.com/sebastinas/cwcwidth Source0: https://mirrors.nju.edu.cn/pypi/web/packages/c6/6c/fe4a10bd3de2a3ecdcb53e8ad90ec9fddc846342e5e39e6446c692637414/cwcwidth-0.1.8.tar.gz %description # Python bindings for wc(s)width `cwcwidth` provides Python bindings for `wcwidth` and `wcswidth` functions defined in POSIX.1-2001 and POSIX.1-2008 based on [Cython](https://cython.org/). These functions compute the printable length of a unicode character/string on a terminal. The module provides the same functions as [wcwidth](https://pypi.org/project/wcwidth/) and its behavior is compatible. On systems not conforming to POSIX.1-2001 and POSIX.1-2008, Markus Kuhn's [implementation](https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c) is used to provide the functionality. ## Dependencies * `Cython >= 0.28` (optional, only for building). If Cython is not available, the C files are not regenerated from their source. ## Quick installation guide `cwcwidth` can be installed via `pip`: ```sh pip install cwcwidth ``` or by running: ```sh python3 setup.py install ``` ## Usage ```python3 >>> import cwcwidth >>> cwcwidth.wcwidth("a") 1 >>> cwcwidth.wcswidth("コ") 2 >>> cwcwidth.wcswidth("コンニチハ, セカイ!") 19 >>> cwcwidth.wcswidth("コンニチハ, セカイ!", 5) 10 ``` ## Comparison with `wcwidth` ```python3 >>> import wcwidth, cwcwidth, timeit >>> timeit.timeit(lambda: wcwidth.wcswidth("コンニチハ, セカイ!")) 19.14463168097427 >>> timeit.timeit(lambda: cwcwidth.wcswidth("コンニチハ, セカイ!")) 0.16294104099506512 ``` ## License The code is licensed under the MIT license. %package -n python3-cwcwidth Summary: Python bindings for wc(s)width Provides: python-cwcwidth BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-cwcwidth # Python bindings for wc(s)width `cwcwidth` provides Python bindings for `wcwidth` and `wcswidth` functions defined in POSIX.1-2001 and POSIX.1-2008 based on [Cython](https://cython.org/). These functions compute the printable length of a unicode character/string on a terminal. The module provides the same functions as [wcwidth](https://pypi.org/project/wcwidth/) and its behavior is compatible. On systems not conforming to POSIX.1-2001 and POSIX.1-2008, Markus Kuhn's [implementation](https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c) is used to provide the functionality. ## Dependencies * `Cython >= 0.28` (optional, only for building). If Cython is not available, the C files are not regenerated from their source. ## Quick installation guide `cwcwidth` can be installed via `pip`: ```sh pip install cwcwidth ``` or by running: ```sh python3 setup.py install ``` ## Usage ```python3 >>> import cwcwidth >>> cwcwidth.wcwidth("a") 1 >>> cwcwidth.wcswidth("コ") 2 >>> cwcwidth.wcswidth("コンニチハ, セカイ!") 19 >>> cwcwidth.wcswidth("コンニチハ, セカイ!", 5) 10 ``` ## Comparison with `wcwidth` ```python3 >>> import wcwidth, cwcwidth, timeit >>> timeit.timeit(lambda: wcwidth.wcswidth("コンニチハ, セカイ!")) 19.14463168097427 >>> timeit.timeit(lambda: cwcwidth.wcswidth("コンニチハ, セカイ!")) 0.16294104099506512 ``` ## License The code is licensed under the MIT license. %package help Summary: Development documents and examples for cwcwidth Provides: python3-cwcwidth-doc %description help # Python bindings for wc(s)width `cwcwidth` provides Python bindings for `wcwidth` and `wcswidth` functions defined in POSIX.1-2001 and POSIX.1-2008 based on [Cython](https://cython.org/). These functions compute the printable length of a unicode character/string on a terminal. The module provides the same functions as [wcwidth](https://pypi.org/project/wcwidth/) and its behavior is compatible. On systems not conforming to POSIX.1-2001 and POSIX.1-2008, Markus Kuhn's [implementation](https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c) is used to provide the functionality. ## Dependencies * `Cython >= 0.28` (optional, only for building). If Cython is not available, the C files are not regenerated from their source. ## Quick installation guide `cwcwidth` can be installed via `pip`: ```sh pip install cwcwidth ``` or by running: ```sh python3 setup.py install ``` ## Usage ```python3 >>> import cwcwidth >>> cwcwidth.wcwidth("a") 1 >>> cwcwidth.wcswidth("コ") 2 >>> cwcwidth.wcswidth("コンニチハ, セカイ!") 19 >>> cwcwidth.wcswidth("コンニチハ, セカイ!", 5) 10 ``` ## Comparison with `wcwidth` ```python3 >>> import wcwidth, cwcwidth, timeit >>> timeit.timeit(lambda: wcwidth.wcswidth("コンニチハ, セカイ!")) 19.14463168097427 >>> timeit.timeit(lambda: cwcwidth.wcswidth("コンニチハ, セカイ!")) 0.16294104099506512 ``` ## License The code is licensed under the MIT license. %prep %autosetup -n cwcwidth-0.1.8 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-cwcwidth -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon Apr 10 2023 Python_Bot - 0.1.8-1 - Package Spec generated