Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-natsort for openSUSE:Factory 
checked in at 2022-02-06 23:53:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-natsort (Old)
 and      /work/SRC/openSUSE:Factory/.python-natsort.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-natsort"

Sun Feb  6 23:53:38 2022 rev:20 rq:951387 version:8.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-natsort/python-natsort.changes    
2021-12-30 15:55:16.164647550 +0100
+++ /work/SRC/openSUSE:Factory/.python-natsort.new.1898/python-natsort.changes  
2022-02-06 23:54:01.546922869 +0100
@@ -1,0 +2,11 @@
+Thu Feb  3 20:01:25 UTC 2022 - Arun Persaud <a...@gmx.de>
+
+- specfile:
+  * update copyright year
+
+- update to version 8.1.0:
+  * Changed
+    + When using ns.PATH, only split off a maximum of two suffixes
+      from a file name (issues #145, #146).
+
+-------------------------------------------------------------------

Old:
----
  natsort-8.0.2.tar.gz

New:
----
  natsort-8.1.0.tar.gz

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

Other differences:
------------------
++++++ python-natsort.spec ++++++
--- /var/tmp/diff_new_pack.HXmBx4/_old  2022-02-06 23:54:02.030919642 +0100
+++ /var/tmp/diff_new_pack.HXmBx4/_new  2022-02-06 23:54:02.034919615 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-natsort
 #
-# 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
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-natsort
-Version:        8.0.2
+Version:        8.1.0
 Release:        0
 Summary:        Natural sorting in Python
 License:        MIT
@@ -35,10 +35,10 @@
 BuildRequires:  help2man
 BuildRequires:  python-rpm-macros
 Requires:       python-setuptools
-Recommends:     python-PyICU >= 1.0.0
-Recommends:     python-fastnumbers >= 2.0.0
 Requires(post): update-alternatives
 Requires(postun):update-alternatives
+Recommends:     python-PyICU >= 1.0.0
+Recommends:     python-fastnumbers >= 2.0.0
 BuildArch:      noarch
 %python_subpackages
 

++++++ natsort-8.0.2.tar.gz -> natsort-8.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/CHANGELOG.md 
new/natsort-8.1.0/CHANGELOG.md
--- old/natsort-8.0.2/CHANGELOG.md      2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/CHANGELOG.md      2022-01-31 04:20:37.000000000 +0100
@@ -1,18 +1,25 @@
 Unreleased
 ---
 
+[8.1.0] - 2022-01-30
+---
+
+### Changed
+- When using `ns.PATH`, only split off a maximum of two suffixes from
+  a file name (issues #145, #146).
+
 [8.0.2] - 2021-12-14
 ---
 
 ### Fixed
-- Bug where sorting paths fail if one of the paths is '.'.
+- Bug where sorting paths fail if one of the paths is '.' (issues #142, #143)
 
 [8.0.1] - 2021-12-10
 ---
 
 ### Fixed
 - Compose unicode characters when using locale to ensure sorting is correct
-  across all locales.
+  across all locales (issues #140, #141)
 
 [8.0.0] - 2021-11-03
 ---
@@ -52,7 +59,7 @@
 
 ### Changed
  - MacOS unit tests run on native Python
- - Treate `None` like `NaN` internally to avoid `TypeError` (issue #117)
+ - Treat `None` like `NaN` internally to avoid `TypeError` (issue #117)
  - No longer fail tests every time a new Python version is released (issue 
#122)
 
 ### Fixed
@@ -76,7 +83,7 @@
  - Release checklist in `RELEASING.md` ([@hugovk](https://github.com/hugovk), 
issue #106)
 
 ### Changed
- - Updated auxillary shell scripts to be written in python, and added
+ - Updated auxiliary shell scripts to be written in python, and added
    ability to call these from `tox`
  - Improved Travis-CI experience
  - Update testing dependency versions
@@ -281,7 +288,7 @@
    because the new factory function paradigm eliminates most `if` branches
    during execution). For the most cases, the code is 30-40% faster than 
version 4.0.4.
    If using `ns.LOCALE` or `humansorted`, the code is 1100% faster than 
version 4.0.4
- - Improved clarity of documentaion with regards to locale-aware sorting
+ - Improved clarity of documentation with regards to locale-aware sorting
 
 ### Deprecated
  - `ns.TYPESAFE` option as it is now always on (due to a new
@@ -427,7 +434,7 @@
  - `reverse` option to `natsorted` & co. to make it's API more
    similar to the builtin 'sorted'
  - More unit tests
- - Auxillary test code that helps in profiling and stress-testing
+ - Auxiliary test code that helps in profiling and stress-testing
  - Support for coveralls.io
 
 ### Changed
@@ -574,7 +581,7 @@
 ---
 
 ### Added
- - Tests into the natsort.py file iteself
+ - Tests into the natsort.py file itself
 
 ### Changed
  - Reorganized directory structure
@@ -590,6 +597,7 @@
  - Sorting algorithm to support floats (including exponentials) and basic 
version number support
 
 <!---Comparison links-->
+[8.1.0]: https://github.com/SethMMorton/natsort/compare/8.0.2...8.1.0
 [8.0.2]: https://github.com/SethMMorton/natsort/compare/8.0.1...8.0.2
 [8.0.1]: https://github.com/SethMMorton/natsort/compare/8.0.0...8.0.1
 [8.0.0]: https://github.com/SethMMorton/natsort/compare/7.2.0...8.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/PKG-INFO new/natsort-8.1.0/PKG-INFO
--- old/natsort-8.0.2/PKG-INFO  2021-12-14 18:20:41.139580200 +0100
+++ new/natsort-8.1.0/PKG-INFO  2022-01-31 04:20:39.787069300 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: natsort
-Version: 8.0.2
+Version: 8.1.0
 Summary: Simple yet flexible natural sorting in Python.
 Home-page: https://github.com/SethMMorton/natsort
 Author: Seth M. Morton
@@ -68,11 +68,10 @@
     - `Installation`_
     - `How to Run Tests`_
     - `How to Build Documentation`_
-    - `Deprecation Schedule`_
+    - `Dropped Deprecated APIs`_
     - `History`_
 
-**NOTE**: Please see the `Deprecation Schedule`_ section for changes in
-``natsort`` version 7.0.0.
+**NOTE**: Please see the `Dropped Deprecated APIs`_ section for changes.
 
 Quick Description
 -----------------
@@ -137,7 +136,7 @@
 - `Locale-Aware Sorting (or "Human Sorting")`_
 - `Further Customizing Natsort`_
 - `Sorting Mixed Types`_
-- `Handling Bytes on Python 3`_
+- `Handling Bytes`_
 - `Generating a Reusable Sorting Key and Sorting In-Place`_
 - `Other Useful Things`_
 
@@ -275,26 +274,23 @@
     >>> a = ['4.5', 6, 2.0, '5', 'a']
     >>> natsorted(a)
     [2.0, '4.5', '5', 6, 'a']
-    >>> # On Python 2, sorted(a) would return [2.0, 6, '4.5', '5', 'a']
-    >>> # On Python 3, sorted(a) would raise an "unorderable types" TypeError
+    >>> # sorted(a) would raise an "unorderable types" TypeError
 
-Handling Bytes on Python 3
-++++++++++++++++++++++++++
+Handling Bytes
+++++++++++++++
 
-``natsort`` does not officially support the `bytes` type on Python 3, but
+``natsort`` does not officially support the `bytes` type, but
 convenience functions are provided that help you decode to `str` first:
 
 .. code-block:: pycon
 
     >>> from natsort import as_utf8
     >>> a = [b'a', 14.0, 'b']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would raise a TypeError (bytes() < str())
+    >>> # natsorted(a) would raise a TypeError (bytes() < str())
     >>> natsorted(a, key=as_utf8) == [14.0, b'a', 'b']
     True
     >>> a = [b'a56', b'a5', b'a6', b'a40']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would return the same results as sorted(a)
+    >>> # natsorted(a) would return the same results as sorted(a)
     >>> natsorted(a, key=as_utf8) == [b'a5', b'a6', b'a40', b'a56']
     True
 
@@ -480,27 +476,8 @@
 
 This will place the documentation in ``build/sphinx/html``.
 
-Deprecation Schedule
---------------------
-
-Dropped Python 3.4 and Python 3.5 Support
-+++++++++++++++++++++++++++++++++++++++++
-
-``natsort`` version 8.0.0 dropped support for Python < 3.6.
-
-Dropped Python 2.7 Support
-++++++++++++++++++++++++++
-
-``natsort`` version 7.0.0 dropped support for Python 2.7.
-
-The version 6.X branch will remain as a "long term support" branch where bug
-fixes are applied so that users who cannot update from Python 2.7 will not be
-forced to use a buggy ``natsort`` version (bug fixes will need to be requested;
-by default only the 7.X branch will be updated).
-New features would not be added to version 6.X, only bug fixes.
-
 Dropped Deprecated APIs
-+++++++++++++++++++++++
+-----------------------
 
 In ``natsort`` version 6.0.0, the following APIs and functions were removed
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/README.rst new/natsort-8.1.0/README.rst
--- old/natsort-8.0.2/README.rst        2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/README.rst        2022-01-31 04:20:37.000000000 +0100
@@ -34,11 +34,10 @@
     - `Installation`_
     - `How to Run Tests`_
     - `How to Build Documentation`_
-    - `Deprecation Schedule`_
+    - `Dropped Deprecated APIs`_
     - `History`_
 
-**NOTE**: Please see the `Deprecation Schedule`_ section for changes in
-``natsort`` version 7.0.0.
+**NOTE**: Please see the `Dropped Deprecated APIs`_ section for changes.
 
 Quick Description
 -----------------
@@ -103,7 +102,7 @@
 - `Locale-Aware Sorting (or "Human Sorting")`_
 - `Further Customizing Natsort`_
 - `Sorting Mixed Types`_
-- `Handling Bytes on Python 3`_
+- `Handling Bytes`_
 - `Generating a Reusable Sorting Key and Sorting In-Place`_
 - `Other Useful Things`_
 
@@ -241,26 +240,23 @@
     >>> a = ['4.5', 6, 2.0, '5', 'a']
     >>> natsorted(a)
     [2.0, '4.5', '5', 6, 'a']
-    >>> # On Python 2, sorted(a) would return [2.0, 6, '4.5', '5', 'a']
-    >>> # On Python 3, sorted(a) would raise an "unorderable types" TypeError
+    >>> # sorted(a) would raise an "unorderable types" TypeError
 
-Handling Bytes on Python 3
-++++++++++++++++++++++++++
+Handling Bytes
+++++++++++++++
 
-``natsort`` does not officially support the `bytes` type on Python 3, but
+``natsort`` does not officially support the `bytes` type, but
 convenience functions are provided that help you decode to `str` first:
 
 .. code-block:: pycon
 
     >>> from natsort import as_utf8
     >>> a = [b'a', 14.0, 'b']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would raise a TypeError (bytes() < str())
+    >>> # natsorted(a) would raise a TypeError (bytes() < str())
     >>> natsorted(a, key=as_utf8) == [14.0, b'a', 'b']
     True
     >>> a = [b'a56', b'a5', b'a6', b'a40']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would return the same results as sorted(a)
+    >>> # natsorted(a) would return the same results as sorted(a)
     >>> natsorted(a, key=as_utf8) == [b'a5', b'a6', b'a40', b'a56']
     True
 
@@ -446,27 +442,8 @@
 
 This will place the documentation in ``build/sphinx/html``.
 
-Deprecation Schedule
---------------------
-
-Dropped Python 3.4 and Python 3.5 Support
-+++++++++++++++++++++++++++++++++++++++++
-
-``natsort`` version 8.0.0 dropped support for Python < 3.6.
-
-Dropped Python 2.7 Support
-++++++++++++++++++++++++++
-
-``natsort`` version 7.0.0 dropped support for Python 2.7.
-
-The version 6.X branch will remain as a "long term support" branch where bug
-fixes are applied so that users who cannot update from Python 2.7 will not be
-forced to use a buggy ``natsort`` version (bug fixes will need to be requested;
-by default only the 7.X branch will be updated).
-New features would not be added to version 6.X, only bug fixes.
-
 Dropped Deprecated APIs
-+++++++++++++++++++++++
+-----------------------
 
 In ``natsort`` version 6.0.0, the following APIs and functions were removed
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/docs/api.rst 
new/natsort-8.1.0/docs/api.rst
--- old/natsort-8.0.2/docs/api.rst      2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/docs/api.rst      2022-01-31 04:20:37.000000000 +0100
@@ -83,8 +83,8 @@
 
 .. _bytes_help:
 
-Help With Bytes On Python 3
-+++++++++++++++++++++++++++
+Help With Bytes
++++++++++++++++
 
 The official stance of :mod:`natsort` is to not support `bytes` for
 sorting; there is just too much that can go wrong when trying to automate
@@ -121,7 +121,7 @@
 Help With Type Hinting
 ++++++++++++++++++++++
 
-If you need to explictly specify the types that natsort accepts or returns
+If you need to explicitly specify the types that natsort accepts or returns
 in your code, the following types have been exposed for your convenience.
 
 
+--------------------------------+----------------------------------------------------------------------------------------+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/docs/conf.py 
new/natsort-8.1.0/docs/conf.py
--- old/natsort-8.0.2/docs/conf.py      2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/docs/conf.py      2022-01-31 04:20:37.000000000 +0100
@@ -59,7 +59,7 @@
 # built documents.
 #
 # The full version, including alpha/beta/rc tags.
-release = "8.0.2"
+release = "8.1.0"
 # The short X.Y version.
 version = ".".join(release.split(".")[0:2])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/docs/examples.rst 
new/natsort-8.1.0/docs/examples.rst
--- old/natsort-8.0.2/docs/examples.rst 2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/docs/examples.rst 2022-01-31 04:20:37.000000000 +0100
@@ -158,7 +158,7 @@
     >>> natsorted(a, alg=ns.IGNORECASE)
     ['Apple', 'apple', 'Banana', 'banana', 'corn', 'Corn']
 
-Note thats since Python's sorting is stable, the order of equivalent
+Note that's since Python's sorting is stable, the order of equivalent
 elements after lowering the case is the same order they appear in the
 original list.
 
@@ -349,10 +349,10 @@
     >>> natsorted(a, reverse=True)
     ['a10', 'a9', 'a4', 'a2', 'a1']
 
-Sorting Bytes on Python 3
--------------------------
+Sorting Bytes
+-------------
 
-Python 3 is rather strict about comparing strings and bytes, and this
+Python is rather strict about comparing strings and bytes, and this
 can make it difficult to deal with collections of both. Because of the
 challenge of guessing which encoding should be used to decode a bytes
 array to a string, :mod:`natsort` does *not* try to guess and automatically
@@ -368,8 +368,7 @@
 
     >>> from natsort import as_ascii
     >>> a = [b'a', 14.0, 'b']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would raise a TypeError (bytes() < str())
+    >>> # natsorted(a) would raise a TypeError (bytes() < str())
     >>> natsorted(a, key=as_ascii) == [14.0, b'a', 'b']
     True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/docs/howitworks.rst 
new/natsort-8.1.0/docs/howitworks.rst
--- old/natsort-8.0.2/docs/howitworks.rst       2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/docs/howitworks.rst       2022-01-31 04:20:37.000000000 
+0100
@@ -413,11 +413,18 @@
     >>> a > b
     True
 
-Comparing Different Types on Python 3
-+++++++++++++++++++++++++++++++++++++
+.. note::
+
+    The actual :meth:`decompose_path_into_components`-equivalent function in
+    :mod:`natsort` actually has a few more heuristics than shown here so that
+    it is not over-zealous in what it defines as a path suffix, but this has
+    been omitted in this how-to for clarity.
+
+Comparing Different Types
++++++++++++++++++++++++++
 
 `The second major special case I encountered was sorting of different types`_.
-If you are on Python 2 (i.e. legacy Python), this mostly doesn't matter *too*
+On Python 2 (i.e. legacy Python), this mostly didnt't matter *too*
 much since it uses an arbitrary heuristic to allow traditionally un-comparable
 types to be compared (such as comparing ``'a'`` to ``1``). However, on Python 3
 (i.e. Python) it simply won't let you perform such nonsense, raising a
@@ -662,9 +669,9 @@
 #. :mod:`locale` is a thin wrapper over your operating system's *locale*
    library, so if *that* is broken (like it is on BSD and OSX) then
    :mod:`locale` is broken in Python.
-#. Because of a bug in legacy Python (i.e. Python 2), there is no uniform
+#. Because of a bug in legacy Python (i.e. Python 2), there was no uniform
    way to use the :mod:`locale` sorting functionality between legacy Python
-   and Python 3.
+   and Python (luckily this is no longer an issue now that Python 2 is EOL).
 #. People have differing opinions of how capitalization should affect word
    order.
 #. There is no built-in way to handle locale-dependent thousands separators
@@ -715,23 +722,13 @@
     >>> sorted(a, key=lambda x: x.swapcase())
     ['apple', 'banana', 'corn', 'Apple', 'Banana', 'Corn']
 
-The last (i call it *IGNORECASE*) should be super easy, right?
-Simply call :meth:`str.lowercase` on the input. This will work but may
-not always give the correct answer on non-latin character sets. It's
-a good thing that in Python 3.3
-:meth:`str.casefold` was introduced, which does a better job of removing
-all case information from unicode characters in
-non-latin alphabets.
+The last (i call it *IGNORECASE*) is pretty easy.
+Simply call :meth:`str.casefold` on the input (it's like :meth:`std.lowercase`
+but does a better job on non-latin character sets).
 
 .. code-block:: pycon
 
-    >>> def remove_case(x):
-    ...     try:
-    ...         return x.casefold()
-    ...     except AttributeError:  # Legacy Python backwards compatibility
-    ...         return x.lowercase()
-    ...
-    >>> sorted(a, key=remove_case)
+    >>> sorted(a, key=lambda x: x.casefold())
     ['Apple', 'apple', 'Banana', 'banana', 'corn', 'Corn']
 
 The middle case (I call it *GROUPLETTERS*) is less straightforward.
@@ -742,7 +739,7 @@
 
     >>> import itertools
     >>> def groupletters(x):
-    ...     return ''.join(itertools.chain.from_iterable((remove_case(y), y) 
for y in x))
+    ...     return ''.join(itertools.chain.from_iterable((y.casefold(), y) for 
y in x))
     ...
     >>> groupletters('Apple')
     'aAppppllee'
@@ -904,13 +901,69 @@
 be applied as part of the :func:`coerce_to_int`/:func:`coerce_to_float`
 functions in a manner similar to :func:`groupletters`.
 
-As you might have guessed, there is a small problem.
-It turns out the there is a bug in the legacy Python implementation of
-:func:`locale.strxfrm` that causes it to outright fail for :func:`unicode`
-input (https://bugs.python.org/issue2481). :func:`locale.strcoll` works,
-but is intended for use with ``cmp``, which does not exist in current Python
-implementations. Luckily, the :func:`functools.cmp_to_key` function
-makes :func:`locale.strcoll` behave like :func:`locale.strxfrm`.
+Unicode Support With Local
+++++++++++++++++++++++++++
+
+Remember how in the `Basic Unicode Support`_ section I mentioned that we
+use the "decompressed" Unicode normalization form (e.g. NFD) on all inputs
+to ensure the order is as expected?
+
+If you have been following along so far, you probably expect that it is not
+that easy. You would be correct.
+
+It turns out that some locales (but not all) expect the input to be in
+"compressed form" (e.g. NFC) or the ordering is not as you might expect.
+`Check out this issue for a real-world example`_. Here's a relevant
+snippet of code
+
+.. code-block:: pycon
+
+    In [1]: import locale, unicodedata
+
+    In [2]: a = ['A??', 'Cheb', '??esko', 'Cibulov', 'Znojmo', '??ilina']
+
+    In [3]: locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
+    Out[3]: 'en_US.UTF-8'
+
+    In [4]: sorted(a, key=locale.strxfrm)
+    Out[4]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [5]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFD", x)))
+    Out[5]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [6]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFC", x)))
+    Out[6]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [7]: locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
+    Out[7]: 'de_DE.UTF-8'
+
+    In [8]: sorted(a, key=locale.strxfrm)
+    Out[8]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [9]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFD", x)))
+    Out[9]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [10]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFC", x)))
+    Out[10]: ['A??', '??esko', 'Cheb', 'Cibulov', '??ilina', 'Znojmo']
+
+    In [11]: locale.setlocale(locale.LC_ALL, 'cs_CZ.UTF-8')
+    Out[11]: 'cs_CZ.UTF-8'
+
+    In [12]: sorted(a, key=locale.strxfrm)
+    Out[12]: ['A??', 'Cibulov', '??esko', 'Cheb', 'Znojmo', '??ilina']
+
+    In [13]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFD", x)))
+    Out[13]: ['A??', '??esko', 'Cibulov', 'Cheb', '??ilina', 'Znojmo']
+
+    In [14]: sorted(a, key=lambda x: 
locale.strxfrm(unicodedata.normalize("NFC", x)))
+    Out[14]: ['A??', 'Cibulov', '??esko', 'Cheb', 'Znojmo', '??ilina']
+
+Two out of three locales sort the same data in the same order no matter how 
the unicode
+input was normalized, but Czech seems to care how the input is formatted!
+
+So, everthing mentioned in `Basic Unicode Support`_ is conditional on whether
+or not the user wants to use the :mod:`locale` library or not. If not, then
+"NFD" normalization is used. If they do, "NFC" normalization is used.
 
 Handling Broken Locale On OSX
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1121,3 +1174,4 @@
 .. _really good: https://hypothesis.readthedocs.io/en/latest/
 .. _testing strategy: https://docs.pytest.org/en/latest/
 .. _check out some official Unicode documentation: 
https://unicode.org/reports/tr15/
+.. _Check out this issue for a real-world example: 
https://github.com/SethMMorton/natsort/issues/140
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/docs/locale_issues.rst 
new/natsort-8.1.0/docs/locale_issues.rst
--- old/natsort-8.0.2/docs/locale_issues.rst    2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/docs/locale_issues.rst    2022-01-31 04:20:37.000000000 
+0100
@@ -23,7 +23,7 @@
 
 When :func:`~natsort.natsort_keygen` is called it returns a key function that
 hard-codes the provided settings. This means that the key returned when
-``ns.LOCALE`` is used contains the settings specifed by the locale
+``ns.LOCALE`` is used contains the settings specified by the locale
 *loaded at the time the key is generated*. If you change the locale,
 you should regenerate the key to account for the new locale.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/natsort/__init__.py 
new/natsort-8.1.0/natsort/__init__.py
--- old/natsort-8.0.2/natsort/__init__.py       2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/natsort/__init__.py       2022-01-31 04:20:37.000000000 
+0100
@@ -23,7 +23,7 @@
 from natsort.ns_enum import NSType, ns
 from natsort.utils import KeyType, NatsortInType, NatsortOutType, 
chain_functions
 
-__version__ = "8.0.2"
+__version__ = "8.1.0"
 
 __all__ = [
     "natsort_key",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/natsort/natsort.py 
new/natsort-8.1.0/natsort/natsort.py
--- old/natsort-8.0.2/natsort/natsort.py        2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/natsort/natsort.py        2022-01-31 04:20:37.000000000 
+0100
@@ -876,7 +876,7 @@
     .. warning::
 
         The resulting function will generate results that will be
-        differnt depending on your platform. This is intentional.
+        different depending on your platform. This is intentional.
 
     On Windows, this will sort with the same order as Windows Explorer.
 
@@ -892,7 +892,7 @@
       special characters this will give correct results, but once
       special characters are added you should lower your expectations.
 
-    It is *strongly* reccommended to have :mod:`pyicu` installed on
+    It is *strongly* recommended to have :mod:`pyicu` installed on
     MacOS/Linux if you want correct sort results.
 
     It does *not* take into account if a path is a directory or a file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/natsort/unicode_numbers.py 
new/natsort-8.1.0/natsort/unicode_numbers.py
--- old/natsort-8.0.2/natsort/unicode_numbers.py        2021-12-14 
18:20:38.000000000 +0100
+++ new/natsort-8.1.0/natsort/unicode_numbers.py        2022-01-31 
04:20:37.000000000 +0100
@@ -24,7 +24,7 @@
 # The digit characters are a subset of the numerals.
 digit_chars = [a for a in numeric_chars if unicodedata.digit(a, None) is not 
None]
 
-# The decimal characters are a subset of the numberals
+# The decimal characters are a subset of the numerals
 # (probably of the digits, but let's be safe).
 decimal_chars = [a for a in numeric_chars if unicodedata.decimal(a, None) is 
not None]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/natsort/utils.py 
new/natsort-8.1.0/natsort/utils.py
--- old/natsort-8.0.2/natsort/utils.py  2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/natsort/utils.py  2022-01-31 04:20:37.000000000 +0100
@@ -893,16 +893,21 @@
         path_parts = []
         base = str(s)
 
-    # Now, split off the file extensions until we reach a decimal number at
-    # the beginning of the suffix or there are no more extensions.
-    suffixes = PurePath(base).suffixes
-    try:
-        digit_index = next(i for i, x in enumerate(reversed(suffixes)) if 
_d_match(x))
-    except StopIteration:
-        pass
-    else:
-        digit_index = len(suffixes) - digit_index
-        suffixes = suffixes[digit_index:]
+    # Now, split off the file extensions until
+    #  - we reach a decimal number at the beginning of the suffix
+    #  - more than two suffixes have been seen
+    #  - a suffix is more than five characters (including leading ".")
+    #  - there are no more extensions
+    suffixes = []
+    for i, suffix in enumerate(reversed(PurePath(base).suffixes)):
+        if _d_match(suffix) or i > 1 or len(suffix) > 5:
+            break
+        suffixes.append(suffix)
+    suffixes.reverse()
 
+    # Remove the suffixes from the base component
     base = base.replace("".join(suffixes), "")
-    return filter(None, ichain(path_parts, [base], suffixes))
+    base_component = [base] if base else []
+
+    # Join all path comonents in an iterator
+    return filter(None, ichain(path_parts, base_component, suffixes))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/natsort.egg-info/PKG-INFO 
new/natsort-8.1.0/natsort.egg-info/PKG-INFO
--- old/natsort-8.0.2/natsort.egg-info/PKG-INFO 2021-12-14 18:20:41.000000000 
+0100
+++ new/natsort-8.1.0/natsort.egg-info/PKG-INFO 2022-01-31 04:20:39.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: natsort
-Version: 8.0.2
+Version: 8.1.0
 Summary: Simple yet flexible natural sorting in Python.
 Home-page: https://github.com/SethMMorton/natsort
 Author: Seth M. Morton
@@ -68,11 +68,10 @@
     - `Installation`_
     - `How to Run Tests`_
     - `How to Build Documentation`_
-    - `Deprecation Schedule`_
+    - `Dropped Deprecated APIs`_
     - `History`_
 
-**NOTE**: Please see the `Deprecation Schedule`_ section for changes in
-``natsort`` version 7.0.0.
+**NOTE**: Please see the `Dropped Deprecated APIs`_ section for changes.
 
 Quick Description
 -----------------
@@ -137,7 +136,7 @@
 - `Locale-Aware Sorting (or "Human Sorting")`_
 - `Further Customizing Natsort`_
 - `Sorting Mixed Types`_
-- `Handling Bytes on Python 3`_
+- `Handling Bytes`_
 - `Generating a Reusable Sorting Key and Sorting In-Place`_
 - `Other Useful Things`_
 
@@ -275,26 +274,23 @@
     >>> a = ['4.5', 6, 2.0, '5', 'a']
     >>> natsorted(a)
     [2.0, '4.5', '5', 6, 'a']
-    >>> # On Python 2, sorted(a) would return [2.0, 6, '4.5', '5', 'a']
-    >>> # On Python 3, sorted(a) would raise an "unorderable types" TypeError
+    >>> # sorted(a) would raise an "unorderable types" TypeError
 
-Handling Bytes on Python 3
-++++++++++++++++++++++++++
+Handling Bytes
+++++++++++++++
 
-``natsort`` does not officially support the `bytes` type on Python 3, but
+``natsort`` does not officially support the `bytes` type, but
 convenience functions are provided that help you decode to `str` first:
 
 .. code-block:: pycon
 
     >>> from natsort import as_utf8
     >>> a = [b'a', 14.0, 'b']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would raise a TypeError (bytes() < str())
+    >>> # natsorted(a) would raise a TypeError (bytes() < str())
     >>> natsorted(a, key=as_utf8) == [14.0, b'a', 'b']
     True
     >>> a = [b'a56', b'a5', b'a6', b'a40']
-    >>> # On Python 2, natsorted(a) would would work as expected.
-    >>> # On Python 3, natsorted(a) would return the same results as sorted(a)
+    >>> # natsorted(a) would return the same results as sorted(a)
     >>> natsorted(a, key=as_utf8) == [b'a5', b'a6', b'a40', b'a56']
     True
 
@@ -480,27 +476,8 @@
 
 This will place the documentation in ``build/sphinx/html``.
 
-Deprecation Schedule
---------------------
-
-Dropped Python 3.4 and Python 3.5 Support
-+++++++++++++++++++++++++++++++++++++++++
-
-``natsort`` version 8.0.0 dropped support for Python < 3.6.
-
-Dropped Python 2.7 Support
-++++++++++++++++++++++++++
-
-``natsort`` version 7.0.0 dropped support for Python 2.7.
-
-The version 6.X branch will remain as a "long term support" branch where bug
-fixes are applied so that users who cannot update from Python 2.7 will not be
-forced to use a buggy ``natsort`` version (bug fixes will need to be requested;
-by default only the 7.X branch will be updated).
-New features would not be added to version 6.X, only bug fixes.
-
 Dropped Deprecated APIs
-+++++++++++++++++++++++
+-----------------------
 
 In ``natsort`` version 6.0.0, the following APIs and functions were removed
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/setup.cfg new/natsort-8.1.0/setup.cfg
--- old/natsort-8.0.2/setup.cfg 2021-12-14 18:20:41.139580200 +0100
+++ new/natsort-8.1.0/setup.cfg 2022-01-31 04:20:39.787069300 +0100
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 8.0.2
+current_version = 8.1.0
 commit = True
 tag = True
 tag_name = {new_version}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/setup.py new/natsort-8.1.0/setup.py
--- old/natsort-8.0.2/setup.py  2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/setup.py  2022-01-31 04:20:37.000000000 +0100
@@ -4,7 +4,7 @@
 
 setup(
     name="natsort",
-    version="8.0.2",
+    version="8.1.0",
     packages=find_packages(),
     entry_points={"console_scripts": ["natsort = natsort.__main__:main"]},
     python_requires=">=3.6",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/tests/test_natsorted.py 
new/natsort-8.1.0/tests/test_natsorted.py
--- old/natsort-8.0.2/tests/test_natsorted.py   2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/tests/test_natsorted.py   2022-01-31 04:20:37.000000000 
+0100
@@ -182,6 +182,21 @@
     assert natsorted(given, alg=ns.PATH) == expected
 
 
+def test_natsorted_path_extensions_heuristic() -> None:
+    # https://github.com/SethMMorton/natsort/issues/145
+    given = [
+        "Try.Me.Bug - 09 - One.Two.Three.[text].mkv",
+        "Try.Me.Bug - 07 - One.Two.5.[text].mkv",
+        "Try.Me.Bug - 08 - One.Two.Three[text].mkv",
+    ]
+    expected = [
+        "Try.Me.Bug - 07 - One.Two.5.[text].mkv",
+        "Try.Me.Bug - 08 - One.Two.Three[text].mkv",
+        "Try.Me.Bug - 09 - One.Two.Three.[text].mkv",
+    ]
+    assert natsorted(given, alg=ns.PATH) == expected
+
+
 @pytest.mark.parametrize(
     "alg, expected",
     [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/tests/test_utils.py 
new/natsort-8.1.0/tests/test_utils.py
--- old/natsort-8.0.2/tests/test_utils.py       2021-12-14 18:20:38.000000000 
+0100
+++ new/natsort-8.1.0/tests/test_utils.py       2022-01-31 04:20:37.000000000 
+0100
@@ -6,7 +6,7 @@
 import string
 from itertools import chain
 from operator import neg as op_neg
-from typing import List, Pattern, Union
+from typing import List, Pattern, Tuple, Union
 
 import pytest
 from hypothesis import given
@@ -155,9 +155,26 @@
     assert tuple(utils.path_splitter(z)) == tuple(pathlib.Path(z).parts)
 
 
-def 
test_path_splitter_splits_path_string_by_sep_and_removes_extension_example() -> 
None:
-    given = "/this/is/a/path/file.x1.10.tar.gz"
-    expected = (os.sep, "this", "is", "a", "path", "file.x1.10", ".tar", ".gz")
+@pytest.mark.parametrize(
+    "given, expected",
+    [
+        (
+            "/this/is/a/path/file.x1.10.tar.gz",
+            (os.sep, "this", "is", "a", "path", "file.x1.10", ".tar", ".gz"),
+        ),
+        (
+            "/this/is/a/path/file.x1.10.tar",
+            (os.sep, "this", "is", "a", "path", "file.x1.10", ".tar"),
+        ),
+        (
+            "/this/is/a/path/file.x1.threethousand.tar",
+            (os.sep, "this", "is", "a", "path", "file.x1.threethousand", 
".tar"),
+        ),
+    ],
+)
+def test_path_splitter_splits_path_string_by_sep_and_removes_extension_example(
+    given: str, expected: Tuple[str, ...]
+) -> None:
     assert tuple(utils.path_splitter(given)) == tuple(expected)
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/natsort-8.0.2/tox.ini new/natsort-8.1.0/tox.ini
--- old/natsort-8.0.2/tox.ini   2021-12-14 18:20:38.000000000 +0100
+++ new/natsort-8.1.0/tox.ini   2022-01-31 04:20:37.000000000 +0100
@@ -6,7 +6,7 @@
 [tox]
 envlist =
     flake8, mypy, py36, py37, py38, py39, py310
-# Other valid evironments are:
+# Other valid environments are:
 #   docs
 #   release
 #   clean

Reply via email to