diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-bracex.spec | 351 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 353 insertions, 0 deletions
@@ -0,0 +1 @@ +/bracex-2.3.post1.tar.gz diff --git a/python-bracex.spec b/python-bracex.spec new file mode 100644 index 0000000..d3e0fea --- /dev/null +++ b/python-bracex.spec @@ -0,0 +1,351 @@ +%global _empty_manifest_terminate_build 0 +Name: python-bracex +Version: 2.3.post1 +Release: 1 +Summary: Bash style brace expander. +License: MIT License +URL: https://github.com/facelessuser/bracex +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b3/96/d53e290ddf6215cfb24f93449a1835eff566f79a1f332cf046a978df0c9e/bracex-2.3.post1.tar.gz +BuildArch: noarch + + +%description +[![Donate via PayPal][donate-image]][donate-link] +[![Discord][discord-image]][discord-link] +[![Build][github-ci-image]][github-ci-link] +[![Coverage Status][codecov-image]][codecov-link] +[![PyPI Version][pypi-image]][pypi-link] +[![PyPI - Python Version][python-image]][pypi-link] +![License][license-image-mit] +# Bracex + +Bracex is a brace expanding library (à la Bash) for Python. Brace expanding is used to generate arbitrary strings. + +```console +$ echo {{a,b},c}d +ad bd cd +``` + +Bracex adds this ability to Python: + +```python +>>> bracex.expand(r'file-{{a,b},c}d.txt') +['file-ad.txt', 'file-bd.txt', 'file-cd.txt'] +``` + +and as a command: + +```console +$ python3 -m bracex -0 "base/{a,b}/{1..2}" | xargs -0 mkdir -p +$ tree base/ +base/ +├── a +│ ├── 1 +│ └── 2 +└── b + ├── 1 + └── 2 +``` + +- **Why Bracex over other solutions?** + + Bracex actually follows pretty closely to how Bash processes braces. It is not a 1:1 implementation of how Bash + handles braces, but generally, it follows very closely. Almost all of the test cases are run through Bash first, + then our implementation is compared against the results Bash gives. There are a few cases where we have purposely + deviated. For instance, we are not handling Bash's command line inputs, so we are not giving special meaning to back + ticks and quotes at this time. + + On the command line Bracex can handle more expansions than Bash itself. + +## Install + +```console +$ pip install bracex +``` + +## Documentation + +Documentation is found here: https://facelessuser.github.io/bracex/. + +## License + +MIT License + +Copyright (c) 2018 - 2021 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[github-ci-image]: https://github.com/facelessuser/bracex/workflows/build/badge.svg?branch=master&event=push +[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster +[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 +[discord-link]:https://discord.gg/TWs8Tgr +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/bracex/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[codecov-link]: https://codecov.io/github/facelessuser/bracex +[pypi-image]: https://img.shields.io/pypi/v/bracex.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 +[pypi-link]: https://pypi.python.org/pypi/bracex +[python-image]: https://img.shields.io/pypi/pyversions/bracex?logo=python&logoColor=aaaaaa&labelColor=333333 +[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333 +[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal +[donate-link]: https://www.paypal.me/facelessuser + + +%package -n python3-bracex +Summary: Bash style brace expander. +Provides: python-bracex +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-bracex +[![Donate via PayPal][donate-image]][donate-link] +[![Discord][discord-image]][discord-link] +[![Build][github-ci-image]][github-ci-link] +[![Coverage Status][codecov-image]][codecov-link] +[![PyPI Version][pypi-image]][pypi-link] +[![PyPI - Python Version][python-image]][pypi-link] +![License][license-image-mit] +# Bracex + +Bracex is a brace expanding library (à la Bash) for Python. Brace expanding is used to generate arbitrary strings. + +```console +$ echo {{a,b},c}d +ad bd cd +``` + +Bracex adds this ability to Python: + +```python +>>> bracex.expand(r'file-{{a,b},c}d.txt') +['file-ad.txt', 'file-bd.txt', 'file-cd.txt'] +``` + +and as a command: + +```console +$ python3 -m bracex -0 "base/{a,b}/{1..2}" | xargs -0 mkdir -p +$ tree base/ +base/ +├── a +│ ├── 1 +│ └── 2 +└── b + ├── 1 + └── 2 +``` + +- **Why Bracex over other solutions?** + + Bracex actually follows pretty closely to how Bash processes braces. It is not a 1:1 implementation of how Bash + handles braces, but generally, it follows very closely. Almost all of the test cases are run through Bash first, + then our implementation is compared against the results Bash gives. There are a few cases where we have purposely + deviated. For instance, we are not handling Bash's command line inputs, so we are not giving special meaning to back + ticks and quotes at this time. + + On the command line Bracex can handle more expansions than Bash itself. + +## Install + +```console +$ pip install bracex +``` + +## Documentation + +Documentation is found here: https://facelessuser.github.io/bracex/. + +## License + +MIT License + +Copyright (c) 2018 - 2021 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[github-ci-image]: https://github.com/facelessuser/bracex/workflows/build/badge.svg?branch=master&event=push +[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster +[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 +[discord-link]:https://discord.gg/TWs8Tgr +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/bracex/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[codecov-link]: https://codecov.io/github/facelessuser/bracex +[pypi-image]: https://img.shields.io/pypi/v/bracex.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 +[pypi-link]: https://pypi.python.org/pypi/bracex +[python-image]: https://img.shields.io/pypi/pyversions/bracex?logo=python&logoColor=aaaaaa&labelColor=333333 +[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333 +[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal +[donate-link]: https://www.paypal.me/facelessuser + + +%package help +Summary: Development documents and examples for bracex +Provides: python3-bracex-doc +%description help +[![Donate via PayPal][donate-image]][donate-link] +[![Discord][discord-image]][discord-link] +[![Build][github-ci-image]][github-ci-link] +[![Coverage Status][codecov-image]][codecov-link] +[![PyPI Version][pypi-image]][pypi-link] +[![PyPI - Python Version][python-image]][pypi-link] +![License][license-image-mit] +# Bracex + +Bracex is a brace expanding library (à la Bash) for Python. Brace expanding is used to generate arbitrary strings. + +```console +$ echo {{a,b},c}d +ad bd cd +``` + +Bracex adds this ability to Python: + +```python +>>> bracex.expand(r'file-{{a,b},c}d.txt') +['file-ad.txt', 'file-bd.txt', 'file-cd.txt'] +``` + +and as a command: + +```console +$ python3 -m bracex -0 "base/{a,b}/{1..2}" | xargs -0 mkdir -p +$ tree base/ +base/ +├── a +│ ├── 1 +│ └── 2 +└── b + ├── 1 + └── 2 +``` + +- **Why Bracex over other solutions?** + + Bracex actually follows pretty closely to how Bash processes braces. It is not a 1:1 implementation of how Bash + handles braces, but generally, it follows very closely. Almost all of the test cases are run through Bash first, + then our implementation is compared against the results Bash gives. There are a few cases where we have purposely + deviated. For instance, we are not handling Bash's command line inputs, so we are not giving special meaning to back + ticks and quotes at this time. + + On the command line Bracex can handle more expansions than Bash itself. + +## Install + +```console +$ pip install bracex +``` + +## Documentation + +Documentation is found here: https://facelessuser.github.io/bracex/. + +## License + +MIT License + +Copyright (c) 2018 - 2021 Isaac Muse + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +[github-ci-image]: https://github.com/facelessuser/bracex/workflows/build/badge.svg?branch=master&event=push +[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster +[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 +[discord-link]:https://discord.gg/TWs8Tgr +[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/bracex/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333 +[codecov-link]: https://codecov.io/github/facelessuser/bracex +[pypi-image]: https://img.shields.io/pypi/v/bracex.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333 +[pypi-link]: https://pypi.python.org/pypi/bracex +[python-image]: https://img.shields.io/pypi/pyversions/bracex?logo=python&logoColor=aaaaaa&labelColor=333333 +[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333 +[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal +[donate-link]: https://www.paypal.me/facelessuser + + +%prep +%autosetup -n bracex-2.3.post1 + +%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-bracex -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 2.3.post1-1 +- Package Spec generated @@ -0,0 +1 @@ +06d07dc6c8db9e0a2f05708bc94a3b32 bracex-2.3.post1.tar.gz |
