Hello community,

here is the log from the commit of package python-straight-plugin for 
openSUSE:Factory checked in at 2020-05-28 09:19:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-straight-plugin (Old)
 and      /work/SRC/openSUSE:Factory/.python-straight-plugin.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-straight-plugin"

Thu May 28 09:19:58 2020 rev:2 rq:809684 version:1.5.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-straight-plugin/python-straight-plugin.changes
    2018-09-07 15:36:30.302724814 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-straight-plugin.new.3606/python-straight-plugin.changes
  2020-05-28 09:20:01.149285726 +0200
@@ -1,0 +2,7 @@
+Wed May 27 16:07:26 UTC 2020 - Matej Cepl <[email protected]>
+
+- Add pip_no_plugins.patch to avoid error: "UnboundLocalError:
+  local variable 'r' referenced before assignment", when there
+  is no plugin available. 
+
+-------------------------------------------------------------------

New:
----
  pip_no_plugins.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-straight-plugin.spec ++++++
--- /var/tmp/diff_new_pack.VW1mKs/_old  2020-05-28 09:20:01.785286891 +0200
+++ /var/tmp/diff_new_pack.VW1mKs/_new  2020-05-28 09:20:01.789286899 +0200
@@ -1,6 +1,7 @@
 #
 # spec file for package python-straight-plugin
 #
+# Copyright (c) 2020 SUSE LLC
 # Copyright (c) 2018 Neal Gompa <[email protected]>.
 #
 # All modifications and additions to the file contributed by third parties
@@ -12,23 +13,26 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-straight-plugin
 Version:        1.5.0
 Release:        0
 Summary:        Python plugin loader
-Group:          Development/Libraries/Python
 License:        MIT
+Group:          Development/Libraries/Python
 URL:            https://github.com/ironfroggy/straight.plugin/
-
-Source0:        
https://pypi.python.org/packages/source/s/straight.plugin/straight.plugin-%{version}.tar.gz
-
-BuildArch:      noarch
+Source0:        
https://files.pythonhosted.org/packages/source/s/straight.plugin/straight.plugin-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM pip_no_plugins.patch gh#ironfroggy/straight.plugin#24 
[email protected]
+# Fixes pipe with no plugins installed
+Patch0:         pip_no_plugins.patch
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+BuildArch:      noarch
 %python_subpackages
 
 %description
@@ -43,22 +47,19 @@
 themselves are modules in a namespace package where the namespace identifies
 the plugins in it for some particular purpose or intent.
 
-
 %prep
-%autosetup -n straight.plugin-%{version}
-
+%setup -q -n straight.plugin-%{version}
+%autopatch -p1
 
 %build
 %python_build
 
-
 %install
 %python_install
-
+%fdupes %{buildroot}%{python_sitelib}
 
 %files %{python_files}
 %license LICENSE
 %{python_sitelib}/*
 
-
 %changelog

++++++ pip_no_plugins.patch ++++++
>From fbe969310abfb0294313372da20a4b7dc99ea0a8 Mon Sep 17 00:00:00 2001
From: Lars van de Kerkhof <[email protected]>
Date: Thu, 28 Jun 2018 15:40:39 +0200
Subject: [PATCH 1/3] Fixes pip with no plugins installed.

---
 straight/plugin/manager.py | 2 +-
 tests.py                   | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

--- a/straight/plugin/manager.py
+++ b/straight/plugin/manager.py
@@ -50,7 +50,7 @@ class PluginManager(object):
 
         Useful to utilize plugins as sets of filters.
         """
-
+        r = first_arg
         for plugin in self._plugins:
             method = getattr(plugin, methodname, None)
             if method is None:
--- a/tests.py
+++ b/tests.py
@@ -257,9 +257,12 @@ class PluginManagerTestCase(unittest.Tes
             return x + 1
         self.m._plugins[0].x.side_effect = plus_one
         self.m._plugins[1].x.side_effect = plus_one
-
         self.assertEqual(3, self.m.pipe('x', 1))
 
+    def test_pipe_no_plugins_found(self):
+        no_plugins = manager.PluginManager([])
+        self.assertEqual(1, no_plugins.pipe('x', 1))
+
     def test_call(self):
         results = self.m.call('x', 1)
         self.assertTrue(self.m._plugins[0].called_with('a'))

Reply via email to