1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 requests,
7 jsonpatch,
8 schema,
9 responses,
10 setuptools,
11 tqdm,
12 urllib3,
13 pythonOlder,
14 importlib-metadata,
15}:
16
17buildPythonPackage rec {
18 pname = "internetarchive";
19 version = "5.5.1";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "jjjake";
26 repo = "internetarchive";
27 tag = "v${version}";
28 hash = "sha256-Og0EPdaxu4etWj+9WPSyAHlz/BNUanu2gf+6k4FzN90=";
29 };
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 tqdm
35 requests
36 jsonpatch
37 schema
38 urllib3
39 ]
40 ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
41
42 nativeCheckInputs = [
43 responses
44 pytestCheckHook
45 ];
46
47 disabledTests = [
48 # Tests require network access
49 "test_get_item_with_kwargs"
50 "test_upload"
51 "test_upload_metadata"
52 "test_upload_queue_derive"
53 "test_upload_validate_identifie"
54 "test_upload_validate_identifier"
55 ];
56
57 disabledTestPaths = [
58 # Tests require network access
59 "tests/cli/test_ia.py"
60 "tests/cli/test_ia_download.py"
61 ];
62
63 pythonImportsCheck = [ "internetarchive" ];
64
65 meta = {
66 description = "Python and Command-Line Interface to Archive.org";
67 homepage = "https://github.com/jjjake/internetarchive";
68 changelog = "https://github.com/jjjake/internetarchive/blob/${src.tag}/HISTORY.rst";
69 license = lib.licenses.agpl3Plus;
70 maintainers = with lib.maintainers; [ pyrox0 ];
71 mainProgram = "ia";
72 };
73}