summary refs log tree commit diff
path: root/pkgs/development/python-modules/servefile/default.nix
blob: 8fdd294b506ffcd9b04a87a1c796b90cf0708027 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, lib
, pyopenssl
, pytestCheckHook
, requests
}:

buildPythonPackage rec {
  pname = "servefile";
  version = "0.5.3";

  src = fetchFromGitHub {
    owner = "sebageek";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-/ZEMZIH/ImuZ2gh5bwB0FlaWnG/ELxfBGEJ2SuNSEb8=";
  };

  propagatedBuildInputs = [ pyopenssl ];

  checkInputs = [ pytestCheckHook requests ];
  # Test attempts to connect to a port on localhost which fails in nix build
  # environment.
  disabledTests = [
    "test_abort_download"
    "test_big_download"
    "test_https_big_download"
    "test_https"
    "test_redirect_and_download"
    "test_specify_port"
    "test_upload_size_limit"
    "test_upload"
  ];
  pythonImportsCheck = [ "servefile" ];

  meta = with lib; {
    broken = stdenv.isDarwin;
    description = "Serve files from shell via a small HTTP server";
    homepage = "https://github.com/sebageek/servefile";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ samuela ];
  };
}