about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-openfiles/default.nix
blob: ebd0a0976c64eac70bbcc26026b2f573e22c22b7 (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
47
48
49
50
51
{
  lib,
  buildPythonPackage,
  fetchpatch,
  fetchPypi,
  isPy27,
  packaging,
  pytest,
  pytestCheckHook,
  psutil,
  setuptools-scm,
}:

buildPythonPackage rec {
  pname = "pytest-openfiles";
  version = "0.5.0";
  format = "setuptools";
  disabled = isPy27; # abandoned

  src = fetchPypi {
    inherit pname version;
    sha256 = "179c2911d8aee3441fee051aba08e0d9b4dab61b829ae4811906d5c49a3b0a58";
  };

  patches = [
    (fetchpatch {
      name = "replace-distutils-with-packaging.patch";
      url = "https://github.com/astropy/pytest-openfiles/commit/e17e8123936689b0b0ecfb713976588d6793d8bb.patch";
      includes = [ "pytest_openfiles/plugin.py" ];
      hash = "sha256-+6xqOwnBO+jxenXxPdDhLqqm3w+ZRjWeVqqgz8j22bU=";
    })
  ];

  nativeBuildInputs = [ setuptools-scm ];

  buildInputs = [ pytest ];

  propagatedBuildInputs = [
    packaging
    psutil
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = with lib; {
    description = "Pytest plugin for detecting inadvertent open file handles";
    homepage = "https://astropy.org";
    license = licenses.bsd3;
    maintainers = [ ];
  };
}