1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 fetchPypi,
6 isPy27,
7 packaging,
8 pytest,
9 pytestCheckHook,
10 psutil,
11 setuptools-scm,
12}:
13
14buildPythonPackage rec {
15 pname = "pytest-openfiles";
16 version = "0.5.0";
17 format = "setuptools";
18 disabled = isPy27; # abandoned
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "179c2911d8aee3441fee051aba08e0d9b4dab61b829ae4811906d5c49a3b0a58";
23 };
24
25 patches = [
26 (fetchpatch {
27 name = "replace-distutils-with-packaging.patch";
28 url = "https://github.com/astropy/pytest-openfiles/commit/e17e8123936689b0b0ecfb713976588d6793d8bb.patch";
29 includes = [ "pytest_openfiles/plugin.py" ];
30 hash = "sha256-+6xqOwnBO+jxenXxPdDhLqqm3w+ZRjWeVqqgz8j22bU=";
31 })
32 ];
33
34 nativeBuildInputs = [ setuptools-scm ];
35
36 buildInputs = [ pytest ];
37
38 propagatedBuildInputs = [
39 packaging
40 psutil
41 ];
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 meta = with lib; {
46 description = "Pytest plugin for detecting inadvertent open file handles";
47 homepage = "https://astropy.org";
48 license = licenses.bsd3;
49 maintainers = [ ];
50 };
51}