2017-05-14 20:05:50 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, pytestcache
|
|
|
|
, pytest
|
|
|
|
, glibcLocales
|
|
|
|
, mock ? null
|
|
|
|
, pathlib ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "natsort";
|
2018-07-22 12:13:56 +02:00
|
|
|
version = "5.3.3";
|
2017-05-14 20:05:50 +02:00
|
|
|
|
2018-02-20 21:34:44 +01:00
|
|
|
checkInputs = [
|
2017-05-14 20:05:50 +02:00
|
|
|
hypothesis
|
|
|
|
pytestcache
|
|
|
|
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-07-22 12:13:56 +02:00
|
|
|
sha256 = "da930bfddce941526955dea8d35a44243c96adf919ceb758ba7bbd1ba5b0a39a";
|
2017-05-14 20:05:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# testing based on project's tox.ini
|
|
|
|
checkPhase = ''
|
|
|
|
pytest --doctest-modules natsort
|
2018-08-30 22:29:31 +02:00
|
|
|
pytest
|
2017-05-14 20:05:50 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Natural sorting for python";
|
|
|
|
homepage = https://github.com/SethMMorton/natsort;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|