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