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.4.0";
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-2IL4VUt958atKDqCmj6rZ9I74tBRsA42EF1F1YT433E=";
29 };
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 tqdm
35 requests
36 jsonpatch
37 schema
38 urllib3
39 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
40
41 nativeCheckInputs = [
42 responses
43 pytestCheckHook
44 ];
45
46 disabledTests = [
47 # Tests require network access
48 "test_get_item_with_kwargs"
49 "test_upload"
50 "test_upload_metadata"
51 "test_upload_queue_derive"
52 "test_upload_validate_identifie"
53 "test_upload_validate_identifier"
54 ];
55
56 disabledTestPaths = [
57 # Tests require network access
58 "tests/cli/test_ia.py"
59 "tests/cli/test_ia_download.py"
60 ];
61
62 pythonImportsCheck = [ "internetarchive" ];
63
64 meta = {
65 description = "Python and Command-Line Interface to Archive.org";
66 homepage = "https://github.com/jjjake/internetarchive";
67 changelog = "https://github.com/jjjake/internetarchive/blob/${src.tag}/HISTORY.rst";
68 license = lib.licenses.agpl3Plus;
69 maintainers = with lib.maintainers; [ pyrox0 ];
70 mainProgram = "ia";
71 };
72}