2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
pandas,
|
|
|
|
pytestCheckHook,
|
|
|
|
undefined,
|
2021-02-17 17:02:09 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyfakefs";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "5.4.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
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;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-IMtR6GDC8/+DhZFirVE0u4sKHnqB3woYz8zEhi0Nncw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +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"
|
|
|
|
''
|
|
|
|
+ (lib.optionalString stdenv.isDarwin ''
|
|
|
|
# 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"
|
|
|
|
'');
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pyfakefs" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeCheckInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
pandas
|
2024-01-13 08:15:51 +00:00
|
|
|
pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
undefined
|
2023-11-16 04:20:00 +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/";
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/jmcgeheeiv/pyfakefs/blob/v${version}/CHANGES.md";
|
2021-02-17 17:02:09 +00:00
|
|
|
license = licenses.asl20;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|