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