Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.1 kB · 100 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101{ 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.0"; pyproject = true;
src = fetchFromGitHub { owner = "emmett-framework"; repo = "granian"; tag = "v${version}"; hash = "sha256-Ce0e31pjQEHHNz0Q13jshPBqxZdgAomGT3dpYm+ruQE="; };
# 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-QdoGxNMhBltzzAQIQt+Y5M4WRBtbdwm907jHlh1IxeQ="; };
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; };}