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