python-urllib3/python-urllib3.spec

79 lines
2.5 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:15:38 -04:00
%global srcname urllib3
%bcond_without tests
Name: python-%{srcname}
2020-07-28 17:58:04 +08:00
Version: 1.25.9
Release: 1
2019-09-30 11:15:38 -04:00
Summary: Sanity-friendly HTTP client for Python
License: MIT
URL: https://urllib3.readthedocs.io
2020-07-28 17:58:04 +08:00
Source0: https://github.com/urllib3/urllib3/archive/%{version}/%{version}.tar.gz
2019-09-30 11:15:38 -04:00
Source1: ssl_match_hostname_py3.py
BuildArch: noarch
2020-07-28 17:58:04 +08:00
%description
HTTP library with thread-safe connection pooling, file post support, sanity friendly, and more.
2019-09-30 11:15:38 -04:00
%package -n python3-%{srcname}
Summary: Python3 HTTP library with thread-safe connection pooling and file post
BuildRequires: python3-devel
2020-07-28 17:58:04 +08:00
BuildRequires: python3-setuptools
2019-09-30 11:15:38 -04:00
%if %{with tests}
2020-07-28 17:58:04 +08:00
BuildRequires: python3-nose python3-mock python3-six python3-idna
BuildRequires: python3-pysocks python3-pytest python3-tornado python3-trustme
2019-09-30 11:15:38 -04:00
%endif
2020-07-28 17:58:04 +08:00
Requires: ca-certificates python3-idna python3-six python3-pysocks
2019-09-30 11:15:38 -04:00
%description -n python3-urllib3
2020-07-28 17:58:04 +08:00
Python3 HTTP module with connection pooling and file POST abilities.
2019-09-30 11:15:38 -04:00
%prep
%autosetup -n %{srcname}-%{version} -p1
#Failure use case circumvention
rm -rf test/with_dummyserver/
rm -rf test/appengine/
rm -rf test/contrib/
rm -rf test/test_no_ssl.py
%build
%py3_build
%install
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/six.py*
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/__pycache__/six*
rm -rf %{buildroot}%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/
%if %{with tests}
%check
PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pytest -v
%endif
%files -n python3-urllib3
%defattr(-,root,root)
%license LICENSE.txt
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{python3_sitelib}/urllib3/
%{python3_sitelib}/urllib3-*.egg-info
%changelog
2020-07-28 17:58:04 +08:00
* Tue Jul 28 2020 chengguipeng<chengguipeng@huawei.com> - 1.25.9-1
- upgrade to 1.25.9
2019-11-06 19:50:44 +08:00
* Sat Oct 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.24.3-2
- optimize spec file.
2019-09-30 11:15:38 -04:00
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.24.3-1
- Package init