about summary refs log tree commit diff
path: root/pkgs/development/python-modules/picobox/default.nix
blob: de0bdb14725b20c3e50712f4e7c066030a5a80ac (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
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, flask
, isPy27
, pytestCheckHook
, pythonAtLeast
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "picobox";
  version = "2.2.0";

  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "ikalnytskyi";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-B2A8GMhBFU/mb/JiiqtP+HvpPj5FYwaYO3gQN2QI6z0=";
  };

  patches = [
    (fetchpatch {
      # already in master, but no new release yet.
      # https://github.com/ikalnytskyi/picobox/issues/55
      url = "https://github.com/ikalnytskyi/picobox/commit/1fcc4a0c26a7cd50ee3ef6694139177b5dfb2be0.patch";
      hash = "sha256-/NIEzTFlZ5wG7jHT/YdySYoxT/UhSk29Up9/VqjG/jg=";
      includes = [
        "tests/test_box.py"
        "tests/test_stack.py"
      ];
    })
  ];

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    setuptools-scm
  ];

  nativeCheckInputs = [
    flask
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "picobox"
  ];

  meta = with lib; {
    description = "Opinionated dependency injection framework";
    homepage = "https://github.com/ikalnytskyi/picobox";
    license = licenses.mit;
    maintainers = with maintainers; [ flokli ];
  };
}