2017-05-14 19:05:50 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2018-02-26 21:53:18 +00:00
|
|
|
, isPy35
|
|
|
|
, isPy36
|
2017-05-14 19:05:50 +01:00
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, pytestcache
|
2018-02-26 21:53:18 +00:00
|
|
|
, pytestcov
|
2017-05-14 19:05:50 +01:00
|
|
|
, pytestflakes
|
|
|
|
, pytestpep8
|
|
|
|
, pytest
|
|
|
|
, glibcLocales
|
|
|
|
, mock ? null
|
|
|
|
, pathlib ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "natsort";
|
2018-02-17 13:21:03 +00:00
|
|
|
version = "5.2.0";
|
2017-05-14 19:05:50 +01:00
|
|
|
|
2018-02-26 21:53:18 +00:00
|
|
|
buildInputs = [
|
2017-05-14 19:05:50 +01:00
|
|
|
hypothesis
|
|
|
|
pytestcache
|
2018-02-26 21:53:18 +00:00
|
|
|
pytestcov
|
2017-05-14 19:05:50 +01:00
|
|
|
pytestflakes
|
|
|
|
pytestpep8
|
|
|
|
pytest
|
|
|
|
glibcLocales
|
|
|
|
]
|
|
|
|
# pathlib was made part of standard library in 3.5:
|
|
|
|
++ (lib.optionals (pythonOlder "3.4") [ pathlib ])
|
|
|
|
# based on testing-requirements.txt:
|
|
|
|
++ (lib.optionals (pythonOlder "3.3") [ mock ]);
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-02-17 13:21:03 +00:00
|
|
|
sha256 = "c960082d2145b04723041c4b85092546560538e29664dd197a1344d5b090bc91";
|
2017-05-14 19:05:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# testing based on project's tox.ini
|
|
|
|
checkPhase = ''
|
|
|
|
pytest --doctest-modules natsort
|
2018-02-26 21:53:18 +00:00
|
|
|
pytest --flakes --pep8 --cov natsort --cov-report term-missing
|
2017-05-14 19:05:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Natural sorting for python";
|
|
|
|
homepage = https://github.com/SethMMorton/natsort;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|