2017-05-14 20:05:50 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, hypothesis
|
|
|
|
, pytestcache
|
|
|
|
, pytestcov
|
|
|
|
, pytestflakes
|
|
|
|
, pytestpep8
|
|
|
|
, pytest
|
|
|
|
, glibcLocales
|
|
|
|
, mock ? null
|
|
|
|
, pathlib ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
pname = "natsort";
|
2017-08-24 19:34:20 +02:00
|
|
|
version = "5.1.0";
|
2017-05-14 20:05:50 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
hypothesis
|
|
|
|
pytestcache
|
|
|
|
pytestcov
|
|
|
|
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;
|
2017-08-24 19:34:20 +02:00
|
|
|
sha256 = "5db0fd17c9f8ef3d54962a6e46159ce4807c630f0931169cd15ce54f2ac395b9";
|
2017-05-14 20:05:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# do not run checks on nix_run_setup.py
|
|
|
|
patches = [ ./setup.patch ];
|
|
|
|
|
|
|
|
# testing based on project's tox.ini
|
|
|
|
checkPhase = ''
|
|
|
|
pytest --doctest-modules natsort
|
|
|
|
pytest --flakes --pep8 --cov natsort --cov-report term-missing
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Natural sorting for python";
|
|
|
|
homepage = https://github.com/SethMMorton/natsort;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|