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.2.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 = "58c6fb2f355117e88a19808394ec1ed30a2ff881bdd2c81c436952caebd30668";
30 };
31
32 # testing based on project's tox.ini
33 # natsort_keygen has pytest mock issues
34 checkPhase = ''
35 pytest --doctest-modules natsort
36 pytest --ignore=tests/test_natsort_keygen.py
37 '';
38
39 meta = {
40 description = "Natural sorting for python";
41 homepage = https://github.com/SethMMorton/natsort;
42 license = lib.licenses.mit;
43 };
44}