Compare commits
No commits in common. "9029d09560d4186bf9757db0fcbb2cac8a265c6a" and "c9a230e0dcebeac3b345058288fd3982a4dae3d7" have entirely different histories.
9029d09560
...
c9a230e0dc
@ -1,35 +0,0 @@
|
|||||||
From f3d5f8f724767075854d3d657875e658bbff9a74 Mon Sep 17 00:00:00 2001
|
|
||||||
From: shixuantong <shixuantong@huawei.com>
|
|
||||||
Date: Sat, 9 Apr 2022 23:15:27 +0800
|
|
||||||
Subject: [PATCH] Remove installation dependency on six
|
|
||||||
|
|
||||||
The python2 life cycle is over and we can give up support for python2. Therefore, we no longer need to rely on the six module.
|
|
||||||
---
|
|
||||||
requests_file.py | 6 ++++--
|
|
||||||
requirements.txt | 1 -
|
|
||||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/requests_file.py b/requests_file.py
|
|
||||||
index 7464e55..d9bf5b8 100644
|
|
||||||
--- a/requests_file.py
|
|
||||||
+++ b/requests_file.py
|
|
||||||
@@ -6,8 +6,10 @@
|
|
||||||
import stat
|
|
||||||
import locale
|
|
||||||
import io
|
|
||||||
-
|
|
||||||
-from six import BytesIO
|
|
||||||
+try:
|
|
||||||
+ from io import BytesIO
|
|
||||||
+except ImportError:
|
|
||||||
+ from StringIO import StringIO as BytesIO
|
|
||||||
|
|
||||||
|
|
||||||
class FileAdapter(BaseAdapter):
|
|
||||||
diff --git a/requirements.txt b/requirements.txt
|
|
||||||
index 0f255c9..5a687fa 100644
|
|
||||||
--- a/requirements.txt
|
|
||||||
+++ b/requirements.txt
|
|
||||||
@@ -1,2 +1 @@
|
|
||||||
requests>=1.0.0
|
|
||||||
-six
|
|
||||||
@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
Name: python-%{_name}
|
Name: python-%{_name}
|
||||||
Version: 1.5.1
|
Version: 1.5.1
|
||||||
Release: 5
|
Release: 1
|
||||||
Summary: A transport adapter for use with the Requests Python library
|
Summary: A transport adapter for use with the Requests Python library
|
||||||
License: Apache-2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/dashea/requests-file
|
URL: https://github.com/dashea/requests-file
|
||||||
Source0: https://github.com/dashea/%{_name}/archive/%{version}.tar.gz
|
Source0: https://github.com/dashea/%{_name}/archive/%{_name}-%{version}.tar.gz
|
||||||
|
|
||||||
Patch6000: backport-Remove-installation-dependency-on-six.patch
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -16,11 +14,21 @@ BuildArch: noarch
|
|||||||
Requests-File is a transport adapter for use with the Requests Python library
|
Requests-File is a transport adapter for use with the Requests Python library
|
||||||
to allow local filesystem access via file:// URLs.
|
to allow local filesystem access via file:// URLs.
|
||||||
|
|
||||||
|
%package -n python2-%{_name}
|
||||||
|
Summary: python2 version of %{summary}
|
||||||
|
BuildRequires: python2-devel python2-setuptools python2-pytest
|
||||||
|
BuildRequires: python2-requests python2-six
|
||||||
|
Requires: python2-requests python2-six
|
||||||
|
%{?python_provide:%python_provide python2-%{_name}}
|
||||||
|
|
||||||
|
%description -n python2-%{_name}
|
||||||
|
python2 binds of python-%{_name}.
|
||||||
|
|
||||||
%package -n python3-%{_name}
|
%package -n python3-%{_name}
|
||||||
Summary: python3 version of %{summary}
|
Summary: python3 version of %{summary}
|
||||||
BuildRequires: python3-devel python3-setuptools python3-pytest
|
BuildRequires: python3-devel python3-setuptools python3-pytest
|
||||||
BuildRequires: python3-requests python3-six
|
BuildRequires: python3-requests python3-six
|
||||||
Requires: python3-requests
|
Requires: python3-requests python3-six
|
||||||
%{?python_provide:%python_provide python3-%{_name}}
|
%{?python_provide:%python_provide python3-%{_name}}
|
||||||
|
|
||||||
%description -n python3-%{_name}
|
%description -n python3-%{_name}
|
||||||
@ -30,15 +38,24 @@ python3 binds of python-%{_name}.
|
|||||||
%autosetup -n %{_name}-%{version} -p1
|
%autosetup -n %{_name}-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%py2_build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%py2_install
|
||||||
%py3_install
|
%py3_install
|
||||||
|
|
||||||
%check
|
%check
|
||||||
export PYTHONPATH=%{buildroot}%{python3_sitelib}
|
export PYTHONPATH=%{buildroot}%{python3_sitelib}
|
||||||
|
%{__python2} tests/test_requests_file.py
|
||||||
%{__python3} tests/test_requests_file.py
|
%{__python3} tests/test_requests_file.py
|
||||||
|
|
||||||
|
%files -n python2-%{_name}
|
||||||
|
%doc README.rst
|
||||||
|
%license LICENSE
|
||||||
|
%{python2_sitelib}/*.py*
|
||||||
|
%{python2_sitelib}/*info*
|
||||||
|
|
||||||
%files -n python3-%{_name}
|
%files -n python3-%{_name}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
@ -47,19 +64,7 @@ export PYTHONPATH=%{buildroot}%{python3_sitelib}
|
|||||||
%{python3_sitelib}/*info*
|
%{python3_sitelib}/*info*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Aug 04 2022 shixuantong <shixuantong@h-partners.com> - 1.5.1-5
|
* Thu Jul 28 2020 tianwei <tianwei12@huawei.com> - 1.5.1-1
|
||||||
- Modify the license
|
|
||||||
|
|
||||||
* Thu Aug 04 2022 shixuantong <shixuantong@h-partners.com> - 1.5.1-4
|
|
||||||
- Remove installation dependency on six
|
|
||||||
|
|
||||||
* Fri Oct 30 2020 tianwei <tianwei12@huawei.com> - 1.5.1-3
|
|
||||||
- remove python2
|
|
||||||
|
|
||||||
* Tue Sep 8 2020 shixuantong <shixuantong@huawei.com> - 1.5.1-2
|
|
||||||
- update Source0
|
|
||||||
|
|
||||||
* Wed Jul 29 2020 tianwei <tianwei12@huawei.com> - 1.5.1-1
|
|
||||||
- Package update to 1.5.1
|
- Package update to 1.5.1
|
||||||
|
|
||||||
* Fri Oct 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.4.3-9
|
* Fri Oct 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.4.3-9
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user