2020-09-20 15:15:28 +02:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, pythonOlder, mock }:
|
2018-04-02 23:29:50 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mock-open";
|
2020-09-20 15:15:28 +02:00
|
|
|
version = "1.4.0";
|
2018-04-02 23:29:50 +02:00
|
|
|
|
|
|
|
# no tests in PyPI tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nivbend";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-09-20 15:15:28 +02:00
|
|
|
sha256 = "0qlz4y8jqxsnmqg03yp9f87rmnjrvmxm5qvm6n1218gm9k5dixbm";
|
2018-04-02 23:29:50 +02:00
|
|
|
};
|
|
|
|
|
2020-09-20 15:15:28 +02:00
|
|
|
patches = lib.optional (pythonOlder "3.0")
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ascii-only.patch";
|
|
|
|
url = "https://github.com/das-g/mock-open/commit/521ff260da127949fe4aceff1667cba223c5b07b.patch";
|
|
|
|
sha256 = "0ampbhk7kwkn0q5d2h9wrflkr8fji2bybmdck4qdzw1qkslfwwrn";
|
|
|
|
});
|
|
|
|
|
2018-04-02 23:29:50 +02:00
|
|
|
propagatedBuildInputs = lib.optional (pythonOlder "3.3") mock;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/nivbend/mock-open";
|
2018-04-02 23:29:50 +02:00
|
|
|
description = "A better mock for file I/O";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|