1{
2 lib,
3 black,
4 buildPythonPackage,
5 cachecontrol,
6 fetchFromGitHub,
7 fetchpatch,
8 importlib-resources,
9 mistune,
10 mypy,
11 mypy-extensions,
12 pytestCheckHook,
13 pythonOlder,
14 rdflib,
15 requests,
16 ruamel-yaml,
17 setuptools-scm,
18 types-dataclasses,
19 types-requests,
20 types-setuptools,
21}:
22
23buildPythonPackage rec {
24 pname = "schema-salad";
25 version = "8.8.20241206093842";
26 pyproject = true;
27
28 disabled = pythonOlder "3.9";
29
30 src = fetchFromGitHub {
31 owner = "common-workflow-language";
32 repo = "schema_salad";
33 rev = "refs/tags/${version}";
34 hash = "sha256-DUBrKBFphOa5hbEtsLVSI186TrhCkiNPtqlA61MENx0=";
35 };
36
37 postPatch = ''
38 substituteInPlace pyproject.toml \
39 --replace-fail "mypy[mypyc]==1.13.0" "mypy"
40 '';
41
42 build-system = [ setuptools-scm ];
43
44 dependencies =
45 [
46 cachecontrol
47 mistune
48 mypy
49 mypy-extensions
50 rdflib
51 requests
52 ruamel-yaml
53 types-dataclasses
54 types-requests
55 types-setuptools
56 ]
57 ++ cachecontrol.optional-dependencies.filecache
58 ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ];
59
60 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pycodegen;
61
62 preCheck = ''
63 rm tox.ini
64 '';
65
66 disabledTests = [
67 "test_load_by_yaml_metaschema"
68 # Setup for these tests requires network access
69 "test_secondaryFiles"
70 "test_outputBinding"
71 # Test requires network
72 "test_yaml_tab_error"
73 "test_bad_schemas"
74 ];
75
76 pythonImportsCheck = [ "schema_salad" ];
77
78 optional-dependencies = {
79 pycodegen = [ black ];
80 };
81
82 meta = with lib; {
83 description = "Semantic Annotations for Linked Avro Data";
84 homepage = "https://github.com/common-workflow-language/schema_salad";
85 changelog = "https://github.com/common-workflow-language/schema_salad/releases/tag/${version}";
86 license = with licenses; [ asl20 ];
87 maintainers = with maintainers; [ veprbl ];
88 };
89}