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 '';
42
43 build-system = [ setuptools-scm ];
44
45 dependencies =
46 [
47 cachecontrol
48 mistune
49 mypy
50 mypy-extensions
51 rdflib
52 requests
53 ruamel-yaml
54 types-dataclasses
55 types-requests
56 types-setuptools
57 ]
58 ++ cachecontrol.optional-dependencies.filecache
59 ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ];
60
61 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pycodegen;
62
63 preCheck = ''
64 rm tox.ini
65 '';
66
67 disabledTests = [
68 "test_load_by_yaml_metaschema"
69 "test_detect_changes_in_html"
70 # Setup for these tests requires network access
71 "test_secondaryFiles"
72 "test_outputBinding"
73 # Test requires network
74 "test_yaml_tab_error"
75 "test_bad_schemas"
76 ];
77
78 pythonImportsCheck = [ "schema_salad" ];
79
80 optional-dependencies = {
81 pycodegen = [ black ];
82 };
83
84 meta = with lib; {
85 description = "Semantic Annotations for Linked Avro Data";
86 homepage = "https://github.com/common-workflow-language/schema_salad";
87 changelog = "https://github.com/common-workflow-language/schema_salad/releases/tag/${version}";
88 license = with licenses; [ asl20 ];
89 maintainers = with maintainers; [ veprbl ];
90 };
91}