From abc9ea1d587ec1efbf1284c8c4762817053dbd6108dabb513b03ce3248113c57 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 20 May 2023 21:59:47 +0000 Subject: [PATCH] Accepting request 1088042 from home:bnavigator:branches:devel:languages:python - Provide the PyPI name: python-oci - Use pep517 macros instead of deprecated direct setup.py calls - Update deps patch - Add rpmlintrc for devendored package requirements OBS-URL: https://build.opensuse.org/request/show/1088042 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-oci-sdk?expand=0&rev=97 --- ops_fixture-order.patch | 26 ++++++++++-------- ops_relax-python-depends.patch | 50 ++++------------------------------ python-oci-sdk.changes | 8 ++++++ python-oci-sdk.rpmlintrc | 8 ++++++ python-oci-sdk.spec | 29 +++++++++++--------- 5 files changed, 51 insertions(+), 70 deletions(-) create mode 100644 python-oci-sdk.rpmlintrc diff --git a/ops_fixture-order.patch b/ops_fixture-order.patch index 3a9924b..e9de4ca 100644 --- a/ops_fixture-order.patch +++ b/ops_fixture-order.patch @@ -1,6 +1,7 @@ -diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_basic_api_calls.py oci-python-sdk-2.17.2/tests/unit/test_basic_api_calls.py ---- oci-python-sdk-2.17.2.orig/tests/unit/test_basic_api_calls.py 2020-07-07 23:40:28.000000000 +0200 -+++ oci-python-sdk-2.17.2/tests/unit/test_basic_api_calls.py 2020-07-14 11:04:06.710713773 +0200 +Index: oci-python-sdk-2.102.0/tests/unit/test_basic_api_calls.py +=================================================================== +--- oci-python-sdk-2.102.0.orig/tests/unit/test_basic_api_calls.py ++++ oci-python-sdk-2.102.0/tests/unit/test_basic_api_calls.py @@ -5,7 +5,7 @@ import oci @@ -10,7 +11,7 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_basic_api_calls.py oci-pyth response = identity.list_users(config["tenancy"]) assert response is not None -@@ -31,7 +31,7 @@ +@@ -31,7 +31,7 @@ def test_vcn_list_instances(compute, con assert response.request_id is not None @@ -19,10 +20,11 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_basic_api_calls.py oci-pyth response = identity.list_users(config["tenancy"], limit=1) assert response is not None -diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py oci-python-sdk-2.17.2/tests/unit/test_waiters.py ---- oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py 2020-07-07 23:40:28.000000000 +0200 -+++ oci-python-sdk-2.17.2/tests/unit/test_waiters.py 2020-07-14 11:04:11.938762342 +0200 -@@ -109,7 +109,7 @@ +Index: oci-python-sdk-2.102.0/tests/unit/test_waiters.py +=================================================================== +--- oci-python-sdk-2.102.0.orig/tests/unit/test_waiters.py ++++ oci-python-sdk-2.102.0/tests/unit/test_waiters.py +@@ -112,7 +112,7 @@ def test_wait_multiple_states(virtual_ne assert total_time < 60 * 5 @@ -31,7 +33,7 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py oci-python-sdk-2 # Create User request = oci.identity.models.CreateUserDetails() request.compartment_id = config["tenancy"] -@@ -132,7 +132,7 @@ +@@ -135,7 +135,7 @@ def test_invalid_operation(identity, con oci.wait_until(identity, response, 'not a real property', 'test') @@ -40,7 +42,7 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py oci-python-sdk-2 description = 'test user' request = oci.identity.models.CreateUserDetails() request.compartment_id = config["tenancy"] -@@ -152,7 +152,7 @@ +@@ -155,7 +155,7 @@ def test_already_in_state(identity, conf identity.delete_user(user_id) @@ -49,7 +51,7 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py oci-python-sdk-2 description = 'test user' request = oci.identity.models.CreateUserDetails() request.compartment_id = config["tenancy"] -@@ -183,7 +183,7 @@ +@@ -182,7 +182,7 @@ def test_property_and_eval_function_prov assert str(ve.value) == 'Invalid wait_until configuration - can not provide both evaluate_response function and property argument, only one should be specified' @@ -58,7 +60,7 @@ diff -Nru oci-python-sdk-2.17.2.orig/tests/unit/test_waiters.py oci-python-sdk-2 user_id = None try: description = 'test user' -@@ -207,7 +207,7 @@ +@@ -206,7 +206,7 @@ def test_eval_function_lambda(identity, identity.delete_user(user_id) diff --git a/ops_relax-python-depends.patch b/ops_relax-python-depends.patch index 28b19b1..41c0fd0 100644 --- a/ops_relax-python-depends.patch +++ b/ops_relax-python-depends.patch @@ -1,48 +1,8 @@ -diff -Nru oci-python-sdk-2.100.0.orig/requirements.txt oci-python-sdk-2.100.0/requirements.txt ---- oci-python-sdk-2.100.0.orig/requirements.txt 2023-05-02 19:32:42.000000000 +0200 -+++ oci-python-sdk-2.100.0/requirements.txt 2023-05-04 14:06:52.419132999 +0200 -@@ -1,21 +1,21 @@ --autodocsumm==0.1.11 -+autodocsumm>=0.1.11 - certifi --coverage==4.5.2 --cryptography>=3.2.1,<40.0.0 --flake8>=3.6.0,<6 --mock==2.0.0 --pyOpenSSL>=17.5.0,<24.0.0 --pytest==4.1.0 --pytest-cov==2.6.1 --attrs==19.1.0 --python-dateutil>=2.5.3,<=2.7.3 -+coverage>=4.5.2 -+cryptography>=3.2.1 -+flake8>=3.6.0 -+mock>=2.0.0 -+pyOpenSSL>=17.5.0 -+pytest>=4.1.0 -+pytest-cov>=2.6.1 -+attrs>=19.1.0 -+python-dateutil>=2.5.3 - pytz>=2016.10 --sphinx-rtd-theme==0.4.2 --sphinx==1.8.3 --tox==3.14.3 --virtualenv==16.7.9 --vcrpy==2.0.1 -+sphinx-rtd-theme>=0.4.2 -+sphinx>=1.8.3 -+tox>=3.14.3 -+virtualenv>=16.7.9 -+vcrpy>=2.0.1 - wheel<=0.39.0 --circuitbreaker>=1.3.1,<2.0.0 -+circuitbreaker>=1.3.1 - docutils<0.18 - Jinja2<3.1 -diff -Nru oci-python-sdk-2.100.0.orig/setup.py oci-python-sdk-2.100.0/setup.py ---- oci-python-sdk-2.100.0.orig/setup.py 2023-05-02 19:32:42.000000000 +0200 -+++ oci-python-sdk-2.100.0/setup.py 2023-05-04 14:07:27.495304762 +0200 -@@ -31,12 +31,12 @@ +Index: oci-python-sdk-2.102.0/setup.py +=================================================================== +--- oci-python-sdk-2.102.0.orig/setup.py ++++ oci-python-sdk-2.102.0/setup.py +@@ -31,12 +31,12 @@ with open_relative("README.rst") as f: requires = [ "certifi", diff --git a/python-oci-sdk.changes b/python-oci-sdk.changes index 6ac75a2..28fd287 100644 --- a/python-oci-sdk.changes +++ b/python-oci-sdk.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 20 09:34:05 UTC 2023 - Ben Greiner + +- Provide the PyPI name: python-oci +- Use pep517 macros instead of deprecated direct setup.py calls +- Update deps patch +- Add rpmlintrc for devendored package requirements + ------------------------------------------------------------------- Fri May 19 12:57:29 UTC 2023 - John Paul Adrian Glaubitz diff --git a/python-oci-sdk.rpmlintrc b/python-oci-sdk.rpmlintrc new file mode 100644 index 0000000..44ab3d3 --- /dev/null +++ b/python-oci-sdk.rpmlintrc @@ -0,0 +1,8 @@ +# devendored packages are extra requirements +addFilter("python-leftover-require python[0-9]+-PyJWT") +addFilter("python-leftover-require python[0-9]+-httpsig_cffi") +addFilter("python-leftover-require python[0-9]+-requests") +addFilter("python-leftover-require python[0-9]+-six") +addFilter("python-leftover-require python[0-9]+-urllib3") +# python2 only: rpmlint does not understand the python marker yet +addFilter("python-missing-require configparser") diff --git a/python-oci-sdk.spec b/python-oci-sdk.spec index 906ba65..e9eb47d 100644 --- a/python-oci-sdk.spec +++ b/python-oci-sdk.spec @@ -25,34 +25,36 @@ License: Apache-2.0 OR UPL-1.0 Group: Development/Languages/Python URL: https://github.com/oracle/oci-python-sdk Source: %{url}/archive/v%{version}.tar.gz#/oci-python-sdk-%{version}.tar.gz +Source99: python-oci-sdk.rpmlintrc Patch0: ops_relax-python-depends.patch Patch1: ops_fixture-order.patch -BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-PyJWT Requires: python-certifi Requires: python-circuitbreaker >= 1.3.1 -Requires: python-cryptography -Requires: python-httpsig_cffi +Requires: python-cryptography >= 3.2.1 Requires: python-pyOpenSSL >= 17.5.0 -Requires: python-python-dateutil < 3.0.0 Requires: python-python-dateutil >= 2.5.3 Requires: python-pytz >= 2016.10 +# SECTION devendored packages +Requires: python-PyJWT +Requires: python-httpsig_cffi Requires: python-requests Requires: python-six Requires: python-urllib3 < 2 +# /SECTION BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module PyJWT} BuildRequires: %{python_module certifi} BuildRequires: %{python_module circuitbreaker >= 1.3.1} -BuildRequires: %{python_module cryptography} +BuildRequires: %{python_module cryptography >= 3.2.1} BuildRequires: %{python_module httpsig_cffi} BuildRequires: %{python_module pyOpenSSL >= 17.5.0} BuildRequires: %{python_module pytest > 4.1.0} -BuildRequires: %{python_module python-dateutil < 3.0.0} BuildRequires: %{python_module python-dateutil >= 2.5.3} BuildRequires: %{python_module pytz >= 2016.10} BuildRequires: %{python_module requests} @@ -60,12 +62,14 @@ BuildRequires: %{python_module six} BuildRequires: %{python_module urllib3 < 2} BuildRequires: %{python_module vcrpy >= 2.0.1} %if %{with python2} -BuildRequires: python-configparser +BuildRequires: python-configparser >= 4.0.2 %endif # /SECTION %ifpython2 -Requires: python-configparser +Requires: python-configparser >= 4.0.2 %endif +# The PyPI name is just oci +Provides: python-oci = %{version}-%{release} %python_subpackages %description @@ -85,14 +89,13 @@ sed -i 's/oci\._vendor\.//' src/oci/*.py src/oci/auth/*.py src/oci/auth/signers/ sed -i 's/from . import vcr_mods//' tests/test_config_container.py %build -%python_build +%pyproject_wheel %check -export PYTHONDONTWRITEBYTECODE=1 -%pytest tests/unit tests/integ -s +%pytest tests/unit tests/integ -s -rs %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %files %{python_files}