diff options
Diffstat (limited to 'python-chocs.spec')
| -rw-r--r-- | python-chocs.spec | 268 |
1 files changed, 268 insertions, 0 deletions
diff --git a/python-chocs.spec b/python-chocs.spec new file mode 100644 index 0000000..aa406bc --- /dev/null +++ b/python-chocs.spec @@ -0,0 +1,268 @@ +%global _empty_manifest_terminate_build 0 +Name: python-chocs +Version: 1.6.1 +Release: 1 +Summary: Lightweight and powerful WSGI/AWS lambda framework for rapid building rest applications. +License: MIT +URL: https://github.com/kodemore/chocs +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bb/d0/fc1621daa8824ac9022676856651d23109164ba4e80349ad684d9372a3dd/chocs-1.6.1.tar.gz +BuildArch: noarch + +Requires: python3-pyyaml + +%description +<img align="right" width=300 src="https://github.com/kodemore/chocs/raw/master/chocs.png"> + +# Chocs <br>[](https://pypi.org/project/chocs/)   [](https://codecov.io/gh/kodemore/chocs) [](https://codeclimate.com/github/kodemore/chocs/maintainability) + +Chocs is a modern HTTP framework for building AWS HTTP API/REST API and WSGI compatible applications. +Chocs aims to be small, expressive, and robust. +It provides an elegant API for writing fault-proof, extensible microservices. + + +## Features + + - AWS Serverless integration + - Elegant and easy API + - No additional bloat like built-in template engines, session handlers, etc. + - Compatible with all WSGI servers + - Loosely coupled components which can be used separately + - Multipart body parsing + - Graceful error handling + - HTTP middleware support + - Fast routing + - Middleware packages to simplify daily tasks + +## Installation +``` +pip install chocs +``` + +or with poetry + +``` +poetry add chocs +``` + +## Quick start + +```python +import chocs + +http = chocs.Application() + +@http.get("/hello/{name}") +def hello(request: chocs.HttpRequest) -> chocs.HttpResponse: + return chocs.HttpResponse(f"Hello {request.path_parameters.get('name')}!") + +chocs.serve(http) +``` + +> Keep in mind that the `chocs.serve()` function is using the `bjoern` package, so make sure you included it in your project +> dependencies before using it. You are able to use any WSGI compatible server. + +## Available middlewares + +### OpenAPI Integration middleware + +Allows integrating OpenAPI documentation into your codebase, providing automating request validation based +on your OpenAPI spec. More details are available in the [chocs-openapi repository](https://github.com/kodemore/chocs-openapi). + +### ParsedBody middleware + +Parsed body middleware helps to convert json/yaml request payloads into dataclass, this not only makes your +daily tasks easier but increases readability of your code and contract. More details are available in the [chocs-parsed-body repository](https://github.com/kodemore/chocs-parsed-body). + + +# Documentation +For usage and detailed documentation please visit our [wiki page](https://github.com/kodemore/chocs/wiki) + + +%package -n python3-chocs +Summary: Lightweight and powerful WSGI/AWS lambda framework for rapid building rest applications. +Provides: python-chocs +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-chocs +<img align="right" width=300 src="https://github.com/kodemore/chocs/raw/master/chocs.png"> + +# Chocs <br>[](https://pypi.org/project/chocs/)   [](https://codecov.io/gh/kodemore/chocs) [](https://codeclimate.com/github/kodemore/chocs/maintainability) + +Chocs is a modern HTTP framework for building AWS HTTP API/REST API and WSGI compatible applications. +Chocs aims to be small, expressive, and robust. +It provides an elegant API for writing fault-proof, extensible microservices. + + +## Features + + - AWS Serverless integration + - Elegant and easy API + - No additional bloat like built-in template engines, session handlers, etc. + - Compatible with all WSGI servers + - Loosely coupled components which can be used separately + - Multipart body parsing + - Graceful error handling + - HTTP middleware support + - Fast routing + - Middleware packages to simplify daily tasks + +## Installation +``` +pip install chocs +``` + +or with poetry + +``` +poetry add chocs +``` + +## Quick start + +```python +import chocs + +http = chocs.Application() + +@http.get("/hello/{name}") +def hello(request: chocs.HttpRequest) -> chocs.HttpResponse: + return chocs.HttpResponse(f"Hello {request.path_parameters.get('name')}!") + +chocs.serve(http) +``` + +> Keep in mind that the `chocs.serve()` function is using the `bjoern` package, so make sure you included it in your project +> dependencies before using it. You are able to use any WSGI compatible server. + +## Available middlewares + +### OpenAPI Integration middleware + +Allows integrating OpenAPI documentation into your codebase, providing automating request validation based +on your OpenAPI spec. More details are available in the [chocs-openapi repository](https://github.com/kodemore/chocs-openapi). + +### ParsedBody middleware + +Parsed body middleware helps to convert json/yaml request payloads into dataclass, this not only makes your +daily tasks easier but increases readability of your code and contract. More details are available in the [chocs-parsed-body repository](https://github.com/kodemore/chocs-parsed-body). + + +# Documentation +For usage and detailed documentation please visit our [wiki page](https://github.com/kodemore/chocs/wiki) + + +%package help +Summary: Development documents and examples for chocs +Provides: python3-chocs-doc +%description help +<img align="right" width=300 src="https://github.com/kodemore/chocs/raw/master/chocs.png"> + +# Chocs <br>[](https://pypi.org/project/chocs/)   [](https://codecov.io/gh/kodemore/chocs) [](https://codeclimate.com/github/kodemore/chocs/maintainability) + +Chocs is a modern HTTP framework for building AWS HTTP API/REST API and WSGI compatible applications. +Chocs aims to be small, expressive, and robust. +It provides an elegant API for writing fault-proof, extensible microservices. + + +## Features + + - AWS Serverless integration + - Elegant and easy API + - No additional bloat like built-in template engines, session handlers, etc. + - Compatible with all WSGI servers + - Loosely coupled components which can be used separately + - Multipart body parsing + - Graceful error handling + - HTTP middleware support + - Fast routing + - Middleware packages to simplify daily tasks + +## Installation +``` +pip install chocs +``` + +or with poetry + +``` +poetry add chocs +``` + +## Quick start + +```python +import chocs + +http = chocs.Application() + +@http.get("/hello/{name}") +def hello(request: chocs.HttpRequest) -> chocs.HttpResponse: + return chocs.HttpResponse(f"Hello {request.path_parameters.get('name')}!") + +chocs.serve(http) +``` + +> Keep in mind that the `chocs.serve()` function is using the `bjoern` package, so make sure you included it in your project +> dependencies before using it. You are able to use any WSGI compatible server. + +## Available middlewares + +### OpenAPI Integration middleware + +Allows integrating OpenAPI documentation into your codebase, providing automating request validation based +on your OpenAPI spec. More details are available in the [chocs-openapi repository](https://github.com/kodemore/chocs-openapi). + +### ParsedBody middleware + +Parsed body middleware helps to convert json/yaml request payloads into dataclass, this not only makes your +daily tasks easier but increases readability of your code and contract. More details are available in the [chocs-parsed-body repository](https://github.com/kodemore/chocs-parsed-body). + + +# Documentation +For usage and detailed documentation please visit our [wiki page](https://github.com/kodemore/chocs/wiki) + + +%prep +%autosetup -n chocs-1.6.1 + +%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-chocs -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.6.1-1 +- Package Spec generated |
