1{
2 lib,
3 buildPythonPackage,
4 callPackage,
5 fetchFromGitHub,
6 httpx,
7 pythonOlder,
8 sanic,
9 setuptools,
10 websockets,
11}:
12
13buildPythonPackage rec {
14 pname = "sanic-testing";
15 version = "24.6.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "sanic-org";
22 repo = "sanic-testing";
23 tag = "v${version}";
24 hash = "sha256-biUgxa0sINHAYzyKimVD8+/mPUq2dlnCl2BN+UeUaEo=";
25 };
26
27 outputs = [
28 "out"
29 "testsout"
30 ];
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 httpx
36 sanic
37 websockets
38 ];
39
40 postInstall = ''
41 mkdir $testsout
42 cp -R tests $testsout/tests
43 '';
44
45 # Check in passthru.tests.pytest to escape infinite recursion with sanic
46 doCheck = false;
47
48 doInstallCheck = false;
49
50 passthru.tests = {
51 pytest = callPackage ./tests.nix { };
52 };
53
54 meta = with lib; {
55 description = "Core testing clients for the Sanic web framework";
56 homepage = "https://github.com/sanic-org/sanic-testing";
57 changelog = "https://github.com/sanic-org/sanic-testing/releases/tag/v${version}";
58 license = licenses.mit;
59 maintainers = [ ];
60 };
61}