about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/fs/default.nix
blob: c14b169bea95822d8febe1b12c340ec59c79f234 (plain) (blame)
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
{ lib
, glibcLocales
, buildPythonPackage
, fetchPypi
, six
, appdirs
, scandir ? null
, backports_os ? null
, typing ? null
, pytz
, enum34
, pyftpdlib
, psutil
, mock
, pythonAtLeast
, isPy3k
, pytestCheckHook
, stdenv
}:

buildPythonPackage rec {
  pname = "fs";
  version = "2.4.12";

  src = fetchPypi {
    inherit pname version;
    sha256 = "c10ba188b14d6213a1ca950efd004931abbfa64b294c80bbf1045753831bf42f";
  };

  buildInputs = [ glibcLocales ];
  checkInputs = [ pyftpdlib mock psutil pytestCheckHook ];
  propagatedBuildInputs = [ six appdirs pytz ]
    ++ lib.optionals (!isPy3k) [ backports_os ]
    ++ lib.optionals (!pythonAtLeast "3.6") [ typing ]
    ++ lib.optionals (!pythonAtLeast "3.5") [ scandir ]
    ++ lib.optionals (!pythonAtLeast "3.5") [ enum34 ];

  LC_ALL="en_US.utf-8";

  preCheck = ''
    HOME=$(mktemp -d)
  '';

  pytestFlagsArray = [ "--ignore=tests/test_opener.py" ];

  disabledTests = [
    "user_data_repr"
  ] ++ lib.optionals (stdenv.isDarwin) [ # remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved
    "test_ftpfs"
  ] ++ lib.optionals (pythonAtLeast "3.9") [
    # update friend version of this commit: https://github.com/PyFilesystem/pyfilesystem2/commit/3e02968ce7da7099dd19167815c5628293e00040
    # merged into master, able to be removed after >2.4.1
    "test_copy_sendfile"
  ];

  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "Filesystem abstraction";
    homepage    = "https://github.com/PyFilesystem/pyfilesystem2";
    license     = licenses.bsd3;
    maintainers = with maintainers; [ lovek323 ];
    platforms   = platforms.unix;
  };

}