nixpkgs/pkgs/development/python-modules/static3/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

57 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
# optionals
, genshi
# tests
, pytestCheckHook
, webtest
}:
buildPythonPackage rec {
pname = "static3";
version = "0.7.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "rmohr";
repo = "static3";
rev = "v${version}";
hash = "sha256-uFgv+57/UZs4KoOdkFxbvTEDQrJbb0iYJ5JoWWN4yFY=";
};
postPatch = ''
substituteInPlace setup.py \
--replace ", 'pytest-cov'" ""
'';
passthru.optional-dependencies = {
KidMagic = [
# TODO: kid
];
Genshimagic = [
genshi
];
};
pythonImportsCheck = [
"static"
];
nativeCheckInputs = [
pytestCheckHook
webtest
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
meta = with lib; {
changelog = "https://github.com/rmohr/static3/releases/tag/v${version}";
description = "A really simple WSGI way to serve static (or mixed) content";
mainProgram = "static";
homepage = "https://github.com/rmohr/static3";
license = licenses.lgpl21Only;
maintainers = with maintainers; [ hexa ];
};
}