From 3538e2b8349f532b3ee0b328d059e6bc6c91a213d7e9326d72864de0febe9f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 7 May 2020 13:03:48 +0000 Subject: [PATCH] Accepting request 801216 from home:mnhauke - Drop python2 - Add patch: * fix-tests.patch OBS-URL: https://build.opensuse.org/request/show/801216 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Glances?expand=0&rev=18 --- fix-tests.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ python-Glances.changes | 7 +++++++ python-Glances.spec | 4 ++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 fix-tests.patch diff --git a/fix-tests.patch b/fix-tests.patch new file mode 100644 index 0000000..248f626 --- /dev/null +++ b/fix-tests.patch @@ -0,0 +1,42 @@ +diff --git a/unitest-restful.py b/unitest-restful.py +index 7b77a2b..5f991bd 100755 +--- a/unitest-restful.py ++++ b/unitest-restful.py +@@ -22,6 +22,7 @@ + + import shlex + import subprocess ++import sys + import time + import numbers + import unittest +@@ -64,7 +65,7 @@ class TestGlances(unittest.TestCase): + global pid + + print('INFO: [TEST_000] Start the Glances Web Server') +- cmdline = "python -m glances -w -p %s" % SERVER_PORT ++ cmdline = "%s -m glances -w -p %s" % (sys.executable, SERVER_PORT) + print("Run the Glances Web Server on port %s" % SERVER_PORT) + args = shlex.split(cmdline) + pid = subprocess.Popen(args) +diff --git a/unitest-xmlrpc.py b/unitest-xmlrpc.py +index 7e52ec5..384fa46 100755 +--- a/unitest-xmlrpc.py ++++ b/unitest-xmlrpc.py +@@ -23,6 +23,7 @@ + import json + import shlex + import subprocess ++import sys + import time + import unittest + +@@ -53,7 +54,7 @@ class TestGlances(unittest.TestCase): + global pid + + print('INFO: [TEST_000] Start the Glances Web Server') +- cmdline = "python -m glances -s -p %s" % SERVER_PORT ++ cmdline = "%s -m glances -s -p %s" % (sys.executable, SERVER_PORT) + print("Run the Glances Server on port %s" % SERVER_PORT) + args = shlex.split(cmdline) + pid = subprocess.Popen(args) diff --git a/python-Glances.changes b/python-Glances.changes index ec21df7..3e1c0d4 100644 --- a/python-Glances.changes +++ b/python-Glances.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed May 6 18:46:52 UTC 2020 - Martin Hauke + +- Drop python2 +- Add patch: + * fix-tests.patch + ------------------------------------------------------------------- Thu Mar 26 14:09:01 UTC 2020 - Martin Hauke diff --git a/python-Glances.spec b/python-Glances.spec index 01ab5ae..668b7df 100644 --- a/python-Glances.spec +++ b/python-Glances.spec @@ -17,6 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 Name: python-Glances Version: 3.1.4.1 Release: 0 @@ -27,6 +28,7 @@ Source: https://github.com/nicolargo/glances/archive/v%{version}.tar.gz Patch0: adjust-data-files.patch Patch1: remove-shebang.patch Patch2: skip-online-tests.patch +Patch3: fix-tests.patch BuildRequires: %{python_module bottle} BuildRequires: %{python_module future} BuildRequires: %{python_module psutil >= 5.6.3} @@ -42,9 +44,7 @@ Recommends: python-curses Provides: python-glances = %{version} Obsoletes: python-glances < %{version} BuildArch: noarch -%ifpython3 Provides: glances -%endif %python_subpackages %description