summaryrefslogtreecommitdiff
path: root/natsort
Commit message (Collapse)AuthorAgeFilesLines
* Bump version: 8.3.0 → 8.3.18.3.1Seth Morton2023-03-011-1/+1
|
* Add FreeBSD fix for locale failureSeth Morton2023-03-011-1/+1
| | | | | | | | | | 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.
* Bump version: 8.2.0 → 8.3.0Seth Morton2023-02-271-1/+1
|
* Fixed bug in NANLAST/NANFIRSTSeth Morton2023-02-271-5/+8
| | | | | | | 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.
* Update the hard-coded unicode hex table for Python 3.11Seth Morton2023-02-271-0/+10
|
* Add presort to natsorted and friendsSeth Morton2023-02-272-1/+21
| | | | | | 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.
* Ensure None, NaN, and Infinity are sorted consistentlySeth Morton2023-02-261-1/+11
| | | | | | | 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.
* Solve static analysis errorsSeth Morton2023-02-261-5/+5
|
* Enable new, more performant fastnumbersSeth Morton2023-02-263-18/+52
| | | | | | 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.
* blackSeth Morton2023-02-261-2/+1
|
* Use isintance over duck typingSeth Morton2023-02-261-23/+16
| | | | | This makes what is happening a bit clearer, and plays with mypy much better.
* Run with newest blackSeth Morton2023-02-262-3/+0
|
* only convert input to str if necessaryDobatymo2023-01-111-1/+4
|
* Bump version: 8.1.0 → 8.2.08.2.0Seth Morton2022-09-011-1/+1
|
* Fix issues found in CISeth Morton2022-09-012-2/+0
|
* Add stubs for icuSeth Morton2022-09-011-5/+6
| | | | This way we don't need to use casts in-code.
* Simplify type hints for public functionsSeth Morton2022-09-012-183/+90
| | | | | | | | | ...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.
* Fixed locale string mypy issueGilthans2022-08-291-1/+1
|
* Fixed locale string mypy issueGilthans2022-08-231-6/+7
|
* Treat paths as strings in StrParserGilthans2022-08-111-5/+9
|
* Bump version: 8.0.2 → 8.1.08.1.0Seth Morton2022-01-301-1/+1
|
* Add some limiting heuristics to the PATH suffix splittingSeth Morton2022-01-291-12/+17
| | | | | | | | | | | | | | | | | | | | | | The prior algorithm went as follows: Obtain ALL suffixes from the base component of the filename. Then, starting from the back, keep the suffixes split until a suffix is encountered that begins with the regular expression /.\d/. It was assumed that this was intended to be a floating point number, and not an extension, and thus the splitting would stop at that point. Some input has been seen where the filenames are composed nearly entirely of Word.then.dot.and.then.dot. One entry amongst them contained Word.then.dot.5.then.dot. This caused this one entry to be treated differently from the rest of the entries due to the ".5", and the sorting order was not as expected. The new algorithm is as follows: Obtain a maxium of two suffixes. Keep these suffixes until one of them has a length greater than 4 or starts with the regular expression /.\d/. This heuristic of course is not bullet-proof, but it will do a better job on most real-world filenames than the previous algorithm.
* Revert "Black"Seth Morton2022-01-292-2/+0
| | | | This reverts commit b85dea24e0db30d2652f6ad46fb2a199e15960d2.
* Merge branch 'master' of github.com:SethMMorton/natsortSeth Morton2022-01-282-3/+3
|\
| * Fix typosKian-Meng, Ang2021-12-302-3/+3
| |
* | BlackSeth Morton2022-01-282-0/+2
|/
* Bump version: 8.0.1 → 8.0.28.0.2Seth Morton2021-12-141-1/+1
|
* Add handling for '.' when splitting pathsSeth Morton2021-12-141-1/+5
| | | | | | | 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.
* Bump version: 8.0.0 → 8.0.18.0.1Seth Morton2021-12-101-1/+1
|
* BlackSeth Morton2021-12-102-2/+0
|
* Combine unicode normalization for LOCALESeth Morton2021-12-091-5/+26
| | | | | For some locales, the unicode cannot be decomposed otherwise the ordering is incorrect.
* Bump version: 7.2.0 → 8.0.08.0.0Seth Morton2021-11-031-1/+1
|
* Bump version: 7.1.1 → 7.2.07.2.0Seth Morton2021-11-021-1/+1
|
* Remove fastnumbers type ignore statementSeth Morton2021-11-012-3/+3
|
* Actually do overloads correctlySeth Morton2021-10-301-126/+68
| | | | | | Originally I did not realize that it was possible to put the keyword arguments in an overload, so I ended up doing way more overload definitions than needed.
* Eliminate unneeded cast in __main__.pySeth Morton2021-10-301-3/+3
|
* Add py.typedSeth Morton2021-10-301-0/+0
| | | | This will expose Natsort's types to libraries using it.
* Fix other bugs introduced in the shuffleSeth Morton2021-10-293-5/+22
|
* Simplify typesSeth Morton2021-10-293-35/+33
| | | | Some over-specified types have been made a bit more general.
* Expose the NSType in the public APISeth Morton2021-10-281-1/+2
|
* Rename some typesSeth Morton2021-10-283-49/+56
|
* natsort now passes mypy with --strictSeth Morton2021-10-277-65/+96
|
* Expose some internal types to the userSeth Morton2021-10-271-1/+10
|
* Fully type hint natsort.pySeth Morton2021-10-271-24/+233
|
* Fully typehint utils.pySeth Morton2021-10-271-59/+188
| | | | | | OK - this *might* have gone a bit overboard, but I have always thought it was hard to keep track of what most of the utility functions are returning and this really helps.
* Add type hints to "minor" filesSeth Morton2021-10-265-40/+79
| | | | | | 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.
* Satisfy mypy for library as-isSeth Morton2021-10-243-6/+10
| | | | Without adding any annotations, make sure mypy is happy.
* The ns enum actually now is a python enumSeth Morton2021-10-242-72/+33
| | | | | | | | | 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.
* Support Type Hinting thethiny2021-08-311-1/+6
| | | | Added support for type hinting for consistency with `sorted` from builtints. This allows Iterables of Custom Objects to be typed.
* Don't import distutils to check the fastnumbers version.Dominic Davis-Foster2021-04-121-2/+20
| | | | Blacken