summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/related/default.nix
blob: c8179ac3d9e39948d4bef37324bade1f35378149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  attrs,
  buildPythonPackage,
  fetchPypi,
  pytestCheckHook,
  python-dateutil,
  pyyaml,
  setuptools,
}:

buildPythonPackage rec {
  pname = "related";
  version = "0.7.3";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-IqmbqAW6PubN9GBXrMs5Je4u1XkgLl9camSGNrlrFJA=";
  };

  postPatch = ''
    # Remove outdated setup.cfg
    rm setup.cfg
    substituteInPlace setup.py \
      --replace-fail "'pytest-runner'," ""

    # remove dependency on future
    substituteInPlace \
      src/related/dispatchers.py \
      src/related/fields.py \
      tests/ex03_company/test_company.py \
      --replace-fail \
        "from future.moves.urllib.parse import ParseResult" \
        "from urllib.parse import ParseResult"

    substituteInPlace \
      src/related/converters.py \
      --replace-fail \
        "from future.moves.urllib.parse import urlparse" \
        "from urllib.parse import urlparse"
  '';

  build-system = [ setuptools ];

  pythonRemoveDeps = [ "future" ];

  dependencies = [
    attrs
    python-dateutil
    pyyaml
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    # Source tarball doesn't contains all needed files
    "test_compose_from_yml"
    "test_yaml_roundtrip_with_empty_values"
    "test_compose_from_yml"
    "test_store_data_from_json"
  ];

  pythonImportsCheck = [ "related" ];

  meta = {
    description = "Nested Object Models in Python";
    homepage = "https://github.com/genomoncology/related";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}