%global _empty_manifest_terminate_build 0
Name:		python-bareclient
Version:	5.0.1
Release:	1
Summary:	A lightweight asyncio HTTP client
License:	Apache-2.0
URL:		https://github.com/rob-blackbourn/bareClient
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/af/6b/23268543c1698b07fb5ab4765fa8e2d0f11c28cd9a0037cfc6a009b8621e/bareclient-5.0.1.tar.gz
BuildArch:	noarch

Requires:	python3-bareutils
Requires:	python3-h11
Requires:	python3-h2

%description
# bareClient

An asyncio HTTP Python client package supporting HTTP versions 1.0, 1.1
and 2 (read the [docs](https://rob-blackbourn.github.io/bareClient/)).

This is the client companion to the ASGI server side web framework
[bareASGI](https://github.com/rob-blackbourn/bareASGI) and follows the same
"bare" approach. It provides only the essential functionality and makes little
attempt to provide any helpful features which might do unnecessary work.

This package is suitable for:

- A foundation for async HTTP/2 clients,
- Async REST client API's,
- Containers requiring a small image size,
- Integration with ASGI web servers requiring async HTTP client access.

## Features

The client has the following notable features:

- Lightweight
- Uses asyncio
- Supports HTTP versions 1.0, 1.1, 2
- Supports middleware

## Installation

The package can be installed with pip.

```bash
pip install bareclient
```

This is a Python3.7 and later package.

It has dependencies on:

- [bareUtils](https://github.com/rob-blackbourn/bareUtils)
- [h11](https://github.com/python-hyper/h11)
- [h2](https://github.com/python-hyper/hyper-h2)

## Usage

The basic usage is to create an `HttpClient`.

```python
import asyncio
from typing import List, Optional
from bareclient import HttpClient

async def main(url: str) -> None:
    async with HttpClient(url) as response:
        if response.ok and response.more_body:
            async for part in response.body:
                print(part)

asyncio.run(main('https://docs.python.org/3/library/cgi.html'))
```


%package -n python3-bareclient
Summary:	A lightweight asyncio HTTP client
Provides:	python-bareclient
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-bareclient
# bareClient

An asyncio HTTP Python client package supporting HTTP versions 1.0, 1.1
and 2 (read the [docs](https://rob-blackbourn.github.io/bareClient/)).

This is the client companion to the ASGI server side web framework
[bareASGI](https://github.com/rob-blackbourn/bareASGI) and follows the same
"bare" approach. It provides only the essential functionality and makes little
attempt to provide any helpful features which might do unnecessary work.

This package is suitable for:

- A foundation for async HTTP/2 clients,
- Async REST client API's,
- Containers requiring a small image size,
- Integration with ASGI web servers requiring async HTTP client access.

## Features

The client has the following notable features:

- Lightweight
- Uses asyncio
- Supports HTTP versions 1.0, 1.1, 2
- Supports middleware

## Installation

The package can be installed with pip.

```bash
pip install bareclient
```

This is a Python3.7 and later package.

It has dependencies on:

- [bareUtils](https://github.com/rob-blackbourn/bareUtils)
- [h11](https://github.com/python-hyper/h11)
- [h2](https://github.com/python-hyper/hyper-h2)

## Usage

The basic usage is to create an `HttpClient`.

```python
import asyncio
from typing import List, Optional
from bareclient import HttpClient

async def main(url: str) -> None:
    async with HttpClient(url) as response:
        if response.ok and response.more_body:
            async for part in response.body:
                print(part)

asyncio.run(main('https://docs.python.org/3/library/cgi.html'))
```


%package help
Summary:	Development documents and examples for bareclient
Provides:	python3-bareclient-doc
%description help
# bareClient

An asyncio HTTP Python client package supporting HTTP versions 1.0, 1.1
and 2 (read the [docs](https://rob-blackbourn.github.io/bareClient/)).

This is the client companion to the ASGI server side web framework
[bareASGI](https://github.com/rob-blackbourn/bareASGI) and follows the same
"bare" approach. It provides only the essential functionality and makes little
attempt to provide any helpful features which might do unnecessary work.

This package is suitable for:

- A foundation for async HTTP/2 clients,
- Async REST client API's,
- Containers requiring a small image size,
- Integration with ASGI web servers requiring async HTTP client access.

## Features

The client has the following notable features:

- Lightweight
- Uses asyncio
- Supports HTTP versions 1.0, 1.1, 2
- Supports middleware

## Installation

The package can be installed with pip.

```bash
pip install bareclient
```

This is a Python3.7 and later package.

It has dependencies on:

- [bareUtils](https://github.com/rob-blackbourn/bareUtils)
- [h11](https://github.com/python-hyper/h11)
- [h2](https://github.com/python-hyper/hyper-h2)

## Usage

The basic usage is to create an `HttpClient`.

```python
import asyncio
from typing import List, Optional
from bareclient import HttpClient

async def main(url: str) -> None:
    async with HttpClient(url) as response:
        if response.ok and response.more_body:
            async for part in response.body:
                print(part)

asyncio.run(main('https://docs.python.org/3/library/cgi.html'))
```


%prep
%autosetup -n bareclient-5.0.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-bareclient -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 5.0.1-1
- Package Spec generated