diff --git a/pkgs/development/python-modules/granian/default.nix b/pkgs/development/python-modules/granian/default.nix index cb3493129df8..90dc1af4e827 100644 --- a/pkgs/development/python-modules/granian/default.nix +++ b/pkgs/development/python-modules/granian/default.nix @@ -11,6 +11,7 @@ versionCheckHook, pytestCheckHook, pytest-asyncio, + python-dotenv, websockets, httpx, sniffio, @@ -19,14 +20,14 @@ buildPythonPackage rec { pname = "granian"; - version = "2.7.2"; + version = "2.7.4"; pyproject = true; src = fetchFromGitHub { owner = "emmett-framework"; repo = "granian"; tag = "v${version}"; - hash = "sha256-6CtmoY3BHO2t+ZjMzZPKUufOkaal0K+MTYhC1eiVXWQ="; + hash = "sha256-KId5e1ITRCkLNmvY5q/ZT18INzS8Uh9HFCzfKEablOY="; }; # Granian forces a custom allocator for all the things it runs, @@ -34,12 +35,12 @@ buildPythonPackage rec { # and allow the final application to make the allocator decision # via LD_PRELOAD or similar. patches = [ - ./no-alloc.patch + ./no-alloc.patch # with --unified=1 context ]; cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; - hash = "sha256-7KeidUDMH79b8qgAR5bvY8tAmW5OHmVtLIdb9LlP9w0="; + hash = "sha256-rR65e05uWmag+21n1YA1TILYU6ArajW2+QVOfGn4zGo="; }; nativeBuildInputs = with rustPlatform; [ @@ -52,6 +53,7 @@ buildPythonPackage rec { ]; optional-dependencies = { + dotenv = [ python-dotenv ]; pname = [ setproctitle ]; reload = [ watchfiles ]; # rloop = [ rloop ]; # not packaged diff --git a/pkgs/development/python-modules/granian/no-alloc.patch b/pkgs/development/python-modules/granian/no-alloc.patch index 28fff30c74f0..d6b01f9475b1 100644 --- a/pkgs/development/python-modules/granian/no-alloc.patch +++ b/pkgs/development/python-modules/granian/no-alloc.patch @@ -1,39 +1,27 @@ diff --git a/Cargo.toml b/Cargo.toml -index c7d1647..d5710bd 100644 +index e1b6a3d..8fe77cf 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -41,7 +41,6 @@ hyper = { version = "=1.8", features = ["http1", "http2", "server"] } - hyper-util = { version = "=0.1", features = ["server-auto", "tokio"] } - itertools = "0.14" +@@ -46,3 +46,2 @@ itertools = "0.14" log = "0.4" --mimalloc = { version = "0.1.43", default-features = false, features = ["local_dynamic_tls", "v3"], optional = true } +-mimalloc = { version = "0.1.49", default-features = false, features = ["local_dynamic_tls"], optional = true } mime_guess = "=2.0" - pem = "=3.0" - percent-encoding = "=2.3" -@@ -52,7 +51,6 @@ pyo3-log = { version = "=0.13", git = "https://github.com/gi0baro/pyo3-log.git", - rustls-pemfile = "2.2" - socket2 = { version = "=0.6", features = ["all"] } - sysinfo = "=0.37" +@@ -58,3 +57,2 @@ socket2 = { version = "=0.6", features = ["all"] } + sysinfo = "=0.38" -tikv-jemallocator = { version = "0.6.0", default-features = false, features = ["disable_initial_exec_tls"], optional = true } tls-listener = { version = "=0.11", git = "https://github.com/gi0baro/tls-listener.git", branch = "0.11.x", features = ["rustls-ring", "rustls-tls12"] } - tokio = { version = "1.45", features = ["full"] } - tokio-stream = "0.1" -@@ -62,10 +60,6 @@ tokio-util = { version = "0.7", features = ["codec", "rt"] } - [build-dependencies] - pyo3-build-config = "=0.27" +@@ -68,6 +66,2 @@ pyo3-build-config = "=0.27" -[features] -jemalloc = ["dep:tikv-jemallocator"] -mimalloc = ["dep:mimalloc"] - [profile.release] - codegen-units = 1 - debug = false diff --git a/src/lib.rs b/src/lib.rs -index a17a7e5..8ea1a4d 100644 +index f3a8218..805b725 100644 --- a/src/lib.rs +++ b/src/lib.rs -@@ -1,11 +1,3 @@ +@@ -1,9 +1 @@ -#[cfg(all(feature = "jemalloc", not(feature = "mimalloc")))] -#[global_allocator] -static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; @@ -43,5 +31,3 @@ index a17a7e5..8ea1a4d 100644 -static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; - use pyo3::prelude::*; - use std::sync::OnceLock; -