1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools-scm,
8
9 # dependencies
10 aiofiles,
11 aiohttp,
12
13 # optional dependencies
14 aioftp,
15
16 # tests
17 pytest-asyncio,
18 pytest-localserver,
19 pytest-socket,
20 pytestCheckHook,
21 tqdm,
22}:
23
24buildPythonPackage rec {
25 pname = "parfive";
26 version = "2.2.0";
27
28 src = fetchFromGitHub {
29 owner = "Cadair";
30 repo = "parfive";
31 tag = "v${version}";
32 hash = "sha256-DIjS2q/SOrnLspomLHk8ZJ+krdzMyQfbIpXxad30s1k=";
33 };
34
35 pyproject = true;
36
37 build-system = [ setuptools-scm ];
38
39 dependencies = [
40 aiohttp
41 tqdm
42 ];
43
44 optional-dependencies = {
45 ftp = [ aioftp ];
46 };
47
48 nativeCheckInputs = [
49 aiofiles
50 pytest-asyncio
51 pytest-localserver
52 pytest-socket
53 pytestCheckHook
54 ];
55
56 disabledTests = [
57 # Requires network access
58 "test_ftp"
59 "test_ftp_pasv_command"
60 "test_ftp_http"
61
62 # flaky comparison between runtime types
63 "test_http_callback_fail"
64 ];
65
66 # Tests require local network access
67 __darwinAllowLocalNetworking = true;
68
69 pythonImportsCheck = [ "parfive" ];
70
71 meta = {
72 description = "HTTP and FTP parallel file downloader";
73 mainProgram = "parfive";
74 homepage = "https://parfive.readthedocs.io/";
75 changelog = "https://github.com/Cadair/parfive/releases/tag/${src.tag}";
76 license = lib.licenses.mit;
77 maintainers = [ lib.maintainers.sarahec ];
78 };
79}