summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/draccus/default.nix
blob: 02f3a89fa5a32ba415bc69e0dc27790a5606dec0 (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
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchpatch2,

  # build-system
  setuptools,

  # dependencies
  mergedeep,
  pyyaml,
  toml,
  typing-inspect,

  # tests
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "draccus";
  version = "0.11.5";
  pyproject = true;

  # No (recent) tags on GitHub
  src = fetchPypi {
    inherit pname version;
    hash = "sha256-uC4sICcDCuGg8QVRUSX5FOBQwHZqtRjfOgVgoH0Q3ck=";
  };

  patches = [
    (fetchpatch2 {
      # TODO: remove when updating to the next release
      # Removes the pyyaml-include~=1.4 dependency
      # https://github.com/dlwh/draccus/issues/46#issuecomment-3180810991
      name = "remove-pyyaml-include-dep.patch";
      url = "https://github.com/dlwh/draccus/commit/3a6db0bc786e46cc13c481bc2235101d7a411441.patch";
      hash = "sha256-0OLUjXJSZ9eIL8dgE8o1Mg0HIMX+4XABSf0tYNFWn8I=";
    })
  ];

  build-system = [
    setuptools
  ];

  dependencies = [
    mergedeep
    pyyaml
    toml
    typing-inspect
  ];

  pythonImportsCheck = [ "draccus" ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  meta = {
    description = "Framework for simple dataclass-based configurations based on Pyrallis";
    homepage = "https://github.com/dlwh/draccus";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}