1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, flask
6, isPy27
7, pytestCheckHook
8, pythonAtLeast
9, setuptools-scm
10}:
11
12buildPythonPackage rec {
13 pname = "picobox";
14 version = "2.2.0";
15
16 disabled = isPy27;
17
18 src = fetchFromGitHub {
19 owner = "ikalnytskyi";
20 repo = pname;
21 rev = "refs/tags/${version}";
22 hash = "sha256-B2A8GMhBFU/mb/JiiqtP+HvpPj5FYwaYO3gQN2QI6z0=";
23 };
24
25 patches = [
26 (fetchpatch {
27 # already in master, but no new release yet.
28 # https://github.com/ikalnytskyi/picobox/issues/55
29 url = "https://github.com/ikalnytskyi/picobox/commit/1fcc4a0c26a7cd50ee3ef6694139177b5dfb2be0.patch";
30 hash = "sha256-/NIEzTFlZ5wG7jHT/YdySYoxT/UhSk29Up9/VqjG/jg=";
31 includes = [
32 "tests/test_box.py"
33 "tests/test_stack.py"
34 ];
35 })
36 ];
37
38 SETUPTOOLS_SCM_PRETEND_VERSION = version;
39
40 nativeBuildInputs = [
41 setuptools-scm
42 ];
43
44 checkInputs = [
45 flask
46 pytestCheckHook
47 ];
48
49 pythonImportsCheck = [
50 "picobox"
51 ];
52
53 meta = with lib; {
54 description = "Opinionated dependency injection framework";
55 homepage = "https://github.com/ikalnytskyi/picobox";
56 license = licenses.mit;
57 maintainers = with maintainers; [ flokli ];
58 };
59}