2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "4.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pyfakefs";
|
2020-09-25 04:45:31 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "58b017b3437bbe97803a23755876c6d6aeb5aea37e52cec15e5d86b59c4c7295";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# test doesn't work in sandbox
|
|
|
|
substituteInPlace pyfakefs/tests/fake_filesystem_test.py \
|
|
|
|
--replace "test_expand_root" "notest_expand_root"
|
|
|
|
substituteInPlace pyfakefs/tests/fake_os_test.py \
|
|
|
|
--replace "test_path_links_not_resolved" "notest_path_links_not_resolved" \
|
|
|
|
--replace "test_append_mode_tell_linux_windows" "notest_append_mode_tell_linux_windows"
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + (lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# this test fails on darwin due to case-insensitive file system
|
|
|
|
substituteInPlace pyfakefs/tests/fake_os_test.py \
|
|
|
|
--replace "test_rename_dir_to_existing_dir" "notest_rename_dir_to_existing_dir"
|
|
|
|
'');
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
# https://github.com/jmcgeheeiv/pyfakefs/issues/581 (OSError: [Errno 9] Bad file descriptor)
|
|
|
|
disabledTests = [ "test_open_existing_pipe" ];
|
|
|
|
pythonImportsCheck = [ "pyfakefs" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fake file system that mocks the Python file system modules";
|
2021-02-17 17:02:09 +00:00
|
|
|
homepage = "http://pyfakefs.org/";
|
|
|
|
changelog = "https://github.com/jmcgeheeiv/pyfakefs/blob/master/CHANGES.md";
|
|
|
|
license = licenses.asl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|