granian: move to python3Packages

This commit is contained in:
Peder Bergebakken Sundt 2025-03-24 22:56:41 +01:00
parent e82086eaa1
commit d6a369fe3b
3 changed files with 57 additions and 49 deletions

View file

@ -1,52 +1,4 @@
{
lib,
fetchFromGitHub,
rustPlatform,
python3Packages,
libiconv,
nix-update-script,
}:
python3Packages.buildPythonApplication rec {
pname = "granian";
version = "2.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "emmett-framework";
repo = "granian";
rev = "v${version}";
hash = "sha256-YQ9+PcKXtSc+wdvhgDfSAfcv/y53oqcrPCEI9dDKFa0=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
name = "${pname}-${version}";
hash = "sha256-XJ61+u5aGQis6YkfASD+WJHEKDBL+2ImqCAuQmm3A/g=";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
buildInputs = [
libiconv
];
dependencies = [
python3Packages.uvloop
python3Packages.click
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Rust HTTP server for Python ASGI/WSGI/RSGI applications";
homepage = "https://github.com/emmett-framework/granian";
license = lib.licenses.bsd3;
mainProgram = "granian";
maintainers = with lib.maintainers; [ lucastso10 ];
platforms = lib.platforms.unix;
};
}
python3Packages.toPythonApplication python3Packages.granian

View file

@ -0,0 +1,54 @@
{
lib,
fetchFromGitHub,
rustPlatform,
buildPythonPackage,
uvloop,
click,
libiconv,
nix-update-script,
}:
buildPythonPackage rec {
pname = "granian";
version = "2.2.0";
pyproject = true;
src = fetchFromGitHub {
owner = "emmett-framework";
repo = "granian";
rev = "v${version}";
hash = "sha256-YQ9+PcKXtSc+wdvhgDfSAfcv/y53oqcrPCEI9dDKFa0=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
name = "${pname}-${version}";
hash = "sha256-XJ61+u5aGQis6YkfASD+WJHEKDBL+2ImqCAuQmm3A/g=";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
buildInputs = [
libiconv
];
dependencies = [
uvloop
click
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Rust HTTP server for Python ASGI/WSGI/RSGI applications";
homepage = "https://github.com/emmett-framework/granian";
license = lib.licenses.bsd3;
mainProgram = "granian";
maintainers = with lib.maintainers; [ lucastso10 ];
platforms = lib.platforms.unix;
};
}

View file

@ -5860,6 +5860,8 @@ self: super: with self; {
grandalf = callPackage ../development/python-modules/grandalf { };
granian = callPackage ../development/python-modules/granian { };
graph-tool = callPackage ../development/python-modules/graph-tool { inherit (pkgs) cgal; };
grapheme = callPackage ../development/python-modules/grapheme { };