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