From fc6b9a2ec5a7aae50ceda4e72a40872973c8fd157f757abbeb4bc3579d97924b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 28 Feb 2022 14:14:12 +0000 Subject: [PATCH] Accepting request 958036 from home:pgajdos:python - fix build, run tests - added patches fix https://github.com/thefactory/marathon-python/issues/284 + python-marathon-no-2to3.patch fix https://github.com/thefactory/marathon-python/commit/1850734b5b916d1455416833f0aed239b308dd9f.diff + python-marathon-use-collections.abc.patch OBS-URL: https://build.opensuse.org/request/show/958036 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-marathon?expand=0&rev=14 --- marathon-0.13.0.tar.gz | 4 ++-- python-marathon-no-2to3.patch | 21 +++++++++++++++++++++ python-marathon-use-collections.abc.patch | 15 +++++++++++++++ python-marathon.changes | 10 ++++++++++ python-marathon.spec | 18 ++++++++++++++---- 5 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 python-marathon-no-2to3.patch create mode 100644 python-marathon-use-collections.abc.patch diff --git a/marathon-0.13.0.tar.gz b/marathon-0.13.0.tar.gz index a0a3f51..239878f 100644 --- a/marathon-0.13.0.tar.gz +++ b/marathon-0.13.0.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:73fd9104cb5778b4cb1bb24601704beec6931133edc196ab2d6f81934d3dde0b -size 25846 +oid sha256:c0ac040a4b67cb649e52e897b47ba43e984c9ecff17727c9627f9dc4fb06ee0b +size 50507 diff --git a/python-marathon-no-2to3.patch b/python-marathon-no-2to3.patch new file mode 100644 index 0000000..95bdfbf --- /dev/null +++ b/python-marathon-no-2to3.patch @@ -0,0 +1,21 @@ +Index: marathon-0.13.0/setup.py +=================================================================== +--- marathon-0.13.0.orig/setup.py 2020-08-21 18:22:30.000000000 +0200 ++++ marathon-0.13.0/setup.py 2022-02-28 12:20:53.654551958 +0100 +@@ -2,10 +2,6 @@ + import sys + from setuptools import setup + +-extra = {} +-if sys.version_info >= (3,): +- extra['use_2to3'] = True +- + setup( + name='marathon', + version='0.13.0', +@@ -30,5 +26,4 @@ setup( + 'Programming Language :: Python', + 'Topic :: Software Development :: Libraries :: Python Modules' + ], +- **extra + ) diff --git a/python-marathon-use-collections.abc.patch b/python-marathon-use-collections.abc.patch new file mode 100644 index 0000000..0c86218 --- /dev/null +++ b/python-marathon-use-collections.abc.patch @@ -0,0 +1,15 @@ +diff --git a/marathon/util.py b/marathon/util.py +index d9f5664..af2932e 100644 +--- a/marathon/util.py ++++ b/marathon/util.py +@@ -1,4 +1,10 @@ +-import collections ++# collections.abc new as of 3.3, and collections is deprecated. collections ++# will be unavailable in 3.9 ++try: ++ import collections.abc as collections ++except ImportError: ++ import collections ++ + import datetime + import logging diff --git a/python-marathon.changes b/python-marathon.changes index 08a1662..748eb26 100644 --- a/python-marathon.changes +++ b/python-marathon.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Feb 28 11:36:47 UTC 2022 - pgajdos@suse.com + +- fix build, run tests +- added patches + fix https://github.com/thefactory/marathon-python/issues/284 + + python-marathon-no-2to3.patch + fix https://github.com/thefactory/marathon-python/commit/1850734b5b916d1455416833f0aed239b308dd9f.diff + + python-marathon-use-collections.abc.patch + ------------------------------------------------------------------- Wed Sep 16 11:16:02 UTC 2020 - Dirk Mueller diff --git a/python-marathon.spec b/python-marathon.spec index 94ddeeb..8853499 100644 --- a/python-marathon.spec +++ b/python-marathon.spec @@ -1,7 +1,7 @@ # # spec file for package python-marathon # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,15 @@ Summary: Marathon Client Library License: MIT Group: Development/Languages/Python URL: https://github.com/thefactory/marathon-python -Source: https://files.pythonhosted.org/packages/source/m/marathon/marathon-%{version}.tar.gz +Source: https://github.com/thefactory/marathon-python/archive/refs/tags/%{version}.tar.gz#/marathon-%{version}.tar.gz +# https://github.com/thefactory/marathon-python/issues/284 +Patch0: python-marathon-no-2to3.patch +# https://github.com/thefactory/marathon-python/commit/1850734b5b916d1455416833f0aed239b308dd9f.diff +Patch1: python-marathon-use-collections.abc.patch +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests-mock} +BuildRequires: %{python_module requests-toolbelt} +BuildRequires: %{python_module requests} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros Requires: python-requests >= 2.4.0 @@ -37,7 +45,9 @@ BuildArch: noarch Python interface to the Mesos Marathon REST API. %prep -%setup -q -n marathon-%{version} +%setup -q -n marathon-python-%{version} +%patch0 -p1 +%patch1 -p1 %build %python_build @@ -46,7 +56,7 @@ Python interface to the Mesos Marathon REST API. %python_install %check -# requires Docker and Marathon server installed there +%pytest %files %{python_files} %license LICENSE