1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 freezegun,
6 graphql-core,
7 hatchling,
8 httpx,
9 pytest-asyncio,
10 pytest-mock,
11 pytestCheckHook,
12 pythonOlder,
13 python-multipart,
14 starlette,
15 syrupy,
16 typing-extensions,
17 werkzeug,
18}:
19
20buildPythonPackage rec {
21 pname = "ariadne";
22 version = "0.23.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "mirumee";
29 repo = "ariadne";
30 rev = "refs/tags/${version}";
31 hash = "sha256-zdM6LKtrD6m3hWn90yAgsinCvaa86BaTdhgf/VzGDLA=";
32 };
33
34 patches = [ ./remove-opentracing.patch ];
35
36 nativeBuildInputs = [ hatchling ];
37
38 propagatedBuildInputs = [
39 graphql-core
40 starlette
41 typing-extensions
42 ];
43
44 nativeCheckInputs = [
45 freezegun
46 httpx
47 pytest-asyncio
48 pytest-mock
49 pytestCheckHook
50 python-multipart
51 syrupy
52 werkzeug
53 ];
54
55 pythonImportsCheck = [ "ariadne" ];
56
57 pytestFlagsArray = [ "--snapshot-update" ];
58
59 disabledTests = [
60 # TypeError: TestClient.request() got an unexpected keyword argument 'content'
61 "test_attempt_parse_request_missing_content_type_raises_bad_request_error"
62 "test_attempt_parse_non_json_request_raises_bad_request_error"
63 "test_attempt_parse_non_json_request_body_raises_bad_request_error"
64 # opentracing
65 "test_query_is_executed_for_multipart_form_request_with_file"
66 "test_query_is_executed_for_multipart_request_with_large_file_with_tracing"
67 ];
68
69 disabledTestPaths = [
70 # missing graphql-sync-dataloader test dep
71 "tests/test_dataloaders.py"
72 "tests/wsgi/test_configuration.py"
73 # both include opentracing module, which has been removed from nixpkgs
74 "tests/tracing/test_opentracing.py"
75 "tests/tracing/test_opentelemetry.py"
76 ];
77
78 meta = with lib; {
79 description = "Python library for implementing GraphQL servers using schema-first approach";
80 homepage = "https://ariadnegraphql.org";
81 changelog = "https://github.com/mirumee/ariadne/blob/${version}/CHANGELOG.md";
82 license = licenses.bsd3;
83 maintainers = with maintainers; [ samuela ];
84 };
85}