1{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder, pytest, freezegun }:
2
3buildPythonPackage rec {
4 version = "5.0.2";
5 pname = "ftputil";
6 disabled = pythonOlder "3.6";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "afa2ba402235e8c6583c1d2630269628344134c9246b961ff14f182047f3e633";
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}