diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-10 22:30:26 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-10 22:30:26 +0000 |
| commit | b0d9bb838cb0317ebe56e93c00bec93b597bf7b5 (patch) | |
| tree | 1ea6dfe9f1cfd5278af4425db345c20081627fa5 | |
| parent | a4ac2edb34596c64159513a2f253f8cf7d79bcfb (diff) | |
automatic import of python-cwcwidth
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-cwcwidth.spec | 239 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 241 insertions, 0 deletions
@@ -0,0 +1 @@ +/cwcwidth-0.1.8.tar.gz diff --git a/python-cwcwidth.spec b/python-cwcwidth.spec new file mode 100644 index 0000000..172f9bc --- /dev/null +++ b/python-cwcwidth.spec @@ -0,0 +1,239 @@ +%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 <Python_Bot@openeuler.org> - 0.1.8-1 +- Package Spec generated @@ -0,0 +1 @@ +ef155d03183cc03c5422c7b8de2112f1 cwcwidth-0.1.8.tar.gz |
