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