1{ 2 buildPythonPackage, 3 fetchFromGitHub, 4 legacy-cgi, 5 lib, 6 pyopenssl, 7 pytestCheckHook, 8 pythonAtLeast, 9 requests, 10}: 11 12buildPythonPackage rec { 13 pname = "servefile"; 14 version = "0.5.4"; 15 format = "setuptools"; 16 17 src = fetchFromGitHub { 18 owner = "sebageek"; 19 repo = pname; 20 tag = "v${version}"; 21 hash = "sha256-hIqXwhmvstCslsCO973oK5FF2c8gZJ0wNUI/z8W+OjU="; 22 }; 23 24 dependencies = [ 25 pyopenssl 26 ] ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; 27 28 nativeCheckInputs = [ 29 pytestCheckHook 30 requests 31 ]; 32 # Test attempts to connect to a port on localhost which fails in nix build 33 # environment. 34 disabledTests = [ 35 "test_abort_download" 36 "test_big_download" 37 "test_https_big_download" 38 "test_https" 39 "test_redirect_and_download" 40 "test_specify_port" 41 "test_upload_size_limit" 42 "test_upload" 43 ]; 44 pythonImportsCheck = [ "servefile" ]; 45 46 meta = with lib; { 47 description = "Serve files from shell via a small HTTP server"; 48 mainProgram = "servefile"; 49 homepage = "https://github.com/sebageek/servefile"; 50 license = licenses.gpl3Plus; 51 maintainers = with maintainers; [ samuela ]; 52 }; 53}