nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 requests,
7 six,
8 stone,
9 mock,
10 pytest-mock,
11 pytestCheckHook,
12 sphinxHook,
13 sphinx-rtd-theme,
14}:
15
16buildPythonPackage rec {
17 pname = "dropbox";
18 version = "12.0.2";
19 pyproject = true;
20
21 outputs = [
22 "out"
23 "doc"
24 ];
25
26 src = fetchFromGitHub {
27 owner = "dropbox";
28 repo = "dropbox-sdk-python";
29 tag = "v${version}";
30 hash = "sha256-9Fsh06V226vIyJhrlLkh9Xr4UGoEIISnIFCtuKqI218=";
31 };
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 requests
37 six
38 stone
39 ];
40
41 nativeCheckInputs = [
42 mock
43 pytest-mock
44 pytestCheckHook
45 ];
46
47 postPatch = ''
48 substituteInPlace setup.py \
49 --replace-fail "'pytest-runner==5.2.0'," ""
50 '';
51
52 pythonImportsCheck = [ "dropbox" ];
53
54 nativeBuildInputs = [
55 sphinxHook
56 sphinx-rtd-theme
57 ];
58
59 # Version 12.0.0 re-introduced Python 2 support and set some very restrictive version bounds
60 # https://github.com/dropbox/dropbox-sdk-python/commit/75596daf316b4a806f18057e2797a15bdf83cf6d
61 # This will be the last major version to support Python 2, so version bounds might be more reasonable again in the future.
62 pythonRelaxDeps = [
63 "stone"
64 ];
65
66 # Set SCOPED_USER_DROPBOX_TOKEN environment variable to a valid value.
67 disabledTests = [
68 "test_default_oauth2_urls"
69 "test_bad_auth"
70 "test_multi_auth"
71 "test_refresh"
72 "test_app_auth"
73 "test_downscope"
74 "test_rpc"
75 "test_upload_download"
76 "test_bad_upload_types"
77 "test_clone_when_user_linked"
78 "test_with_path_root_constructor"
79 "test_path_root"
80 "test_path_root_err"
81 "test_versioned_route"
82 "test_team"
83 "test_as_user"
84 "test_as_admin"
85 "test_clone_when_team_linked"
86 "test_bad_pins"
87 "test_bad_pins_session"
88 ];
89
90 meta = {
91 description = "Python library for Dropbox's HTTP-based Core and Datastore APIs";
92 homepage = "https://github.com/dropbox/dropbox-sdk-python";
93 changelog = "https://github.com/dropbox/dropbox-sdk-python/releases/tag/${src.tag}";
94 license = lib.licenses.mit;
95 maintainers = with lib.maintainers; [ sfrijters ];
96 };
97}