diff --git a/.gitignore b/.gitignore index 3a80f9c..c8525ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -SOURCES/botocore-1.8.35.tar.gz +SOURCES/botocore-1.23.46.tar.gz SOURCES/futures-3.0.3.tar.gz SOURCES/jmespath-0.9.0.tar.gz SOURCES/s3transfer-0.1.13.tar.gz +SOURCES/urllib3-1.26.8.tar.gz diff --git a/.python-s3transfer.metadata b/.python-s3transfer.metadata index ac279bd..5570e56 100644 --- a/.python-s3transfer.metadata +++ b/.python-s3transfer.metadata @@ -1,4 +1,5 @@ -c840d5ad691cb1558d3c194b03d7059ba7c51808 SOURCES/botocore-1.8.35.tar.gz +2512ff4ef016cad0b916006f6acf2a309f908c4d SOURCES/botocore-1.23.46.tar.gz dc5271473c4b8eda549b66339bee0f916cce1e92 SOURCES/futures-3.0.3.tar.gz 642800c1bc901a440639d5743c9cd74ba59c2d4a SOURCES/jmespath-0.9.0.tar.gz a20649f9ae6b363fd8064b3b45c1227db8162e81 SOURCES/s3transfer-0.1.13.tar.gz +55f71da2d6ac16ef5a36510ec3efd112f17f2cea SOURCES/urllib3-1.26.8.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 2c2ae43..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This package must be built against the NOARCH arch and not individual arches: -https://bugs.centos.org/view.php?id=15518 diff --git a/SOURCES/botocore-1.8.35-fix_dateutil_version.patch b/SOURCES/botocore-1.8.35-fix_dateutil_version.patch deleted file mode 100644 index c2d9fe7..0000000 --- a/SOURCES/botocore-1.8.35-fix_dateutil_version.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -ur botocore-1.5.3.orig/requirements.txt botocore-1.5.3/requirements.txt ---- botocore-1.5.3.orig/requirements.txt 2017-01-20 11:06:07.081344531 +0000 -+++ botocore-1.5.3/requirements.txt 2017-01-20 11:06:56.409021742 +0000 -@@ -1,5 +1,5 @@ - tox>=2.5.0,<3.0.0 --python-dateutil>=2.1,<3.0.0 -+python-dateutil>=1.4,<3.0.0 - nose==1.3.0 - mock==1.3.0 - wheel==0.24.0 -diff -ur botocore-1.5.3.orig/setup.cfg botocore-1.5.3/setup.cfg ---- botocore-1.5.3.orig/setup.cfg 2017-01-20 11:06:07.082344504 +0000 -+++ botocore-1.5.3/setup.cfg 2017-01-20 11:07:15.994496531 +0000 -@@ -3,7 +3,7 @@ - - [metadata] - requires-dist = -- python-dateutil>=2.1,<3.0.0 -+ python-dateutil>=1.4,<3.0.0 - jmespath>=0.7.1,<1.0.0 - docutils>=0.10 - ordereddict==1.1; python_version=="2.6" -diff -ur botocore-1.5.3.orig/setup.py botocore-1.5.3/setup.py ---- botocore-1.5.3.orig/setup.py 2017-01-20 11:06:07.078344611 +0000 -+++ botocore-1.5.3/setup.py 2017-01-20 11:07:27.367191557 +0000 -@@ -6,7 +6,7 @@ - - - requires = ['jmespath>=0.7.1,<1.0.0', -- 'python-dateutil>=2.1,<3.0.0', -+ 'python-dateutil>=1.4,<3.0.0', - 'docutils>=0.10'] - - diff --git a/SOURCES/python2-fixes.patch b/SOURCES/python2-fixes.patch new file mode 100644 index 0000000..72f2299 --- /dev/null +++ b/SOURCES/python2-fixes.patch @@ -0,0 +1,70 @@ +diff --color -uNr a/bundled/botocore/botocore/auth.py b/bundled/botocore/botocore/auth.py +--- a/bundled/botocore/botocore/auth.py 2022-01-28 20:04:06.000000000 +0100 ++++ b/bundled/botocore/botocore/auth.py 2022-02-02 14:07:03.675549498 +0100 +@@ -120,7 +120,7 @@ + value = six.text_type(params[key]) + quoted_key = quote(key.encode('utf-8'), safe='') + quoted_value = quote(value.encode('utf-8'), safe='-_~') +- pairs.append(f'{quoted_key}={quoted_value}') ++ pairs.append(quoted_key + "=" + quoted_value) + qs = '&'.join(pairs) + string_to_sign += qs + logger.debug('String to sign: %s', string_to_sign) +diff --color -uNr a/bundled/botocore/botocore/configprovider.py b/bundled/botocore/botocore/configprovider.py +--- a/bundled/botocore/botocore/configprovider.py 2022-01-28 20:04:06.000000000 +0100 ++++ b/bundled/botocore/botocore/configprovider.py 2022-02-02 14:07:03.676549502 +0100 +@@ -460,7 +460,7 @@ + mode) + for config_var in default_configs: + config_value = default_configs[config_var] +- method = getattr(self, f'_set_{config_var}', None) ++ method = getattr(self, "_set_" + config_var, None) + if method: + method(config_store, config_value) + +diff --color -uNr a/bundled/botocore/botocore/credentials.py b/bundled/botocore/botocore/credentials.py +--- a/bundled/botocore/botocore/credentials.py 2022-01-28 20:04:06.000000000 +0100 ++++ b/bundled/botocore/botocore/credentials.py 2022-02-02 14:07:03.678549509 +0100 +@@ -22,7 +22,6 @@ + from collections import namedtuple + from copy import deepcopy + from hashlib import sha1 +-from pathlib import Path + + from dateutil.parser import parse + from dateutil.tz import tzlocal, tzutc +@@ -311,8 +310,8 @@ + def __delitem__(self, cache_key): + actual_key = self._convert_cache_key(cache_key) + try: +- key_path = Path(actual_key) +- key_path.unlink() ++ key_path = actual_key ++ os.unlink(key_path) + except FileNotFoundError: + raise KeyError(cache_key) + +diff --color -uNr a/bundled/botocore/botocore/utils.py b/bundled/botocore/botocore/utils.py +--- a/bundled/botocore/botocore/utils.py 2022-01-28 20:04:06.000000000 +0100 ++++ b/bundled/botocore/botocore/utils.py 2022-02-02 14:07:03.679549513 +0100 +@@ -420,7 +420,7 @@ + sep = '' + if self._base_url and not self._base_url.endswith('/'): + sep = '/' +- return f'{self._base_url}{sep}{path}' ++ return self._base_url + sep + path + + def _fetch_metadata_token(self): + self._assert_enabled() +diff --color -uNr a/bundled/urllib3/setup.py b/bundled/urllib3/setup.py +--- a/bundled/urllib3/setup.py 2022-01-07 16:55:55.000000000 +0100 ++++ b/bundled/urllib3/setup.py 2022-02-02 15:36:25.108600398 +0100 +@@ -91,7 +91,7 @@ + "cryptography>=1.3.4", + "idna>=2.0.0", + "certifi", +- "ipaddress; python_version=='2.7'", ++ "ipaddress", + ], + "socks": ["PySocks>=1.5.6,<2.0,!=1.5.7"], + }, diff --git a/SPECS/python-s3transfer.spec b/SPECS/python-s3transfer.spec index b75bc56..09ac45d 100644 --- a/SPECS/python-s3transfer.spec +++ b/SPECS/python-s3transfer.spec @@ -7,6 +7,8 @@ %bcond_without tests %endif +%define __python /usr/bin/python2 + %global pypi_name s3transfer %global bundled_lib_dir bundled @@ -14,15 +16,18 @@ %global futures_version 3.0.3 %global futures_dir %{bundled_lib_dir}/futures # python-botocore -%global botocore_version 1.8.35 +%global botocore_version 1.23.46 %global botocore_dir %{bundled_lib_dir}/botocore # python-jmespath %global jmespath_version 0.9.0 %global jmespath_dir %{bundled_lib_dir}/jmespath +# python-urllib3 +%global urllib3_version 1.26.8 +%global urllib3_dir %{bundled_lib_dir}/urllib3 Name: python-%{pypi_name} Version: 0.1.13 -Release: 1%{?dist} +Release: 1%{?dist}.2 Summary: An Amazon S3 Transfer Manager License: ASL 2.0 @@ -31,14 +36,16 @@ Source0: %{pypi_name}-%{version}.tar.gz Source1: https://pypi.python.org/packages/source/f/futures/futures-%{futures_version}.tar.gz Source2: https://pypi.io/packages/source/b/botocore/botocore-%{botocore_version}.tar.gz Source3: https://pypi.python.org/packages/source/j/jmespath/jmespath-%{jmespath_version}.tar.gz +Source4: https://github.com/urllib3/urllib3/archive/%{urllib3_version}/urllib3-%{urllib3_version}.tar.gz + Patch0: bundled-futures-botocore-jmespath.patch -Patch1: botocore-1.8.35-fix_dateutil_version.patch +Patch1: python2-fixes.patch BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools -Obsoletes: python2-%{pypi_name} +Obsoletes: python2-%{pypi_name} <= %{version} %if %{with tests} BuildRequires: python-nose BuildRequires: python-mock @@ -61,6 +68,8 @@ Provides: bundled(python-botocore) = %{botocore_version} Provides: bundled(python-jmespath) = %{jmespath_version} Requires: python-dateutil >= 1.4 Requires: python-docutils >= 0.10 +# python-urllib3 bundle +Provides: bundled(python-urllib3) = %{urllib3_version} %description S3transfer is a Python library for managing Amazon S3 transfers. @@ -107,16 +116,20 @@ cp %{botocore_dir}/README.rst botocore_README.rst # python-jmespath bundle tar -xzf %SOURCE3 -C %{bundled_lib_dir} mv %{bundled_lib_dir}/jmespath-%{jmespath_version} %{jmespath_dir} -cp %{botocore_dir}/LICENSE.txt jmespath_LICENSE.txt -cp %{botocore_dir}/README.rst jmespath_README.rst +cp %{jmespath_dir}/LICENSE.txt jmespath_LICENSE.txt +cp %{jmespath_dir}/README.rst jmespath_README.rst + +# python-urllib3 bundle +tar -xzf %SOURCE4 -C %{bundled_lib_dir} +mv %{bundled_lib_dir}/urllib3-%{urllib3_version} %{urllib3_dir} +cp %{urllib3_dir}/LICENSE.txt urllib3_LICENSE.txt +cp %{urllib3_dir}/README.rst urllib3_README.rst # append bundled-directory to search path %patch0 -p1 +%patch1 -p1 pushd %{botocore_dir} -%patch1 -p1 -sed -i -e '1 d' botocore/vendored/requests/packages/chardet/chardetect.py -sed -i -e '1 d' botocore/vendored/requests/certs.py rm -rf botocore.egg-info # Remove online tests rm -rf tests/integration @@ -144,7 +157,12 @@ popd # python-jmespath bundle pushd %{jmespath_dir} -CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s" +CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s" +popd + +# python-urllib3 bundle +pushd %{urllib3_dir} +CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s" popd %install @@ -155,22 +173,27 @@ popd # python-futures bundle pushd %{futures_dir} -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_usr}/lib/fence-agents/bundled popd # python-botocore bundle pushd %{botocore_dir} -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_usr}/lib/fence-agents/bundled popd # python-jmespath bundle pushd %{jmespath_dir} -CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled +CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-lib %{_usr}/lib/fence-agents/bundled mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version} ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2 ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py popd +# python-urllib3 bundle +pushd %{urllib3_dir} +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_usr}/lib/fence-agents/bundled +popd + %if %{with tests} %check nosetests-%{python2_version} --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/ @@ -186,7 +209,7 @@ nosetests-%{python3_version} --with-coverage --cover-erase --cover-package s3tra %{python_sitelib}/%{pypi_name} %{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info # python-futures and python-botocore bundles -%{_libdir}/fence-agents/bundled +%{_usr}/lib/fence-agents/bundled %exclude %{_bindir}/jp.py* %if %{with python3} @@ -198,6 +221,11 @@ nosetests-%{python3_version} --with-coverage --cover-erase --cover-package s3tra %endif # python3 %changelog +* Tue Feb 22 2022 Oyvind Albrigtsen - 0.1.13-1.2 +- Upgrade python-botocore to fix IMDSv2 support + + Resolves: rhbz#2050751 + * Thu May 24 2018 Oyvind Albrigtsen - 0.1.13-1 - Fix "python2-s3transfer" from EPEL issue by adding it to Obsoletes - Rebase to v0.1.13 to fix missing "max_bandwidth" issue