1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
{
lib,
stdenv,
appdirs,
buildPythonPackage,
fetchPypi,
glibcLocales,
isPyPy,
mock,
psutil,
pyftpdlib,
pytestCheckHook,
pythonAtLeast,
pytz,
setuptools,
six,
}:
buildPythonPackage rec {
pname = "fs";
version = "2.4.16";
pyproject = true;
# https://github.com/PyFilesystem/pyfilesystem2/issues/596
disabled = pythonAtLeast "3.14";
src = fetchPypi {
inherit pname version;
hash = "sha256-rpfH1RIT9LcLapWCklMCiQkN46fhWEHhCPvhRPBp0xM=";
};
postPatch = ''
# https://github.com/PyFilesystem/pyfilesystem2/pull/591
substituteInPlace tests/test_ftpfs.py \
--replace ThreadedTestFTPd FtpdThreadWrapper
'';
build-system = [ setuptools ];
dependencies = [
setuptools
six
appdirs
pytz
];
nativeCheckInputs = [
pyftpdlib
mock
psutil
pytestCheckHook
]
++ lib.optionals isPyPy [
glibcLocales
];
LC_ALL = "en_US.utf-8";
preCheck = ''
HOME=$(mktemp -d)
'';
disabledTestPaths = [
# Circular dependency with parameterized
"tests/test_move.py"
"tests/test_mirror.py"
"tests/test_copy.py"
];
disabledTests = [
"user_data_repr"
# https://github.com/PyFilesystem/pyfilesystem2/issues/568
"test_remove"
# Tests require network access
"TestFTPFS"
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
# remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved
"test_ftpfs"
];
pythonImportsCheck = [ "fs" ];
__darwinAllowLocalNetworking = true;
meta = {
description = "Filesystem abstraction";
homepage = "https://github.com/PyFilesystem/pyfilesystem2";
changelog = "https://github.com/PyFilesystem/pyfilesystem2/blob/v${version}/CHANGELOG.md";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ lovek323 ];
platforms = lib.platforms.unix;
};
}
|