Hello community,

here is the log from the commit of package python-node-semver for 
openSUSE:Factory checked in at 2018-02-09 15:52:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-node-semver (Old)
 and      /work/SRC/openSUSE:Factory/.python-node-semver.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-node-semver"

Fri Feb  9 15:52:57 2018 rev:2 rq:574520 version:0.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-node-semver/python-node-semver.changes    
2018-01-10 23:33:17.453308301 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-node-semver.new/python-node-semver.changes   
    2018-02-09 15:53:04.535475659 +0100
@@ -1,0 +2,7 @@
+Fri Feb  9 08:22:03 UTC 2018 - mplus...@suse.com
+
+- Update to version 0.3.0:
+  * drop python2.x support
+  * bug fix, Add sort key function #14
+
+-------------------------------------------------------------------

Old:
----
  python-node-semver-0.2.0.tar.gz

New:
----
  python-node-semver-0.3.0.tar.gz

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

Other differences:
------------------
++++++ python-node-semver.spec ++++++
--- /var/tmp/diff_new_pack.jvbUHX/_old  2018-02-09 15:53:06.031421926 +0100
+++ /var/tmp/diff_new_pack.jvbUHX/_new  2018-02-09 15:53:06.035421783 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-node-semver
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,16 +16,17 @@
 #
 
 
+%define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-node-semver
-Version:        0.2.0
+Version:        0.3.0
 Release:        0
 Summary:        Port of node-semver
 License:        MIT
 Group:          Development/Languages/Python
-Url:            https://github.com/podhmo/python-semver
+URL:            https://github.com/podhmo/python-semver
 Source:         
https://github.com/podhmo/python-semver/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module base}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes

++++++ python-node-semver-0.2.0.tar.gz -> python-node-semver-0.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/.travis.yml 
new/python-semver-0.3.0/.travis.yml
--- old/python-semver-0.2.0/.travis.yml 2017-09-13 18:29:36.000000000 +0200
+++ new/python-semver-0.3.0/.travis.yml 2018-01-13 04:53:03.000000000 +0100
@@ -1,6 +1,5 @@
 language: python
 python:
-  - "2.7"
   - "3.4"
   - "3.5"
   - "3.6"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/CHANGES.txt 
new/python-semver-0.3.0/CHANGES.txt
--- old/python-semver-0.2.0/CHANGES.txt 2017-09-13 18:29:36.000000000 +0200
+++ new/python-semver-0.3.0/CHANGES.txt 2018-01-13 04:53:03.000000000 +0100
@@ -1 +1,4 @@
+0.3.0
 
+- drop python2.x support
+- bug fix, Add sort key function #14
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/README.rst 
new/python-semver-0.3.0/README.rst
--- old/python-semver-0.2.0/README.rst  2017-09-13 18:29:36.000000000 +0200
+++ new/python-semver-0.3.0/README.rst  2018-01-13 04:53:03.000000000 +0100
@@ -6,7 +6,17 @@
 
 python version of [node-semver](https://github.com/isaacs/node-semver)
 
-.. code:: python
+install
+----------------------------------------
+
+.. code-block:: console
+
+   pip install node-semver
+
+examples
+----------------------------------------
+
+.. code-block:: python
 
    # -*- coding:utf-8 -*-
    from semver import max_satisfying
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/demo.py 
new/python-semver-0.3.0/demo.py
--- old/python-semver-0.2.0/demo.py     2017-09-13 18:29:36.000000000 +0200
+++ new/python-semver-0.3.0/demo.py     1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-# -*- coding:utf-8 -*-
-from semver import max_satisfying
-
-versions = ['1.2.3', '1.2.4', '1.2.5', '1.2.6', '2.0.1']
-range_ = '~1.2.3'
-assert max_satisfying(versions, range_, loose=False) == '1.2.6'
-
-
-versions = ['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', 
'2.0.0b3', '2.0.0', '2.1.0']
-range_ = '~2.0.0'
-assert max_satisfying(versions, range_, loose=True) == '2.0.0'
-
-try:
-    (max_satisfying(versions, range_, loose=False) == '2.0.0')
-except ValueError as e:
-    assert e.args[0] == "Invalid Version: 2.0.0b1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/examples/readme.py 
new/python-semver-0.3.0/examples/readme.py
--- old/python-semver-0.2.0/examples/readme.py  1970-01-01 01:00:00.000000000 
+0100
+++ new/python-semver-0.3.0/examples/readme.py  2018-01-13 04:53:03.000000000 
+0100
@@ -0,0 +1,16 @@
+# -*- coding:utf-8 -*-
+from semver import max_satisfying
+
+versions = ['1.2.3', '1.2.4', '1.2.5', '1.2.6', '2.0.1']
+range_ = '~1.2.3'
+assert max_satisfying(versions, range_, loose=False) == '1.2.6'
+
+
+versions = ['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', 
'2.0.0b3', '2.0.0', '2.1.0']
+range_ = '~2.0.0'
+assert max_satisfying(versions, range_, loose=True) == '2.0.0'
+
+try:
+    (max_satisfying(versions, range_, loose=False) == '2.0.0')
+except ValueError as e:
+    assert e.args[0] == "Invalid Version: 2.0.0b1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/semver/__init__.py 
new/python-semver-0.3.0/semver/__init__.py
--- old/python-semver-0.2.0/semver/__init__.py  2017-09-13 18:29:36.000000000 
+0200
+++ new/python-semver-0.3.0/semver/__init__.py  2018-01-13 04:53:03.000000000 
+0100
@@ -526,13 +526,57 @@
     return compare(b, a, loose)
 
 
+def _prerelease_key(prerelease):
+    """Sort key for prereleases.
+
+    Precedence for two pre-release versions with the same
+    major, minor, and patch version MUST be determined by
+    comparing each dot separated identifier from left to
+    right until a difference is found as follows:
+    identifiers consisting of only digits are compare
+    numerically and identifiers with letters or hyphens
+    are compared lexically in ASCII sort order. Numeric
+    identifiers always have lower precedence than non-
+    numeric identifiers. A larger set of pre-release
+    fields has a higher precedence than a smaller set,
+    if all of the preceding identifiers are equal.
+    """
+    for entry in prerelease:
+        if isinstance(entry, int):
+            # Assure numerics always sort before string
+            yield ('', entry)
+        else:
+            # Use ASCII compare:
+            yield (entry,)
+
+
+def _make_key_function(loose):
+    def key_function(version):
+        v = make_semver(version, loose)
+        key = (v.major, v.minor, v.patch)
+        if v.prerelease:
+            key = key + (0,) + tuple(_prerelease_key(
+                v.prerelease))
+        else:
+            #  NOT having a prerelease is > having one
+            key = key + (1,)
+
+        return key
+    return key_function
+
+loose_key_function = _make_key_function(True)
+full_key_function = _make_key_function(False)
+
+
 def sort(list, loose):
-    list.sort(lambda a, b: compare(a, b, loose))
+    keyf = loose_key_function if loose else full_key_function
+    list.sort(key=keyf)
     return list
 
 
 def rsort(list, loose):
-    list.sort(lambda a, b: rcompare(a, b, loose))
+    keyf = loose_key_function if loose else full_key_function
+    list.sort(key=keyf, reverse=True)
     return list
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/semver/tests/test_sort.py 
new/python-semver-0.3.0/semver/tests/test_sort.py
--- old/python-semver-0.2.0/semver/tests/test_sort.py   1970-01-01 
01:00:00.000000000 +0100
+++ new/python-semver-0.3.0/semver/tests/test_sort.py   2018-01-13 
04:53:03.000000000 +0100
@@ -0,0 +1,92 @@
+
+versions = [
+    '0.0.0-foo',
+    '0.0.0',
+    '0.0.0',
+    '0.0.1', 
+    '0.9.0',
+    '0.9.9',
+    '0.10.0',
+    '0.10.0',
+    '0.10.0',
+    '0.99.0',
+    '0.99.0',
+    '1.0.0',
+    '1.0.0',
+    '1.2.3-4',
+    '1.2.3-4',
+    '1.2.3-5',
+    '1.2.3-5',
+    '1.2.3-4-foo',
+    '1.2.3-5-Foo',
+    '1.2.3-5-foo',
+    '1.2.3-5-foo',
+    '1.2.3-R2',
+    '1.2.3-a',
+    '1.2.3-a.5',
+    '1.2.3-a.5',
+    '1.2.3-a.10',
+    '1.2.3-a.b',
+    '1.2.3-a.b',
+    '1.2.3-a.b.c.5.d.100',
+    '1.2.3-a.b.c.10.d.5',
+    '1.2.3-asdf',
+    '1.2.3-r100',
+    '1.2.3-r100',
+    '1.2.3-r2',
+    '1.2.3',
+    '1.2.3',
+    '2.0.0',
+    '2.0.0',
+    '2.7.2+asdf',
+    '3.0.0',
+]
+
+
+spec_prerelease_examples = [
+    '1.0.0-alpha',
+    '1.0.0-alpha.1',
+    '1.0.0-alpha.beta',
+    '1.0.0-beta',
+    '1.0.0-beta.2',
+    '1.0.0-beta.11',
+    '1.0.0-rc.1',
+    '1.0.0',
+]
+
+
+def _shuffled_copy(source, seed=0):
+    import random
+    random.seed(seed)
+    _copy = source[:]
+    random.shuffle(_copy)
+    # assert _copy != source
+    return _copy
+
+
+def test_sort():
+    from semver import sort
+    to_sort = _shuffled_copy(versions)
+    sort(to_sort, True)
+    assert versions == to_sort
+
+
+def test_prerelease_sort():
+    from semver import sort
+    to_sort = _shuffled_copy(spec_prerelease_examples)
+    sort(to_sort, False)
+    assert spec_prerelease_examples == to_sort
+
+
+def test_rsort():
+    from semver import rsort
+    to_sort = _shuffled_copy(versions)
+    rsort(to_sort, True)
+    assert list(reversed(versions)) == to_sort
+
+
+def test_prerelease_rsort():
+    from semver import rsort
+    to_sort = _shuffled_copy(spec_prerelease_examples)
+    rsort(to_sort, False)
+    assert list(reversed(spec_prerelease_examples)) == to_sort
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-semver-0.2.0/setup.py 
new/python-semver-0.3.0/setup.py
--- old/python-semver-0.2.0/setup.py    2017-09-13 18:29:36.000000000 +0200
+++ new/python-semver-0.3.0/setup.py    2018-01-13 04:53:03.000000000 +0100
@@ -36,7 +36,7 @@
 
 setup(
     name='node-semver',
-    version='0.2.0',
+    version='0.3.0',
     description='port of node-semver',
     long_description=README + '\n\n' + CHANGES,
     classifiers=[


Reply via email to