forked from pool/python-pytest-listener
Accepting request 1041841 from devel:languages:python:pytest
OBS-URL: https://build.opensuse.org/request/show/1041841 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-listener?expand=0&rev=4
This commit is contained in:
47
python-pytest-listener-no-six.patch
Normal file
47
python-pytest-listener-no-six.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
Index: pytest-listener-1.7.0/pytest_listener.py
|
||||
===================================================================
|
||||
--- pytest-listener-1.7.0.orig/pytest_listener.py
|
||||
+++ pytest-listener-1.7.0/pytest_listener.py
|
||||
@@ -3,14 +3,13 @@
|
||||
import collections
|
||||
import json
|
||||
import logging
|
||||
+import pickle
|
||||
import socket
|
||||
import time
|
||||
from threading import Thread, Event
|
||||
from time import sleep
|
||||
|
||||
import pytest
|
||||
-from six import string_types
|
||||
-from six.moves import cPickle
|
||||
from pytest_server_fixtures.base import get_ephemeral_port, get_ephemeral_host
|
||||
|
||||
TERMINATOR = json.dumps(['STOP']).encode('utf-8')
|
||||
@@ -59,7 +58,7 @@ class TimedMsg(object):
|
||||
return 'TimedMsg: %s (@ %s)' % (str(self.value), self.time)
|
||||
|
||||
def pickled(self):
|
||||
- return cPickle.dumps(self)
|
||||
+ return pickle.dumps(self)
|
||||
|
||||
|
||||
class Listener(Thread):
|
||||
@@ -114,7 +113,7 @@ class Listener(Thread):
|
||||
return None, None
|
||||
|
||||
try:
|
||||
- data = cPickle.loads(data)
|
||||
+ data = pickle.loads(data)
|
||||
except:
|
||||
try:
|
||||
data = data.decode('utf-8')
|
||||
@@ -128,7 +127,7 @@ class Listener(Thread):
|
||||
if isinstance(data, TimedMsg):
|
||||
d = data.value
|
||||
t = data.time
|
||||
- elif isinstance(data, string_types):
|
||||
+ elif isinstance(data, str):
|
||||
try:
|
||||
d = json.loads(data)
|
||||
except:
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 8 11:30:00 UTC 2022 - pgajdos@suse.com
|
||||
|
||||
- do not require six
|
||||
- added patches
|
||||
fix https://github.com/man-group/pytest-plugins/issues/209
|
||||
+ python-pytest-listener-no-six.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 15 10:08:31 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pytest-listener
|
||||
#
|
||||
# Copyright (c) 2021 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,16 +25,16 @@ License: MIT
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/manahl/pytest-plugins
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-listener/pytest-listener-%{version}.tar.gz
|
||||
# https://github.com/man-group/pytest-plugins/issues/209
|
||||
Patch0: python-pytest-listener-no-six.patch
|
||||
BuildRequires: %{python_module setuptools-git}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-pytest-server-fixtures
|
||||
Requires: python-six
|
||||
BuildArch: noarch
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module pytest-server-fixtures}
|
||||
BuildRequires: %{python_module six}
|
||||
# /SECTION
|
||||
%python_subpackages
|
||||
|
||||
@@ -42,7 +42,7 @@ BuildRequires: %{python_module six}
|
||||
Simple JSON listener using TCP that listens for data and stores it in a queue for later retrieval.
|
||||
|
||||
%prep
|
||||
%setup -q -n pytest-listener-%{version}
|
||||
%autosetup -p1 -n pytest-listener-%{version}
|
||||
# required to find the one file in the topdir
|
||||
sed -i "/packages=find_packages/ a \ py_modules=['pytest_listener']," setup.py
|
||||
|
||||
|
||||
Reference in New Issue
Block a user