summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/before-after/default.nix
blob: 5d6a58aad6d4a600bbb801cc07f11a9234d24aa4 (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
{
  buildPythonPackage,
  fetchPypi,
  fetchpatch,
  setuptools,
  pytestCheckHook,
  lib,
}:

buildPythonPackage (finalAttrs: {
  pname = "before-after";
  version = "1.0.1";
  pyproject = true;

  __structuredAttrs = true;

  src = fetchPypi {
    pname = "before_after";
    inherit (finalAttrs) version;
    hash = "sha256-x9T5uLi7UgldoUxLnFnqaz9bnqn9zop7/HLsrg9aP4U=";
  };

  patches = [
    # drop 'mock' dependency for python >=3.3
    (fetchpatch {
      url = "https://github.com/c-oreills/before_after/commit/cf3925148782c8c290692883d1215ae4d2c35c3c.diff";
      hash = "sha256-FYCpLxcOLolNPiKzHlgrArCK/QKCwzag+G74wGhK4dc=";
    })
    (fetchpatch {
      url = "https://github.com/c-oreills/before_after/commit/11c0ecc7e8a2f90a762831e216c1bc40abfda43a.diff";
      hash = "sha256-8YJumF/U8H+hc7rLZLy3UhXHdYJmcuN+O8kMx8yqMJ0=";
    })
  ];

  build-system = [ setuptools ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "before_after" ];

  meta = {
    description = "Sugar over the Mock library to help test race conditions";
    homepage = "https://github.com/c-oreills/before_after";
    maintainers = [ ];
    license = lib.licenses.gpl2Only;
  };
})