1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 flit-core,
7 typing-extensions,
8 azure-storage-blob,
9 azure-storage-file-datalake,
10 google-cloud-storage,
11 boto3,
12 psutil,
13 pydantic,
14 pytestCheckHook,
15 pytest-cases,
16 pytest-cov-stub,
17 pytest-xdist,
18 python-dotenv,
19 shortuuid,
20 tenacity,
21}:
22
23buildPythonPackage rec {
24 pname = "cloudpathlib";
25 version = "0.19.0";
26 pyproject = true;
27
28 disabled = pythonOlder "3.8";
29
30 src = fetchFromGitHub {
31 owner = "drivendataorg";
32 repo = "cloudpathlib";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-VjoQc9nzwcMh9kiqWXsJNE5X7e7/sVGId5jgFTLZQy4=";
35 };
36
37 build-system = [ flit-core ];
38
39 dependencies = lib.optional (pythonOlder "3.11") typing-extensions;
40
41 optional-dependencies = {
42 all = optional-dependencies.azure ++ optional-dependencies.gs ++ optional-dependencies.s3;
43 azure = [
44 azure-storage-blob
45 azure-storage-file-datalake
46 ];
47 gs = [ google-cloud-storage ];
48 s3 = [ boto3 ];
49 };
50
51 pythonImportsCheck = [ "cloudpathlib" ];
52
53 nativeCheckInputs = [
54 psutil
55 pydantic
56 pytestCheckHook
57 pytest-cases
58 pytest-cov-stub
59 pytest-xdist
60 python-dotenv
61 shortuuid
62 tenacity
63 ] ++ optional-dependencies.all;
64
65 meta = with lib; {
66 description = "Python pathlib-style classes for cloud storage services such as Amazon S3, Azure Blob Storage, and Google Cloud Storage";
67 homepage = "https://github.com/drivendataorg/cloudpathlib";
68 license = licenses.mit;
69 maintainers = with maintainers; [ GaetanLepage ];
70 };
71}