2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
pyopenssl,
|
|
|
|
pytestCheckHook,
|
|
|
|
requests,
|
2022-04-15 01:41:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "servefile";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.5.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sebageek";
|
|
|
|
repo = pname;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-hIqXwhmvstCslsCO973oK5FF2c8gZJ0wNUI/z8W+OjU=";
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ pyopenssl ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
requests
|
|
|
|
];
|
2022-04-15 01:41:22 +00:00
|
|
|
# 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; {
|
|
|
|
description = "Serve files from shell via a small HTTP server";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "servefile";
|
2022-04-15 01:41:22 +00:00
|
|
|
homepage = "https://github.com/sebageek/servefile";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ samuela ];
|
|
|
|
};
|
|
|
|
}
|