1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, pytest
6, pytestcov
7, pytest-mock
8, hypothesis
9, glibcLocales
10, pathlib ? null
11}:
12
13buildPythonPackage rec {
14 pname = "natsort";
15 version = "6.0.0";
16
17 checkInputs = [
18 pytest
19 pytestcov
20 pytest-mock
21 hypothesis
22 glibcLocales
23 ]
24 # pathlib was made part of standard library in 3.5:
25 ++ (lib.optionals (pythonOlder "3.4") [ pathlib ]);
26
27 src = fetchPypi {
28 inherit pname version;
29 sha256 = "ff3effb5618232866de8d26e5af4081a4daa9bb0dfed49ac65170e28e45f2776";
30 };
31
32 # testing based on project's tox.ini
33 checkPhase = ''
34 pytest --doctest-modules natsort
35 pytest
36 '';
37
38 meta = {
39 description = "Natural sorting for python";
40 homepage = https://github.com/SethMMorton/natsort;
41 license = lib.licenses.mit;
42 };
43}