nixpkgs/pkgs/development/python-modules/natsort/default.nix

49 lines
952 B
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, pytest
2018-12-03 09:35:08 +00:00
, pytestcov
, pytest-mock
, hypothesis
, glibcLocales
, pathlib ? null
2020-06-19 10:21:42 +01:00
, isPy3k
}:
buildPythonPackage rec {
pname = "natsort";
2020-06-06 07:47:19 +01:00
version = "7.0.1";
checkInputs = [
pytest
2018-12-03 09:35:08 +00:00
pytestcov
pytest-mock
hypothesis
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 ]);
src = fetchPypi {
inherit pname version;
2020-06-06 07:47:19 +01:00
sha256 = "a633464dc3a22b305df0f27abcb3e83515898aa1fd0ed2f9726c3571a27258cf";
};
2020-06-19 10:20:35 +01:00
# Does not support Python 2
disabled = !isPy3k;
# testing based on project's tox.ini
# natsort_keygen has pytest mock issues
checkPhase = ''
pytest --doctest-modules natsort
pytest --ignore=tests/test_natsort_keygen.py
'';
meta = {
description = "Natural sorting for python";
homepage = "https://github.com/SethMMorton/natsort";
license = lib.licenses.mit;
};
}