| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Just use UTF8.
|
|
|
|
| |
Turns out a fair amount of the problems were with natsort itself.
|
|
|
|
|
|
|
|
|
|
| |
FreeBSD seems to throw an OSError when locale.strxfrm is given 'Å',
which is surprising behavior. Well, maybe not, considering how many bugs
I have found with FreeBSD's implementation of locale over the course of
natsort development.
Anyway, we just ignore any input that causes locale.strxfrm to barf in
our tests.
|
| |
|
|
|
|
|
|
|
| |
The previous code change to make NaN and None ordering consistent made
it so that NANLAST did not put NaN last. Oops.
It also had made it so that NaN wasn't first for NANFIRST. Oops.
|
|
|
|
|
|
| |
This will sort the collection as strings before sorting with the natsort
algorithm. This ensures that strings that are different but represent
the same numerical value get sorted independent of input order.
|
|
|
|
|
|
|
| |
Internally, these may be translated to the same value, so they will be
output in the same order they were input, which could lead to suprise.
This commit ensures the order is always consistent.
|
| |
|
|
|
|
|
|
| |
The new version can convert the entire mapping internally, so we use
that if possible. A new wrapper for this new function is introduced to
make the calling code consistent.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
...and to some degree private as well.
Previously, the declared hints for natsort were too restrictive.
Generics and protocols are now utilized to make the type hints more
"open" which is more realistic, since more than just basic types can be
sorted.
|
| |
|
| |
|
|
|
|
|
|
|
| |
I'm not sure sure it is *actually* a bug, but the PATH algorithm's way
of splitting extensions was over-zealous and in practice will split off
more extensions that is probably desired. To fix this, we will need to
add a heuristic, but this commit adds tests to demonstrate the problem.
|
|
|
|
|
|
|
| |
pathlib.Path(".").parts returns an empty tuple. This is unexpected, and
caused a tuple unpacking statement to fail. The solution is to catch the
ValueError from tuple unpacking and manually construct the return
values.
|
| |
|
|
|
|
| |
This ensures that going forward this won't not sort correctly.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
That was... a lot.
There are still errors in the os_sorted tests, but that requires me to
rethink some typing decisions in the main code so that will be for a
future commit.
|
|
|
|
|
|
| |
The compat and __main__ files have had type hints added. The unicode_*
files all do not need type hints (because all variables are deducable),
same with the ns_enum file.
|
|
|
|
|
|
|
|
|
| |
I have been wanting to do this for quite some time, but needed the
functionality of the IntEnum for backwards-compatibility. Now that
Python 3.5 is no longer supported, the IntEnum can be used and the
definition of ns is far simpler than it used to be.
This plays nice with mypy also, which is the driving change.
|
|
|
|
|
|
|
| |
- The SemVer function used in the examples was deprecated, so the
suggested alternative is now used instead.
- Hypothesis apparently doesn't play well with function-scoped fixtures
and has started warning about it - those tests have been rewritten.
|
|
|
|
|
| |
It turns out I had an error in the Travis-CI black invocation that cause
it to not actually catch formatting errors. Oops!
|
| |
|
|
|
|
| |
Instead of failing, it only raises a warning.
|
| |
|
| |
|
|
|
|
|
| |
ICU is used to sort on UNIX-based platforms. If not given, the results
are OK, but not exactly what you would expect.
|
|
|
|
|
|
|
| |
This will work on any operating system.
The current implementation is known to not work on non-Windows. Future
commits will fix this.
|
|
|
|
| |
Basic tests
|
|
|
|
|
|
| |
This will prevent TypeErrors.
This closes issue #117.
|
|
|
|
|
| |
These tests make sure the locale number formatting regex works
correctly.
|
|
|
|
|
| |
This test highlights the bug, and its presence ensures it does not occur
again.
|
|
|
|
|
|
|
| |
mocker.patch no longer supports context managers. Not sure why I was
using it in a context manager in the first place...
This closes issue #107.
|
| |
|
|
|
|
| |
supports Python 3.8 and Python 2.7. Thiscommit can be reverted to then remove 2.7 support again.
|
|\
| |
| |
| | |
Had to resolve addition of numeric_regex_chooser, and version.
|
| |\
| | |
| | |
| | | |
This pull request adds an example of how to sort based on units, and also exposes
a new function that helps building custom functions easier.
|
| | | |
|
| | |
| | |
| | |
| | | |
This reverts commit af9e242433a0df387ba0ae5b123f9f590aefbd46.
|
| | |
| | |
| | |
| | |
| | | |
For some reason, some tests are deemed "too slow" by
hypothesis and cause test failure.
|
| | | |
|
| |/ |
|
| |
| |
| |
| | |
This resolves *most* of the remaining Python 2 compatibility code.
|
| |
| |
| |
| | |
cmp is Python 2 only.
|
| |
| |
| |
| |
| |
| |
| |
| | |
pathlib comes with Python 3.4 stdlib, so no need to add a compatibility
layer.
The path_splitter function has been re-written in terms of pathlib
since that is now guaranteed to exist. Much simpler.
|
|/
|
|
| |
No longer needed when supporting Python 2 is no dropped.
|
|
|
|
|
|
|
|
|
|
| |
If a unix-style absolute path is given to the path_splitter on Windows,
the first element was a unix-style path separator and not a Windows path
sparator. This has been fixed.
The docstring has updated to be true for all OSes.
Unit tests are updated to account for this change.
|