2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "5.1.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;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-MWxgJmQNFKa0+95x/ZZ0V20bVxDe2o+r3oqtUdeF28M=";
|
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"
|
|
|
|
'');
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-02-17 17:02:09 +00:00
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|