1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 graphql-core,
6 pytest-asyncio,
7 pytest8_3CheckHook,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "apischema";
14 version = "0.18.3";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "wyfo";
21 repo = "apischema";
22 tag = "v${version}";
23 hash = "sha256-YFJbNxCwDrJb603Bf8PDrvhVt4T53PNWOYs716c0f1I=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace-fail "setuptools==75.1.0" "setuptools" \
29 --replace-fail "wheel~=0.44.0" "wheel"
30 '';
31
32 build-system = [ setuptools ];
33
34 optional-dependencies = {
35 graphql = [ graphql-core ];
36 };
37
38 nativeCheckInputs = [
39 pytest-asyncio
40 pytest8_3CheckHook
41 ]
42 ++ lib.flatten (builtins.attrValues optional-dependencies);
43
44 pythonImportsCheck = [ "apischema" ];
45
46 meta = with lib; {
47 description = "JSON (de)serialization, GraphQL and JSON schema generation using typing";
48 homepage = "https://github.com/wyfo/apischema";
49 changelog = "https://github.com/wyfo/apischema/releases/tag/v${version}";
50 license = licenses.mit;
51 maintainers = with maintainers; [ fab ];
52 };
53}