From 3f046a3699d39db1b8cb527aeca87469de05f202 Mon Sep 17 00:00:00 2001 From: Robby Callicotte Date: Jul 31 2022 04:37:47 +0000 Subject: Updated spec to use distro-wide guidelines --- diff --git a/.gitignore b/.gitignore index 6264b61..9285e94 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /apache-libcloud-1.3.0.tar.gz /apache-libcloud-2.0.0rc2.tar.gz /apache-libcloud-2.2.1.tar.gz +/apache-libcloud-3.6.0.tar.gz diff --git a/000-async.patch b/000-async.patch deleted file mode 100644 index 588a92c..0000000 --- a/000-async.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru apache-libcloud-2.2.1/libcloud/compute/drivers/azure.py apache-libcloud-2.2.1_patched/libcloud/compute/drivers/azure.py ---- apache-libcloud-2.2.1/libcloud/compute/drivers/azure.py 2017-09-05 17:30:14.000000000 +0200 -+++ apache-libcloud-2.2.1_patched/libcloud/compute/drivers/azure.py 2018-07-16 14:43:35.384935707 +0200 -@@ -1435,7 +1435,7 @@ - - return response - -- def _perform_post(self, path, body, response_type=None, async=False): -+ def _perform_post(self, path, body, response_type=None, **kwargs): - request = AzureHTTPRequest() - request.method = 'POST' - request.host = AZURE_SERVICE_MANAGEMENT_HOST -@@ -1447,7 +1447,7 @@ - - return response - -- def _perform_put(self, path, body, response_type=None, async=False): -+ def _perform_put(self, path, body, response_type=None, **kwargs): - request = AzureHTTPRequest() - request.method = 'PUT' - request.host = AZURE_SERVICE_MANAGEMENT_HOST -@@ -1459,7 +1459,8 @@ - - return response - -- def _perform_delete(self, path, async=False): -+ def _perform_delete(self, path, **kwargs): -+ asynch = kwargs.get("async", False) - request = AzureHTTPRequest() - request.method = 'DELETE' - request.host = AZURE_SERVICE_MANAGEMENT_HOST -@@ -1470,7 +1471,7 @@ - - self.raise_for_response(response, 202) - -- if async: -+ if asynch: - return self._parse_response_for_async_op(response) - - def _perform_request(self, request): -Only in apache-libcloud-2.2.1_patched/libcloud/compute/drivers: .azure.py.swp diff --git a/000-remove-linter-deps.patch b/000-remove-linter-deps.patch new file mode 100644 index 0000000..f1179d2 --- /dev/null +++ b/000-remove-linter-deps.patch @@ -0,0 +1,46 @@ +diff -up apache-libcloud-3.6.0/requirements-tests.txt_patched apache-libcloud-3.6.0/requirements-tests.txt +--- apache-libcloud-3.6.0/requirements-tests.txt_patched 2022-07-30 21:45:35.012824729 -0500 ++++ apache-libcloud-3.6.0/requirements-tests.txt 2022-07-30 21:47:05.510409349 -0500 +@@ -1,15 +1,2 @@ +-pep8==1.7.1 +-flake8==4.0.1 +-astroid==2.11.4 +-pylint==2.13.8 +-codecov==2.1.12 +-coverage==4.5.4 + requests>=2.27.1 + requests_mock==1.9.3 +-pytest==7.0.1 +-pytest-xdist==2.5.0 +-pytest-benchmark[histogram]==3.4.1 +-cryptography==36.0.1 +-# NOTE: Only needed by nttcis loadbalancer driver +-pyopenssl==21.0.0 +-more-itertools==8.11.0 +diff -up apache-libcloud-3.6.0/tox.ini_patched apache-libcloud-3.6.0/tox.ini +--- apache-libcloud-3.6.0/tox.ini_patched 2022-07-30 21:45:44.749995227 -0500 ++++ apache-libcloud-3.6.0/tox.ini 2022-07-30 21:47:34.183911411 -0500 +@@ -9,7 +9,6 @@ passenv = TERM CI GITHUB_* DOCKER_* + deps = + -r{toxinidir}/requirements-tests.txt + fasteners +- libvirt-python==7.9.0 + basepython = + pypypy3: pypy3 + pypyjion: pyjion +@@ -323,7 +322,6 @@ deps = + paramiko==2.9.2 + pyopenssl==21.0.0 + python-dateutil +- libvirt-python==7.9.0 + fasteners + setenv = + CRYPTOGRAPHY_ALLOW_OPENSSL_102=1 +@@ -336,7 +334,6 @@ deps = + -r{toxinidir}/requirements-tests.txt + paramiko==2.9.2 + pyopenssl==21.0.0 +- libvirt-python==7.9.0 + fasteners + setenv = + CRYPTOGRAPHY_ALLOW_OPENSSL_102=1 diff --git a/python-libcloud.spec b/python-libcloud.spec index 9f2f29b..2c3a58a 100644 --- a/python-libcloud.spec +++ b/python-libcloud.spec @@ -1,66 +1,80 @@ -%global tarball_name apache-libcloud -%global srcname libcloud -%global eggname apache_libcloud -%global _description \ -libcloud is a client library for interacting with many of \ -the popular cloud server providers. It was created to make \ -it easy for developers to build products that work between \ -any of the services that it supports. +%global srcname apache-libcloud +%global shortname libcloud + +%global _description %{expand: +libcloud is a client library for interacting with many of +the popular cloud server providers. It was created to make +it easy for developers to build products that work between +any of the services that it supports.} # Don't duplicate the same documentation %global _docdir_fmt %{name} -Name: python-libcloud -Version: 2.2.1 -Release: 21%{?dist} +Name: python-%{shortname} +Version: 3.6.0 +Release: 1%{?dist} Summary: A Python library to address multiple cloud provider APIs License: ASL 2.0 URL: http://libcloud.apache.org/ -Source0: https://files.pythonhosted.org/packages/source/a/%{tarball_name}/%{tarball_name}-%{version}.tar.gz +Source0: %{pypi_source} +# This is a downstream only patch persuant to +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +Patch0: 000-remove-linter-deps.patch BuildArch: noarch %description %{_description} -%package -n python%{python3_pkgversion}-%{srcname} + +%package -n python3-%{shortname} Summary: %{summary} -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: python%{python3_pkgversion}-pytest-runner -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +BuildRequires: python3-devel -Patch0: 000-async.patch +%description -n python3-%{shortname} %{_description} -%description -n python%{python3_pkgversion}-%{srcname} %{_description} -Python 3 version. %prep -%autosetup -p1 -n %{tarball_name}-%{version} +%autosetup -p1 -n %{srcname}-%%{version} + +# Don't package the test suite. We dont run it anyway +# because it requires valid cloud credentials. +rm -r %{shortname}/test/ # Delete shebang lines in the demos sed -i '1d' demos/gce_demo.py demos/compute_demo.py -%build -%py3_build - # Fix permissions for demos chmod -x demos/gce_demo.py demos/compute_demo.py +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + %install -%py3_install +%pyproject_install +%pyproject_save_files %{shortname} -# Don't package the test suite. We dont run it anyway -# because it requires some valid cloud credentials -rm -r $RPM_BUILD_ROOT%{python3_sitelib}/%{srcname}/test -%files -n python%{python3_pkgversion}-%{srcname} +%files -n python3-%{shortname} -f %{pyproject_files} %doc README.rst demos/ %license LICENSE -%{python3_sitelib}/%{srcname}/ -%{python3_sitelib}/%{eggname}-*.egg-info/ + + +%check +%pyproject_check_import -t %{shortname} + %changelog +* Sun Jul 31 2022 Robby Callicotte - 3.6.0-1 +- Rebased to 3.6.0 +- Cleaned up spec +- Resolves rhbz#2013008 + * Fri Jul 22 2022 Fedora Release Engineering - 2.2.1-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index 835df90..cb2d7d9 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (apache-libcloud-2.2.1.tar.gz) = 97dc044d07888320655ea0cc16e21f61550f2c52a17464a45e6701841c03de315e94e520e50e112456869d2ae0c88e5c11175157660d1e81f2477f92ece0cb97 +SHA512 (apache-libcloud-3.6.0.tar.gz) = 40e49ec8adc1fde2d320286648d669369abd56d2fa94c9c8b646a324f4831f7b07bc2268d673d35b34bfe76825c71740f43083e06121d1f4259e84c59a1fb5c6