nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, requests
6, six
7, stone
8, mock
9, pytest-mock
10, pytestCheckHook
11, sphinxHook
12}:
13
14buildPythonPackage rec {
15 pname = "dropbox";
16 version = "11.31.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20 outputs = ["out" "doc"];
21
22 src = fetchFromGitHub {
23 owner = "dropbox";
24 repo = "dropbox-sdk-python";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-mbBVivrpXYNuVbXeHRyy07LxPbtYvaL3JleK7QXOxi0=";
27 };
28
29 propagatedBuildInputs = [
30 requests
31 six
32 stone
33 ];
34
35 checkInputs = [
36 mock
37 pytest-mock
38 pytestCheckHook
39 ];
40
41 postPatch = ''
42 substituteInPlace setup.py \
43 --replace "'pytest-runner == 5.2.0'," ""
44 '';
45
46 doCheck = true;
47
48 pythonImportsCheck = [
49 "dropbox"
50 ];
51 nativeBuildInputs = [ sphinxHook ];
52
53 # Set SCOPED_USER_DROPBOX_TOKEN environment variable to a valid value.
54 disabledTests = [
55 "test_default_oauth2_urls"
56 "test_bad_auth"
57 "test_multi_auth"
58 "test_refresh"
59 "test_app_auth"
60 "test_downscope"
61 "test_rpc"
62 "test_upload_download"
63 "test_bad_upload_types"
64 "test_clone_when_user_linked"
65 "test_with_path_root_constructor"
66 "test_path_root"
67 "test_path_root_err"
68 "test_versioned_route"
69 "test_team"
70 "test_as_user"
71 "test_as_admin"
72 "test_clone_when_team_linked"
73 ];
74
75 meta = with lib; {
76 description = "Python library for Dropbox's HTTP-based Core and Datastore APIs";
77 homepage = "https://github.com/dropbox/dropbox-sdk-python";
78 license = licenses.mit;
79 maintainers = with maintainers; [ sfrijters ];
80 };
81}