about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-freezegun/default.nix
blob: 95ccd9b77cd4e1d86856a59411ee714efab34eb9 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, freezegun
, pytest
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "pytest-freezegun";
  version = "0.4.2";

  src = fetchFromGitHub {
    owner = "ktosiek";
    repo = "pytest-freezegun";
    rev = version;
    sha256 = "10c4pbh03b4s1q8cjd75lr0fvyf9id0zmdk29566qqsmaz28npas";
  };

  patches = [
    (fetchpatch {
      # https://github.com/ktosiek/pytest-freezegun/pull/38
      name = "pytest-freezegun-drop-distutils.patch";
      url = "https://github.com/ktosiek/pytest-freezegun/commit/03d7107a877e8f07617f931a379f567d89060085.patch";
      hash = "sha256-/7GTQdidVbE2LT5hwxjEc2dr+aWr6TX1131U4KMQhns=";
    })
  ];

  buildInputs = [ pytest ];

  propagatedBuildInputs = [
    freezegun
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Wrap tests with fixtures in freeze_time";
    homepage = "https://github.com/ktosiek/pytest-freezegun";
    license = licenses.mit;
    maintainers = [ maintainers.mic92 ];
  };
}