about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/natsort/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/natsort/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/natsort/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/natsort/default.nix b/nixpkgs/pkgs/development/python-modules/natsort/default.nix
new file mode 100644
index 000000000000..da8e953826ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/natsort/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildPythonPackage
+, pythonOlder
+, fetchPypi
+, pytest
+, pytestcov
+, pytest-mock
+, hypothesis
+, glibcLocales
+, pathlib ? null
+}:
+
+buildPythonPackage rec {
+  pname = "natsort";
+  version = "6.0.0";
+
+  checkInputs = [
+    pytest
+    pytestcov
+    pytest-mock
+    hypothesis
+    glibcLocales
+  ]
+  # pathlib was made part of standard library in 3.5:
+  ++ (lib.optionals (pythonOlder "3.4") [ pathlib ]);
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "ff3effb5618232866de8d26e5af4081a4daa9bb0dfed49ac65170e28e45f2776";
+  };
+
+  # testing based on project's tox.ini
+  checkPhase = ''
+    pytest --doctest-modules natsort
+    pytest
+  '';
+
+  meta = {
+    description = "Natural sorting for python";
+    homepage = https://github.com/SethMMorton/natsort;
+    license = lib.licenses.mit;
+  };
+}