1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 httpx,
5 lib,
6 pdm-pep517,
7 pytest-asyncio,
8 pytestCheckHook,
9 setuptools,
10 starlette,
11 fetchpatch,
12}:
13
14buildPythonPackage rec {
15 pname = "baize";
16 version = "0.22.2";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "abersheeran";
21 repo = "baize";
22 tag = "v${version}";
23 hash = "sha256-vsYt1q8QEDmEXjd8dlzHr85Fz3YAjPowS+oBWYGbG1o=";
24 };
25
26 patches = [
27 # Fix tests failing with httpx>=0.28
28 # https://github.com/abersheeran/baize/pull/74
29 # FIXME: Remove in next release
30 (fetchpatch {
31 url = "https://github.com/abersheeran/baize/commit/40dc83bc03b4e5acd5155917be3a481e6494530e.patch";
32 hash = "sha256-z4jb4iwo51WIPAAECiM4kPThpHcrzy3349gm/orgoq8=";
33 })
34 ];
35
36 build-system = [
37 pdm-pep517
38 setuptools
39 ];
40
41 pythonImportsCheck = [ "baize" ];
42
43 nativeCheckInputs = [
44 httpx
45 pytest-asyncio
46 pytestCheckHook
47 starlette
48 ];
49
50 disabledTests = [
51 # test relies on last modified date, which is set to 1970-01-01 in the sandbox
52 "test_files"
53 # starlette.testclient.WebSocketDenialResponse
54 "test_request_response"
55 ];
56
57 meta = {
58 description = "Powerful and exquisite WSGI/ASGI framework/toolkit";
59 homepage = "https://github.com/abersheeran/baize";
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [
62 dotlambda
63 bot-wxt1221
64 ];
65 };
66}