1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchPypi 5, hypothesis 6, pytestcache 7, pytest 8, glibcLocales 9, mock ? null 10, pathlib ? null 11}: 12 13buildPythonPackage rec { 14 pname = "natsort"; 15 version = "5.3.3"; 16 17 checkInputs = [ 18 hypothesis 19 pytestcache 20 pytest 21 glibcLocales 22 ] 23 # pathlib was made part of standard library in 3.5: 24 ++ (lib.optionals (pythonOlder "3.4") [ pathlib ]) 25 # based on testing-requirements.txt: 26 ++ (lib.optionals (pythonOlder "3.3") [ mock ]); 27 28 src = fetchPypi { 29 inherit pname version; 30 sha256 = "da930bfddce941526955dea8d35a44243c96adf919ceb758ba7bbd1ba5b0a39a"; 31 }; 32 33 # testing based on project's tox.ini 34 checkPhase = '' 35 pytest --doctest-modules natsort 36 pytest 37 ''; 38 39 meta = { 40 description = "Natural sorting for python"; 41 homepage = https://github.com/SethMMorton/natsort; 42 license = lib.licenses.mit; 43 }; 44}