1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 fetchPypi,
6 pytestCheckHook,
7 python-dateutil,
8 pythonOlder,
9 pyyaml,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "related";
15 version = "0.7.3";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-IqmbqAW6PubN9GBXrMs5Je4u1XkgLl9camSGNrlrFJA=";
23 };
24
25 postPatch = ''
26 # Remove outdated setup.cfg
27 rm setup.cfg
28 substituteInPlace setup.py \
29 --replace-fail "'pytest-runner'," ""
30
31 # remove dependency on future
32 substituteInPlace \
33 src/related/dispatchers.py \
34 src/related/fields.py \
35 tests/ex03_company/test_company.py \
36 --replace-fail \
37 "from future.moves.urllib.parse import ParseResult" \
38 "from urllib.parse import ParseResult"
39
40 substituteInPlace \
41 src/related/converters.py \
42 --replace-fail \
43 "from future.moves.urllib.parse import urlparse" \
44 "from urllib.parse import urlparse"
45 '';
46
47 build-system = [ setuptools ];
48
49 pythonRemoveDeps = [ "future" ];
50
51 dependencies = [
52 attrs
53 python-dateutil
54 pyyaml
55 ];
56
57 nativeCheckInputs = [ pytestCheckHook ];
58
59 disabledTests = [
60 # Source tarball doesn't contains all needed files
61 "test_compose_from_yml"
62 "test_yaml_roundtrip_with_empty_values"
63 "test_compose_from_yml"
64 "test_store_data_from_json"
65 ];
66
67 pythonImportsCheck = [ "related" ];
68
69 meta = with lib; {
70 description = "Nested Object Models in Python";
71 homepage = "https://github.com/genomoncology/related";
72 license = licenses.mit;
73 maintainers = with maintainers; [ fab ];
74 };
75}