at 25.11-pre 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 glibcLocales, 7 importlib-metadata, 8 logfury, 9 annotated-types, 10 packaging, 11 pdm-backend, 12 pyfakefs, 13 pytest-lazy-fixtures, 14 pytest-mock, 15 pytestCheckHook, 16 pythonOlder, 17 requests, 18 tqdm, 19 typing-extensions, 20}: 21 22buildPythonPackage rec { 23 pname = "b2sdk"; 24 version = "2.8.1"; 25 pyproject = true; 26 27 disabled = pythonOlder "3.7"; 28 29 src = fetchFromGitHub { 30 owner = "Backblaze"; 31 repo = "b2-sdk-python"; 32 tag = "v${version}"; 33 hash = "sha256-KUz/OaFZwJPVNCZ1j73SrpWknQmrvwfr5MLVYxOojZc="; 34 }; 35 36 build-system = [ pdm-backend ]; 37 38 dependencies = 39 [ 40 annotated-types 41 packaging 42 logfury 43 requests 44 ] 45 ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ] 46 ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; 47 48 nativeCheckInputs = [ 49 pytest-lazy-fixtures 50 pytest-mock 51 pytestCheckHook 52 tqdm 53 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ glibcLocales ]; 54 55 disabledTestPaths = [ 56 # requires aws s3 auth 57 "test/integration/test_download.py" 58 "test/integration/test_upload.py" 59 60 # Requires backblaze auth 61 "test/integration/test_bucket.py" 62 ]; 63 64 disabledTests = [ 65 # Test requires an API key 66 "test_raw_api" 67 "test_files_headers" 68 "test_large_file" 69 "test_file_info_b2_attributes" 70 "test_sync_folder" 71 ]; 72 73 pythonImportsCheck = [ "b2sdk" ]; 74 75 meta = with lib; { 76 description = "Client library and utilities for access to B2 Cloud Storage (backblaze)"; 77 homepage = "https://github.com/Backblaze/b2-sdk-python"; 78 changelog = "https://github.com/Backblaze/b2-sdk-python/blob/${src.tag}/CHANGELOG.md"; 79 license = licenses.mit; 80 maintainers = with maintainers; [ pmw ]; 81 }; 82}