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