nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 legacy-cgi,
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 = "servefile";
19 tag = "v${version}";
20 hash = "sha256-hIqXwhmvstCslsCO973oK5FF2c8gZJ0wNUI/z8W+OjU=";
21 };
22
23 dependencies = [
24 legacy-cgi
25 pyopenssl
26 ];
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 = {
47 description = "Serve files from shell via a small HTTP server";
48 mainProgram = "servefile";
49 homepage = "https://github.com/sebageek/servefile";
50 license = lib.licenses.gpl3Plus;
51 maintainers = with lib.maintainers; [ samuela ];
52 };
53}