1{
2 lib,
3 stdenv,
4 async-timeout,
5 buildPythonPackage,
6 fetchPypi,
7 pytest-asyncio,
8 pytest-cov-stub,
9 pytest-mock,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13 siosocks,
14 trustme,
15}:
16
17buildPythonPackage rec {
18 pname = "aioftp";
19 version = "0.27.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-fASMMiAIF5bFmDKm/Z/Y+tl+POwSpQvjq8zy3LvrJho=";
27 };
28
29 build-system = [ setuptools ];
30
31 optional-dependencies = {
32 socks = [ siosocks ];
33 };
34
35 nativeCheckInputs = [
36 async-timeout
37 pytest-asyncio
38 pytest-cov-stub
39 pytest-mock
40 pytestCheckHook
41 trustme
42 ]
43 ++ lib.flatten (builtins.attrValues optional-dependencies);
44
45 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
46 # uses 127.0.0.2, which macos doesn't like
47 "test_pasv_connection_pasv_forced_response_address"
48 ];
49
50 pythonImportsCheck = [ "aioftp" ];
51
52 meta = with lib; {
53 description = "Python FTP client/server for asyncio";
54 homepage = "https://aioftp.readthedocs.io/";
55 changelog = "https://github.com/aio-libs/aioftp/blob/${version}/history.rst";
56 license = licenses.asl20;
57 maintainers = [ ];
58 };
59}