about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/sanic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/sanic/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/sanic/default.nix66
1 files changed, 51 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/sanic/default.nix b/nixpkgs/pkgs/development/python-modules/sanic/default.nix
index eaa14240191b..b27b75e91b22 100644
--- a/nixpkgs/pkgs/development/python-modules/sanic/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/sanic/default.nix
@@ -1,30 +1,43 @@
 { lib
 , stdenv
-, aiofiles
-, beautifulsoup4
 , buildPythonPackage
-, doCheck ? !stdenv.isDarwin # on Darwin, tests fail but pkg still works
 , fetchFromGitHub
-, gunicorn
+, fetchpatch
+
+# build-system
+, setuptools
+, wheel
+
+# propagates
+, aiofiles
+, html5tagger
 , httptools
 , multidict
-, pytest-asyncio
-, pytestCheckHook
-, pythonOlder
-, pythonAtLeast
 , sanic-routing
-, sanic-testing
-, setuptools
+, tracerite
+, typing-extensions
 , ujson
-, uvicorn
 , uvloop
 , websockets
+
+# optionals
 , aioquic
+
+# tests
+, doCheck ? !stdenv.isDarwin # on Darwin, tests fail but pkg still works
+
+, beautifulsoup4
+, gunicorn
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+, sanic-testing
+, uvicorn
 }:
 
 buildPythonPackage rec {
   pname = "sanic";
-  version = "22.12.0";
+  version = "23.6.0";
   format = "pyproject";
 
   disabled = pythonOlder "3.7";
@@ -33,24 +46,45 @@ buildPythonPackage rec {
     owner = "sanic-org";
     repo = pname;
     rev = "refs/tags/v${version}";
-    hash = "sha256-Vj780rP5rJ+YsMWlb3BR9LTKT/nTt0C2H3J0X9sysj8=";
+    hash = "sha256-Ffw92mlYNV+ikb6299uw24EI1XPpl3Ju2st1Yt/YHKw=";
   };
 
+  patches = [
+    # https://github.com/sanic-org/sanic/pull/2801
+    (fetchpatch {
+      name = "fix-test-one-cpu.patch";
+      url = "https://github.com/sanic-org/sanic/commit/a1df2a6de1c9c88a85d166e7e2636d26f7925852.patch";
+      hash = "sha256-vljGuoP/Q9HrP+/AOoI1iUpbDQ4/1Pn7AURP1dncI00=";
+    })
+  ];
+
   nativeBuildInputs = [
     setuptools
+    wheel
   ];
 
   propagatedBuildInputs = [
     aiofiles
-    aioquic
     httptools
+    html5tagger
     multidict
     sanic-routing
+    tracerite
+    typing-extensions
     ujson
     uvloop
     websockets
   ];
 
+  passthru.optional-dependencies = {
+    ext = [
+      # TODO: sanic-ext
+    ];
+    http3 = [
+      aioquic
+    ];
+  };
+
   nativeCheckInputs = [
     beautifulsoup4
     gunicorn
@@ -58,7 +92,7 @@ buildPythonPackage rec {
     pytestCheckHook
     sanic-testing
     uvicorn
-  ];
+  ] ++ passthru.optional-dependencies.http3;
 
   inherit doCheck;
 
@@ -112,6 +146,8 @@ buildPythonPackage rec {
   disabledTestPaths = [
     # We are not interested in benchmarks
     "benchmark/"
+    # We are also not interested in typing
+    "typing/test_typing.py"
     # unable to create async loop
     "test_app.py"
     "test_asgi.py"