summary refs log tree commit diff
path: root/pkgs/development/python-modules/remarshal/default.nix
blob: fc888c2379ee3d3a7e7c35724b49e38a616d2f77 (plain) (blame)
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
{ lib
, buildPythonApplication
, fetchFromGitHub

# build deps
, poetry-core

# propagates
, cbor2
, python-dateutil
, pyyaml
, tomlkit
, u-msgpack-python

# tested using
, pytestCheckHook
}:

buildPythonApplication rec {
  pname = "remarshal";
  version = "0.14.0";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "dbohdan";
    repo = pname;
    rev = "v${version}";
    hash = "sha256:nTM3jrPf0kGE15J+ZXBIt2+NGSW2a6VlZCKj70n5kHM=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "poetry.masonry.api" "poetry.core.masonry.api" \
      --replace 'PyYAML = "^5.3"' 'PyYAML = "*"'
  '';

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    cbor2
    python-dateutil
    pyyaml
    tomlkit
    u-msgpack-python
  ];

  checkInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Convert between TOML, YAML and JSON";
    license = licenses.mit;
    homepage = "https://github.com/dbohdan/remarshal";
    maintainers = with maintainers; [ offline ];
  };
}