python3Packages.uvicorn: 0.11.5 -> 0.13.2

This commit is contained in:
Martin Weinelt 2021-01-06 19:23:56 +01:00
parent fd29814024
commit dbf3e8b2e2
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,4 +1,5 @@
{ stdenv { stdenv
, lib
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, click , click
@ -7,21 +8,26 @@
, uvloop , uvloop
, websockets , websockets
, wsproto , wsproto
, pytest , pytestCheckHook
, pytest-mock
, pyyaml
, requests , requests
, trustme
, typing-extensions
, isPy27 , isPy27
, pythonOlder
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "uvicorn"; pname = "uvicorn";
version = "0.11.5"; version = "0.13.2";
disabled = isPy27; disabled = isPy27;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "encode"; owner = "encode";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq"; sha256 = "04zgmp9z46k72ay6cz7plga6d3w3a6x41anabm7ramp7jdqf6na9";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -31,25 +37,31 @@ buildPythonPackage rec {
uvloop uvloop
websockets websockets
wsproto wsproto
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
]; ];
postPatch = '' checkInputs = [
substituteInPlace setup.py \ pytestCheckHook
--replace "h11==0.8.*" "h11" \ pytest-mock
--replace "httptools==0.0.13" "httptools" pyyaml
''; requests
trustme
checkInputs = [ pytest requests ]; ];
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;
# watchgod required the watchgod package, which isn't available in nixpkgs pytestFlagsArray = [
checkPhase = '' # watchgod required the watchgod package, which isn't available in nixpkgs
pytest --ignore=tests/supervisors/test_watchgodreload.py \ "--ignore=tests/supervisors/test_reload.py"
-k 'not test_supported_upgrade_request and not test_invalid_upgrade[WSProtocol]' ];
'';
meta = with stdenv.lib; { disabledTests = [
"test_supported_upgrade_request"
"test_invalid_upgrade"
];
meta = with lib; {
homepage = "https://www.uvicorn.org/"; homepage = "https://www.uvicorn.org/";
description = "The lightning-fast ASGI server"; description = "The lightning-fast ASGI server";
license = licenses.bsd3; license = licenses.bsd3;