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