2017-05-14 19:05:50 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
2018-12-03 09:35:08 +00:00
|
|
|
, pytestcov
|
|
|
|
, pytest-mock
|
|
|
|
, hypothesis
|
2017-05-14 19:05:50 +01:00
|
|
|
, glibcLocales
|
|
|
|
, pathlib ? null
|
2020-06-19 10:21:42 +01:00
|
|
|
, isPy3k
|
2017-05-14 19:05:50 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "natsort";
|
2020-06-06 07:47:19 +01:00
|
|
|
version = "7.0.1";
|
2017-05-14 19:05:50 +01:00
|
|
|
|
2018-02-20 20:34:44 +00:00
|
|
|
checkInputs = [
|
2017-05-14 19:05:50 +01:00
|
|
|
pytest
|
2018-12-03 09:35:08 +00:00
|
|
|
pytestcov
|
|
|
|
pytest-mock
|
|
|
|
hypothesis
|
2017-05-14 19:05:50 +01:00
|
|
|
glibcLocales
|
|
|
|
]
|
|
|
|
# pathlib was made part of standard library in 3.5:
|
2018-12-03 09:35:08 +00:00
|
|
|
++ (lib.optionals (pythonOlder "3.4") [ pathlib ]);
|
2017-05-14 19:05:50 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-06 07:47:19 +01:00
|
|
|
sha256 = "a633464dc3a22b305df0f27abcb3e83515898aa1fd0ed2f9726c3571a27258cf";
|
2017-05-14 19:05:50 +01:00
|
|
|
};
|
|
|
|
|
2020-06-19 10:20:35 +01:00
|
|
|
# Does not support Python 2
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2017-05-14 19:05:50 +01:00
|
|
|
# testing based on project's tox.ini
|
2019-12-20 17:32:08 +00:00
|
|
|
# natsort_keygen has pytest mock issues
|
2017-05-14 19:05:50 +01:00
|
|
|
checkPhase = ''
|
|
|
|
pytest --doctest-modules natsort
|
2019-12-20 17:32:08 +00:00
|
|
|
pytest --ignore=tests/test_natsort_keygen.py
|
2017-05-14 19:05:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Natural sorting for python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/SethMMorton/natsort";
|
2017-05-14 19:05:50 +01:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|