about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/uvicorn/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/uvicorn/default.nix46
1 files changed, 30 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix b/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix
index 55511be4926c..36e8b12929e0 100644
--- a/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , buildPythonPackage
 , fetchFromGitHub
 , click
@@ -7,21 +8,26 @@
 , uvloop
 , websockets
 , wsproto
-, pytest
+, pytestCheckHook
+, pytest-mock
+, pyyaml
 , requests
+, trustme
+, typing-extensions
 , isPy27
+, pythonOlder
 }:
 
 buildPythonPackage rec {
   pname = "uvicorn";
-  version = "0.11.5";
+  version = "0.13.2";
   disabled = isPy27;
 
   src = fetchFromGitHub {
     owner = "encode";
     repo = pname;
     rev = version;
-    sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
+    sha256 = "04zgmp9z46k72ay6cz7plga6d3w3a6x41anabm7ramp7jdqf6na9";
   };
 
   propagatedBuildInputs = [
@@ -31,25 +37,33 @@ buildPythonPackage rec {
     uvloop
     websockets
     wsproto
+  ] ++ lib.optionals (pythonOlder "3.8") [
+    typing-extensions
   ];
 
-  postPatch = ''
-    substituteInPlace setup.py \
-      --replace "h11==0.8.*" "h11" \
-      --replace "httptools==0.0.13" "httptools"
-  '';
-
-  checkInputs = [ pytest requests ];
+  checkInputs = [
+    pytestCheckHook
+    pytest-mock
+    pyyaml
+    requests
+    trustme
+  ];
 
   doCheck = !stdenv.isDarwin;
 
-  # watchgod required the watchgod package, which isn't available in nixpkgs
-  checkPhase = ''
-    pytest --ignore=tests/supervisors/test_watchgodreload.py \
-      -k 'not test_supported_upgrade_request and not test_invalid_upgrade[WSProtocol]'
-  '';
+  __darwinAllowLocalNetworking = true;
+
+  pytestFlagsArray = [
+    # watchgod required the watchgod package, which isn't available in nixpkgs
+    "--ignore=tests/supervisors/test_reload.py"
+  ];
+
+  disabledTests = [
+    "test_supported_upgrade_request"
+    "test_invalid_upgrade"
+  ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.uvicorn.org/";
     description = "The lightning-fast ASGI server";
     license = licenses.bsd3;