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