1{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder, pytest, freezegun }:
2
3buildPythonPackage rec {
4 version = "5.0.1";
5 pname = "ftputil";
6 disabled = pythonOlder "3.6";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "394997ccb3cd4825c6e22b5e349c62cf5016c35db4d60940f3513db66d205561";
11 };
12
13 checkInputs = [ pytest freezegun ];
14
15 checkPhase = ''
16 touch Makefile
17 # Disable tests that require network access or access /home or assume execution before year 2020
18 py.test test \
19 -k "not test_public_servers and not test_real_ftp \
20 and not test_set_parser and not test_repr \
21 and not test_conditional_upload and not test_conditional_download_with_older_target \
22 ''
23 # need until https://ftputil.sschwarzer.net/trac/ticket/140#ticket is fixed
24 + lib.optionalString stdenv.isDarwin "and not test_error_message_reuse"
25 + ''"'';
26
27 meta = with lib; {
28 description = "High-level FTP client library (virtual file system and more)";
29 homepage = "http://ftputil.sschwarzer.net/";
30 license = licenses.bsd2; # "Modified BSD license, says pypi"
31 };
32}