1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, graphql-core
5, pytest-asyncio
6, pytestCheckHook
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "apischema";
12 version = "0.18.1";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "wyfo";
19 repo = "apischema";
20 rev = "refs/tags/v${version}";
21 hash = "sha256-omw6znk09r2SigPfaVrtA6dd8KeSfjaPgGfK12ty23g=";
22 };
23
24 passthru.optional-dependencies = {
25 graphql = [
26 graphql-core
27 ];
28 };
29
30 nativeCheckInputs = [
31 pytest-asyncio
32 pytestCheckHook
33 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
34
35 pythonImportsCheck = [
36 "apischema"
37 ];
38
39 meta = with lib; {
40 description = "JSON (de)serialization, GraphQL and JSON schema generation using typing";
41 homepage = "https://github.com/wyfo/apischema";
42 license = licenses.mit;
43 maintainers = with maintainers; [ fab ];
44 };
45}