Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-wirerope for openSUSE:Factory 
checked in at 2022-10-12 18:24:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wirerope (Old)
 and      /work/SRC/openSUSE:Factory/.python-wirerope.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-wirerope"

Wed Oct 12 18:24:31 2022 rev:2 rq:1009884 version:0.4.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wirerope/python-wirerope.changes  
2020-08-20 22:30:38.072031996 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-wirerope.new.2275/python-wirerope.changes    
    2022-10-12 18:26:08.625881657 +0200
@@ -1,0 +2,6 @@
+Tue Oct 11 17:16:24 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to version 0.4.6 
+  * Fix setuptools version check
+
+-------------------------------------------------------------------

Old:
----
  wirerope-0.4.2.tar.gz

New:
----
  wirerope-0.4.6.tar.gz

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

Other differences:
------------------
++++++ python-wirerope.spec ++++++
--- /var/tmp/diff_new_pack.RgovHN/_old  2022-10-12 18:26:09.097882696 +0200
+++ /var/tmp/diff_new_pack.RgovHN/_new  2022-10-12 18:26:09.105882714 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-wirerope
 #
-# 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
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without python2
 Name:           python-wirerope
-Version:        0.4.2
+Version:        0.4.6
 Release:        0
 Summary:        The Way to Handle Bound Methods
 License:        BSD-2-Clause

++++++ wirerope-0.4.2.tar.gz -> wirerope-0.4.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/.github/workflows/python-package.yml 
new/wirerope-0.4.6/.github/workflows/python-package.yml
--- old/wirerope-0.4.2/.github/workflows/python-package.yml     1970-01-01 
01:00:00.000000000 +0100
+++ new/wirerope-0.4.6/.github/workflows/python-package.yml     2022-02-17 
07:35:45.000000000 +0100
@@ -0,0 +1,42 @@
+# This workflow will install Python dependencies, run tests and lint with a 
variety of Python versions
+# For more information see: 
https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Python package
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: [2.7, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        fetch-depth: 2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        python -m pip install flake8 pytest
+        python -m pip install -e '.[test]'
+    - name: Lint with flake8
+      run: |
+        flake8 . --statistics
+    - name: Test with pytest
+      run: |
+        pytest
+
+    - name: Codecov
+      run: bash <(curl -s https://codecov.io/bash)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/.travis.yml 
new/wirerope-0.4.6/.travis.yml
--- old/wirerope-0.4.2/.travis.yml      2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/.travis.yml      2022-02-17 07:35:45.000000000 +0100
@@ -13,7 +13,7 @@
 - '3.4'
 - nightly
 install:
-- pip install --upgrade pip setuptools
+- pip install --upgrade pip
 - pip install flake8 pytest-cov .
 - pip install -e '.[test]'
 script:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/README.rst 
new/wirerope-0.4.6/README.rst
--- old/wirerope-0.4.2/README.rst       2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/README.rst       2022-02-17 07:35:45.000000000 +0100
@@ -1,8 +1,7 @@
 wirerope
 ========
 
-.. image:: https://travis-ci.com/youknowone/wirerope.svg?branch=master
-    :target: https://travis-ci.com/youknowone/wirerope
+.. image:: 
https://github.com/youknowone/wirerope/actions/workflows/python-package.yml/badge.svg
 .. image:: https://codecov.io/gh/youknowone/wirerope/graph/badge.svg
     :target: https://codecov.io/gh/youknowone/wirerope
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/pyproject.toml 
new/wirerope-0.4.6/pyproject.toml
--- old/wirerope-0.4.2/pyproject.toml   1970-01-01 01:00:00.000000000 +0100
+++ new/wirerope-0.4.6/pyproject.toml   2022-02-17 07:35:45.000000000 +0100
@@ -0,0 +1,4 @@
+[build-system]
+requires = ["setuptools>=40.8.0", "wheel"]
+build-backend = "setuptools.build_meta:__legacy__"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/setup.cfg new/wirerope-0.4.6/setup.cfg
--- old/wirerope-0.4.2/setup.cfg        2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/setup.cfg        2022-02-17 07:35:45.000000000 +0100
@@ -1,6 +1,6 @@
 [metadata]
 name = wirerope
-version = 0.4.2
+version = 0.4.6
 url = https://github.com/youknowone/wirerope
 author = Jeong YunWon
 author_email = [email protected]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/setup.py new/wirerope-0.4.6/setup.py
--- old/wirerope-0.4.2/setup.py 2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/setup.py 2022-02-17 07:35:45.000000000 +0100
@@ -1,6 +1,13 @@
 import setuptools
+from pkg_resources import get_distribution
 
-assert tuple(map(int, setuptools.__version__.split('.')[:3])) >= (39, 2, 0), \
-    'Plesase upgrade setuptools by `pip install -U setuptools`'
+try:
+    get_distribution("setuptools>=39.2.0")
+except Exception as e:
+    raise AssertionError(
+        "Please upgrade setuptools by `pip install -U setuptools`: {}".format(
+            e
+        )
+    )
 
 setuptools.setup()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/tests/test_wire.py 
new/wirerope-0.4.6/tests/test_wire.py
--- old/wirerope-0.4.2/tests/test_wire.py       2020-07-06 07:53:51.000000000 
+0200
+++ new/wirerope-0.4.6/tests/test_wire.py       2022-02-17 07:35:45.000000000 
+0100
@@ -1,3 +1,5 @@
+import sys
+
 from wirerope import Wire, WireRope, RopeCore
 
 import pytest
@@ -172,6 +174,95 @@
     assert X.property.__doc__ == 'property'
 
 
+def test_wire_super():
+    if sys.version_info < (3, 6, 0):
+        pytest.skip(
+            "super() support requires __set_name__, which is not available"
+            " before Python 3.6"
+        )
+
+    class CallableWire(Wire):
+        def __call__(self, *args, **kwargs):
+            return self.__func__(*args, **kwargs)
+
+    rope = WireRope(CallableWire, wraps=True)
+
+    class X(object):
+        def baremethod(self, v):
+            return "baremethod" + v
+
+        @rope
+        def method(self, v):
+            return "method" + v
+
+        @rope
+        @classmethod
+        def cmethod(cls, v):
+            return "cmethod" + v
+
+        @rope
+        @staticmethod
+        def smethod(v):
+            return "smethod" + v
+
+        @rope
+        @hybridmethod
+        def hmethod(self_or_cls, v):
+            return "hmethod" + v
+
+        @rope
+        @property
+        def property(self):
+            return "property"
+
+        @rope
+        @hybridproperty
+        def hproperty(self_or_cls):
+            return "hproperty"
+
+    class Y(X):
+        def baremethod(self, v):
+            return super(Y, self).baremethod(v) + "Y"
+
+        @rope
+        def method(self, v):
+            return super(Y, self).method(v) + "Y"
+
+        @rope
+        @classmethod
+        def cmethod(cls, v):
+            return super(Y, cls).cmethod(v) + "Y"
+
+        @rope
+        @staticmethod
+        def smethod(v):
+            return X.smethod(v) + "Y"
+
+        @rope
+        @hybridmethod
+        def hmethod(self_or_cls, v):
+            return super(Y, self_or_cls).hmethod(v) + "Y"
+
+        @rope
+        @property
+        def property(self):
+            return super(Y, self).property + "Y"
+
+        @rope
+        @hybridproperty
+        def hproperty(self_or_cls):
+            return super(Y, self_or_cls).hproperty + "Y"
+
+    for obj, suffix in [(X(), ""), (Y(), "Y")]:
+        assert obj.baremethod(" ") == "baremethod " + suffix
+        assert obj.method(" ") == "method " + suffix
+        assert obj.cmethod(" ") == "cmethod " + suffix
+        assert obj.smethod(" ") == "smethod " + suffix
+        assert obj.hmethod(" ") == "hmethod " + suffix
+        assert obj.property == "property" + suffix
+        assert obj.hproperty == "hproperty" + suffix
+
+
 def test_callable_wire():
 
     class CallableWire(Wire):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/wirerope/_version.py 
new/wirerope-0.4.6/wirerope/_version.py
--- old/wirerope-0.4.2/wirerope/_version.py     2020-07-06 07:53:51.000000000 
+0200
+++ new/wirerope-0.4.6/wirerope/_version.py     2022-02-17 07:35:45.000000000 
+0100
@@ -1 +1 @@
-__version__ = '0.4.2'
+__version__ = '0.4.6'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/wirerope/callable.py 
new/wirerope-0.4.6/wirerope/callable.py
--- old/wirerope-0.4.2/wirerope/callable.py     2020-07-06 07:53:51.000000000 
+0200
+++ new/wirerope-0.4.6/wirerope/callable.py     2022-02-17 07:35:45.000000000 
+0100
@@ -128,7 +128,7 @@
 
     @cached_property
     def is_boundmethod(self):
-        if self.is_function_type:
+        if self.is_function_type or self.is_builtin_property:
             return False
         try:
             return self.wrapped_object.__get__(object()) is self.wrapped_object
@@ -152,9 +152,14 @@
         return is_descriptor
 
     @cached_property
+    def is_builtin_property(self):
+        return issubclass(type(self.wrapped_object), property)
+
+    @cached_property
     def is_property(self):
-        return self.is_descriptor \
-            and self.descriptor.detect_property(_reagent, _Reagent)
+        return self.is_builtin_property or \
+            (self.is_descriptor and self.descriptor.detect_property(
+                _reagent, _Reagent))
 
     if six.PY34:
         @cached_property
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/wirerope/rope.py 
new/wirerope-0.4.6/wirerope/rope.py
--- old/wirerope-0.4.2/wirerope/rope.py 2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/wirerope/rope.py 2022-02-17 07:35:45.000000000 +0100
@@ -32,17 +32,27 @@
         super(MethodRopeMixin, self).__init__(*args, **kwargs)
         assert not self.callable.is_barefunction
 
+    def __set_name__(self, owner, name):
+        # Use a non-identifier character as separator to prevent name clash.
+        self.wire_name = '|'.join(['__wire', owner.__name__, name])
+
     def __get__(self, obj, type=None):
         cw = self.callable
         co = cw.wrapped_object
         owner, _ = descriptor_bind(co, obj, type)
         if owner is None:  # invalid binding but still wire it
             owner = obj if obj is not None else type
-        wire_name_parts = ['__wire_', cw.wrapped_callable.__name__]
-        if owner is type:
-            wire_name_parts.extend(('_', type.__name__))
-        wire_name = ''.join(wire_name_parts)
-        wire = getattr(owner, wire_name, None)
+        if hasattr(self, 'wire_name'):
+            wire_name = self.wire_name
+            # Lookup in `__dict__` instead of using `getattr`, because
+            # `getattr` falls back to class attributes.
+            wire = owner.__dict__.get(wire_name)
+        else:
+            wire_name_parts = ['__wire_', cw.wrapped_callable.__name__]
+            if owner is type:
+                wire_name_parts.extend(('_', type.__name__))
+            wire_name = ''.join(wire_name_parts)
+            wire = getattr(owner, wire_name, None)
         if wire is None:
             wire = self.wire_class(self, owner, (obj, type))
             setattr(owner, wire_name, wire)
@@ -56,21 +66,30 @@
         super(PropertyRopeMixin, self).__init__(*args, **kwargs)
         assert not self.callable.is_barefunction
 
+    def __set_name__(self, owner, name):
+        # Use a non-identifier character as separator to prevent name clash.
+        self.wire_name = '|'.join(['__wire', owner.__name__, name])
+
     def __get__(self, obj, type=None):
         cw = self.callable
         co = cw.wrapped_object
         owner, _ = descriptor_bind(co, obj, type)
         if owner is None:  # invalid binding but still wire it
             owner = obj if obj is not None else type
-        wire_name_parts = ['__wire_', cw.wrapped_callable.__name__]
-        if owner is type:
-            wire_name_parts.extend(('_', type.__name__))
-        wire_name = ''.join(wire_name_parts)
-        wire = getattr(owner, wire_name, None)
+        if hasattr(self, 'wire_name'):
+            wire_name = self.wire_name
+            # Lookup in `__dict__` instead of using `getattr`, because
+            # `getattr` falls back to class attributes.
+            wire = owner.__dict__.get(wire_name)
+        else:
+            wire_name_parts = ['__wire_', cw.wrapped_callable.__name__]
+            if owner is type:
+                wire_name_parts.extend(('_', type.__name__))
+            wire_name = ''.join(wire_name_parts)
+            wire = getattr(owner, wire_name, None)
         if wire is None:
             wire = self.wire_class(self, owner, (obj, type))
             setattr(owner, wire_name, wire)
-
         return wire._on_property()  # requires property path
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wirerope-0.4.2/wirerope/wire.py 
new/wirerope-0.4.6/wirerope/wire.py
--- old/wirerope-0.4.2/wirerope/wire.py 2020-07-06 07:53:51.000000000 +0200
+++ new/wirerope-0.4.6/wirerope/wire.py 2022-02-17 07:35:45.000000000 +0100
@@ -1,6 +1,7 @@
 """:mod:`wirerope.wire` --- end-point instant for each bound method
 ===================================================================
 """
+import six
 import types
 from .callable import Descriptor
 from ._compat import functools
@@ -42,10 +43,13 @@
         if binding:
             func = self._callable.wrapped_object.__get__
             if self._callable.is_property:
-                # functools.partial doesn't work with py2 functools.wraps
-                def _property():
-                    return func(*binding)
-                self.__func__ = _property
+                wrapped = functools.partial(func, *binding)
+                if six.PY2:
+                    # functools.wraps requires those attributes but
+                    # py2 functools.partial doesn't have them
+                    wrapped.__module__ = owner.__module__
+                    wrapped.__name__ = func.__name__
+                self.__func__ = wrapped
             else:
                 self.__func__ = func(*binding)
         else:

Reply via email to