1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 graphql-core,
6 pytest-asyncio,
7 pytestCheckHook,
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 pytestCheckHook
41 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
42
43 pythonImportsCheck = [ "apischema" ];
44
45 meta = with lib; {
46 description = "JSON (de)serialization, GraphQL and JSON schema generation using typing";
47 homepage = "https://github.com/wyfo/apischema";
48 changelog = "https://github.com/wyfo/apischema/releases/tag/v${version}";
49 license = licenses.mit;
50 maintainers = with maintainers; [ fab ];
51 };
52}