Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchFromGitHub, 4 buildPythonPackage, 5 pythonOlder, 6 7 # build-system 8 poetry-core, 9 10 # dependencies 11 asgiref, 12 httpx, 13 inflection, 14 jsonschema, 15 jinja2, 16 python-multipart, 17 pyyaml, 18 requests, 19 starlette, 20 typing-extensions, 21 werkzeug, 22 23 # optional-dependencies 24 a2wsgi, 25 flask, 26 swagger-ui-bundle, 27 uvicorn, 28 29 # tests 30 pytest-aiohttp, 31 pytestCheckHook, 32 testfixtures, 33}: 34 35buildPythonPackage rec { 36 pname = "connexion"; 37 version = "3.1.0"; 38 pyproject = true; 39 40 disabled = pythonOlder "3.6"; 41 42 src = fetchFromGitHub { 43 owner = "spec-first"; 44 repo = pname; 45 rev = "refs/tags/${version}"; 46 hash = "sha256-rngQDU9kXw/Z+Al0SCVnWN8xnphueTtZ0+xPBR5MbEM="; 47 }; 48 49 nativeBuildInputs = [ poetry-core ]; 50 51 propagatedBuildInputs = [ 52 asgiref 53 httpx 54 inflection 55 jsonschema 56 jinja2 57 python-multipart 58 pyyaml 59 requests 60 starlette 61 typing-extensions 62 werkzeug 63 ]; 64 65 passthru.optional-dependencies = { 66 flask = [ 67 a2wsgi 68 flask 69 ]; 70 swagger-ui = [ swagger-ui-bundle ]; 71 uvicorn = [ uvicorn ]; 72 }; 73 74 nativeCheckInputs = [ 75 pytest-aiohttp 76 pytestCheckHook 77 testfixtures 78 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 79 80 pythonImportsCheck = [ "connexion" ]; 81 82 disabledTests = [ 83 # AssertionError 84 "test_headers" 85 # waiter.acquire() deadlock 86 "test_cors_server_error" 87 "test_get_bad_default_response" 88 "test_schema_response" 89 "test_writeonly" 90 ]; 91 92 meta = with lib; { 93 description = "Swagger/OpenAPI First framework on top of Flask"; 94 mainProgram = "connexion"; 95 homepage = "https://github.com/spec-first/connexion"; 96 changelog = "https://github.com/spec-first/connexion/releases/tag/${version}"; 97 license = licenses.asl20; 98 }; 99}