1{ buildPythonPackage, fetchPypi, fetchpatch, pytestCheckHook, lib }:
2
3buildPythonPackage rec {
4 pname = "before-after";
5 version = "1.0.1";
6
7 src = fetchPypi {
8 pname = "before_after";
9 inherit version;
10 hash = "sha256-x9T5uLi7UgldoUxLnFnqaz9bnqn9zop7/HLsrg9aP4U=";
11 };
12
13 patches = [
14 # drop 'mock' dependency for python >=3.3
15 (fetchpatch {
16 url = "https://github.com/c-oreills/before_after/commit/cf3925148782c8c290692883d1215ae4d2c35c3c.diff";
17 hash = "sha256-FYCpLxcOLolNPiKzHlgrArCK/QKCwzag+G74wGhK4dc=";
18 })
19 (fetchpatch {
20 url = "https://github.com/c-oreills/before_after/commit/11c0ecc7e8a2f90a762831e216c1bc40abfda43a.diff";
21 hash = "sha256-8YJumF/U8H+hc7rLZLy3UhXHdYJmcuN+O8kMx8yqMJ0=";
22 })
23 ];
24
25 nativeCheckInputs = [ pytestCheckHook ];
26
27 pythonImportsCheck = [ "before_after" ];
28
29 meta = with lib; {
30 description = "sugar over the Mock library to help test race conditions";
31 homepage = "https://github.com/c-oreills/before_after";
32 maintainers = with maintainers; [ yuka ];
33 license = licenses.gpl2Only;
34 };
35}