depot/third_party/nixpkgs/pkgs/development/python-modules/sanic-testing/default.nix
Default email 841d9c7fc1 Project import generated by Copybara.
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
2021-06-29 00:13:55 +01:00

53 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, httpx
, pytest-asyncio
, sanic
, websockets
}:
buildPythonPackage rec {
pname = "sanic-testing";
version = "0.6.0";
src = fetchFromGitHub {
owner = "sanic-org";
repo = "sanic-testing";
rev = "v${version}";
sha256 = "1pf619cd3dckn3d8gh18vbn7dflvb0mzpf6frx4y950x2j3rdplk";
};
propagatedBuildInputs = [
httpx
sanic
websockets
];
checkInputs = [
pytest-asyncio
pytestCheckHook
];
postPatch = ''
# https://github.com/sanic-org/sanic-testing/issues/19
substituteInPlace setup.py \
--replace '"websockets==8.1",' '"websockets>=9.1",'
'';
# `sanic` is explicitly set to null when building `sanic` itself
# to prevent infinite recursion. In that case we skip running
# the package at all.
doCheck = sanic != null;
dontUsePythonImportsCheck = sanic == null;
pythonImportsCheck = [ "sanic_testing" ];
meta = with lib; {
description = "Core testing clients for the Sanic web framework";
homepage = "https://github.com/sanic-org/sanic-testing";
license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ];
};
}