push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
{
lib,
fetchFromGitHub,
rustPlatform,
cacert,
buildPythonPackage,
uvloop,
click,
setproctitle,
watchfiles,
versionCheckHook,
pytestCheckHook,
pytest-asyncio,
websockets,
httpx,
sniffio,
nix-update-script,
}:
buildPythonPackage rec {
pname = "granian";
version = "2.5.4";
pyproject = true;
src = fetchFromGitHub {
owner = "emmett-framework";
repo = "granian";
tag = "v${version}";
hash = "sha256-6T4ge9QrLxpkgtJvNmgUlHaxFK3KyQLJo12rjs80J3M=";
};
# Granian forces a custom allocator for all the things it runs,
# which breaks some libraries in funny ways. Make it not do that,
# and allow the final application to make the allocator decision
# via LD_PRELOAD or similar.
patches = [
./no-alloc.patch
];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-iY0vh+Y0wU1/wJVXb2GDG8vb5ovrFD+4tXKODEA35Kc=";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
dependencies = [
click
];
optional-dependencies = {
pname = [ setproctitle ];
reload = [ watchfiles ];
# rloop = [ rloop ]; # not packaged
uvloop = [ uvloop ];
};
nativeCheckInputs = [
versionCheckHook
pytestCheckHook
pytest-asyncio
websockets
httpx
sniffio
];
preCheck = ''
# collides with the one installed in $out
rm -rf granian/
'';
# needed for checks
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
__darwinAllowLocalNetworking = true;
enabledTestPaths = [ "tests/" ];
pythonImportsCheck = [ "granian" ];
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Rust HTTP server for Python ASGI/WSGI/RSGI applications";
homepage = "https://github.com/emmett-framework/granian";
changelog = "https://github.com/emmett-framework/granian/releases/tag/v${version}";
license = lib.licenses.bsd3;
mainProgram = "granian";
maintainers = with lib.maintainers; [
lucastso10
pbsds
];
platforms = lib.platforms.unix;
};
}