1{ lib
2, glibcLocales
3, buildPythonPackage
4, fetchPypi
5, six
6, appdirs
7, scandir ? null
8, backports_os ? null
9, typing ? null
10, pytz
11, enum34
12, pyftpdlib
13, psutil
14, mock
15, pythonAtLeast
16, isPy3k
17, pytestCheckHook
18, stdenv
19}:
20
21buildPythonPackage rec {
22 pname = "fs";
23 version = "2.4.13";
24
25 src = fetchPypi {
26 inherit pname version;
27 sha256 = "caab4dc1561d63c92f36ee78976f6a4a01381830d8420ce34a78d4f1bb1dc95f";
28 };
29
30 buildInputs = [ glibcLocales ];
31 checkInputs = [ pyftpdlib mock psutil pytestCheckHook ];
32 propagatedBuildInputs = [ six appdirs pytz ]
33 ++ lib.optionals (!isPy3k) [ backports_os ]
34 ++ lib.optionals (!pythonAtLeast "3.6") [ typing ]
35 ++ lib.optionals (!pythonAtLeast "3.5") [ scandir ]
36 ++ lib.optionals (!pythonAtLeast "3.5") [ enum34 ];
37
38 LC_ALL="en_US.utf-8";
39
40 preCheck = ''
41 HOME=$(mktemp -d)
42 '';
43
44 pytestFlagsArray = [ "--ignore=tests/test_opener.py" ];
45
46 disabledTests = [
47 "user_data_repr"
48 ] ++ lib.optionals (stdenv.isDarwin) [ # remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved
49 "test_ftpfs"
50 ] ++ lib.optionals (pythonAtLeast "3.9") [
51 # update friend version of this commit: https://github.com/PyFilesystem/pyfilesystem2/commit/3e02968ce7da7099dd19167815c5628293e00040
52 # merged into master, able to be removed after >2.4.1
53 "test_copy_sendfile"
54 ];
55
56 __darwinAllowLocalNetworking = true;
57
58 meta = with lib; {
59 description = "Filesystem abstraction";
60 homepage = "https://github.com/PyFilesystem/pyfilesystem2";
61 license = licenses.bsd3;
62 maintainers = with maintainers; [ lovek323 ];
63 platforms = platforms.unix;
64 };
65
66}