Skip to content

Commit 7b3025e

Browse files
authored
Merge branch 'main' into greg-db-patch-1
2 parents 8cac039 + c5ea3f8 commit 7b3025e

28 files changed

+3222
-1522
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,27 @@ jobs:
1010
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
1111
strategy:
1212
matrix:
13-
os: [macos-latest, windows-latest]
14-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy-3.7]
13+
os: [macos-13, windows-latest]
14+
python-version: [3.6, 3.7, 3.8, pypy-3.7]
1515
exclude:
1616
- os: windows-latest
1717
python-version: 3.6
1818
include:
19-
- os: ubuntu-latest
19+
- os: ubuntu-20.04
2020
python-version: 3.7
21+
- os: ubuntu-20.04
22+
python-version: 2.7
2123
steps:
2224
- uses: actions/checkout@v2
23-
- name: Setup Python environment
24-
uses: actions/setup-python@v2.2.2
25+
- if: ${{ matrix.python-version == '2.7' }}
26+
name: Setup Python environment (2.7)
27+
run: |
28+
sudo apt-get install python-is-python2
29+
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
30+
python get-pip.py
31+
- if: ${{ matrix.python-version != '2.7' }}
32+
name: Setup Python environment
33+
uses: actions/setup-python@v3.1.4
2534
with:
2635
python-version: ${{ matrix.python-version }}
2736
- name: Install Requirements
@@ -30,19 +39,19 @@ jobs:
3039
pip install flake8 pytest
3140
pip install -r requirements.txt
3241
pip install -r test/requirements.txt
33-
python setup.py install
42+
python setup.py install --user
3443
- name: Run Linter
3544
run: |
3645
flake8 setup.py dropbox example test
3746
- name: Run Unit Tests
3847
run: |
39-
pytest test/unit/test_dropbox_unit.py
48+
pytest -v test/unit/test_dropbox_unit.py
4049
Docs:
41-
runs-on: macos-latest
50+
runs-on: ubuntu-20.04
4251
steps:
4352
- uses: actions/checkout@v2
4453
- name: Setup Python environment
45-
uses: actions/setup-python@v2.2.2
54+
uses: actions/setup-python@v3.1.4
4655
with:
4756
python-version: '3.7'
4857
- name: Install Requirements
@@ -64,18 +73,27 @@ jobs:
6473
runs-on: ${{ matrix.os }}
6574
strategy:
6675
matrix:
67-
os: [macos-latest, windows-latest]
68-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy-3.7]
69-
exclude:
70-
- os: windows-latest
71-
python-version: 3.6
72-
include:
73-
- os: ubuntu-latest
74-
python-version: 3.7
75-
steps:
76+
os: [macos-13, windows-latest]
77+
python-version: [3.6, 3.7, 3.8, pypy-3.7]
78+
exclude:
79+
- os: windows-latest
80+
python-version: 3.6
81+
include:
82+
- os: ubuntu-20.04
83+
python-version: 3.7
84+
- os: ubuntu-20.04
85+
python-version: 2.7
86+
steps:
7687
- uses: actions/checkout@v2.3.4
77-
- name: Setup Python environment
78-
uses: actions/setup-python@v2.2.2
88+
- if: ${{ matrix.python-version == '2.7' }}
89+
name: Setup Python environment (2.7)
90+
run: |
91+
sudo apt-get install python-is-python2
92+
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
93+
python get-pip.py
94+
- if: ${{ matrix.python-version != '2.7' }}
95+
name: Setup Python environment
96+
uses: actions/setup-python@v3.1.4
7997
with:
8098
python-version: ${{ matrix.python-version }}
8199
- name: Install Requirements
@@ -84,7 +102,7 @@ jobs:
84102
pip install flake8 pytest
85103
pip install -r requirements.txt
86104
pip install -r test/requirements.txt
87-
python setup.py install
105+
python setup.py install --user
88106
- name: Run Integration Tests
89107
env:
90108
LEGACY_USER_DROPBOX_TOKEN: ${{ secrets.LEGACY_USER_DROPBOX_TOKEN }}
@@ -101,4 +119,4 @@ jobs:
101119
SCOPED_TEAM_REFRESH_TOKEN: ${{ secrets.SCOPED_TEAM_REFRESH_TOKEN }}
102120
DROPBOX_SHARED_LINK: ${{ secrets.DROPBOX_SHARED_LINK }}
103121
run: |
104-
pytest test/integration/test_dropbox.py
122+
pytest -v test/integration/test_dropbox.py

.github/workflows/coverage.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Setup Python environment
16-
uses: actions/setup-python@v2.2.2
16+
uses: actions/setup-python@v3.1.4
1717
with:
1818
python-version: '3.7'
1919
- name: Install Requirements
@@ -28,16 +28,17 @@ jobs:
2828
coverage run --rcfile=.coveragerc -m pytest test/unit/test_dropbox_unit.py
2929
coverage xml
3030
- name: Publish Coverage
31-
uses: codecov/codecov-action@v1.3.2
31+
uses: codecov/codecov-action@v3.1.6
3232
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
3334
flags: unit
3435
fail_ci_if_error: true
3536
IntegrationCoverage:
3637
runs-on: ubuntu-latest
3738
steps:
3839
- uses: actions/checkout@v2
3940
- name: Setup Python environment
40-
uses: actions/setup-python@v2.2.2
41+
uses: actions/setup-python@v3.1.4
4142
with:
4243
python-version: '3.7'
4344
- name: Install Requirements
@@ -66,7 +67,8 @@ jobs:
6667
coverage run --rcfile=.coveragerc -m pytest test/integration/test_dropbox.py
6768
coverage xml
6869
- name: Publish Coverage
69-
uses: codecov/codecov-action@v1.3.2
70+
uses: codecov/codecov-action@v3.1.6
7071
with:
72+
token: ${{ secrets.CODECOV_TOKEN }}
7173
flags: integration
72-
fail_ci_if_error: true
74+
fail_ci_if_error: true

.github/workflows/pypiupload.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ on:
99

1010
jobs:
1111
deploy:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313
strategy:
1414
matrix:
15-
python-version: [2.7, 3.x]
15+
python-version: [2.7, 3.7]
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
- name: Setup Python
20-
uses: actions/setup-python@v2.2.2
18+
- uses: actions/checkout@v2.3.4
19+
- if: ${{ matrix.python-version == '2.7' }}
20+
name: Setup Python environment (2.7)
21+
run: |
22+
sudo apt-get install python-is-python2
23+
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
24+
python get-pip.py
25+
- if: ${{ matrix.python-version != '2.7' }}
26+
name: Setup Python environment
27+
uses: actions/setup-python@v3.1.4
2128
with:
2229
python-version: ${{ matrix.python-version }}
2330
- name: Install dependencies
@@ -27,9 +34,9 @@ jobs:
2734
- name: Build
2835
run: |
2936
python setup.py bdist_wheel
30-
- name: Build Sources (3.x)
37+
- name: Build Sources (Python 3)
3138
run: python setup.py sdist
32-
if: matrix.python-version == '3.x'
39+
if: ${{ matrix.python-version != '2.7' }}
3340
- name: Publish
3441
env:
3542
TWINE_USERNAME: __token__

.github/workflows/spec_update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Setup Python environment
13-
uses: actions/setup-python@v2.2.2
13+
uses: actions/setup-python@v3.1.4
1414
with:
1515
python-version: 3.7
1616
- name: Get current time

.readthedocs.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
# .readthedocs.yml
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
24

3-
# Don't build any extra formats
4-
# https://docs.readthedocs.io/en/latest/yaml-config.html#formats
5-
formats: []
5+
version: 2
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3.7"
11+
12+
python:
13+
install:
14+
- requirements: requirements.txt
15+
- method: setuptools
16+
path: .
17+
18+
sphinx:
19+
configuration: docs/conf.py

UPGRADING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This document is designed to show you how to upgrade to the latest version of the SDK accomodating any breaking changes introduced by major version updates.
44
If you find any issues with either this guide on upgrading or the changes introduced in the new version, please see [CONTRIBUTING.md](CONTRIBUTING.md)
55

6+
# Upgrading to v12.0.0
7+
* The SDK no longer provides its own CA bundle to verify TLS connections. It will continue to verify connections through the `requests` library, which makes use of [`certifi`](https://github.com/certifi/python-certifi). You may still provide your own bundle through the `ca_certs` parameter of the `Dropbox` classes and of the `create_session` function (see the [documentation](https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html) for details).
8+
* This will be the last major version to support Python 2.
9+
610
# Upgrading from v10.X.X to v11.0.0
711
The major change that happened in this new version is that we regenerated the client files using Stone 3.2.0,
812
so relative imports are removed from the generated client files.

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
extensions = [
3939
'sphinx.ext.autodoc',
4040
'sphinx.ext.mathjax',
41+
'sphinx_rtd_theme',
4142
]
4243

4344
# Add any paths that contain templates here, relative to this directory.
@@ -54,7 +55,7 @@
5455

5556
# General information about the project.
5657
project = u'Dropbox for Python'
57-
copyright = u'2015-2019, Dropbox, Inc.'
58+
copyright = u'2015-2024, Dropbox, Inc.'
5859

5960
# The version info for the project you're documenting, acts as replacement for
6061
# |version| and |release|, also used in various other places throughout the
@@ -108,7 +109,7 @@
108109

109110
# The theme to use for HTML and HTML Help pages. See the documentation for
110111
# a list of builtin themes.
111-
html_theme = 'default'
112+
html_theme = 'sphinx_rtd_theme'
112113

113114
# Theme options are theme-specific and customize the look and feel of a theme
114115
# further. For a list of options available for each theme, see the

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Dropbox for Python Documentation
77
tutorial
88

99
.. toctree::
10-
:maxdepth: 2
10+
:maxdepth: 1
1111

1212
api/async
1313
api/auth

dropbox/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
675675
token_from_oauth1 = bb.Route(
676676
'token/from_oauth1',
677677
1,
678-
False,
678+
True,
679679
TokenFromOAuth1Arg_validator,
680680
TokenFromOAuth1Result_validator,
681681
TokenFromOAuth1Error_validator,

dropbox/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def auth_token_from_oauth1(self,
8282
If this raises, ApiError will contain:
8383
:class:`dropbox.auth.TokenFromOAuth1Error`
8484
"""
85+
warnings.warn(
86+
'token/from_oauth1 is deprecated.',
87+
DeprecationWarning,
88+
)
8589
arg = auth.TokenFromOAuth1Arg(oauth1_token,
8690
oauth1_token_secret)
8791
r = self.request(
@@ -2880,7 +2884,7 @@ def files_save_url(self,
28802884
url):
28812885
"""
28822886
Save the data from a specified URL into a file in user's Dropbox. Note
2883-
that the transfer from the URL must complete within 5 minutes, or the
2887+
that the transfer from the URL must complete within 15 minutes, or the
28842888
operation will time out and the job will fail. If the given path already
28852889
exists, the file will be renamed to avoid the conflict (e.g. myfile
28862890
(1).txt).

dropbox/base_team.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,10 @@ def team_member_space_limits_excluded_users_remove(self,
12571257
def team_member_space_limits_get_custom_quota(self,
12581258
users):
12591259
"""
1260-
Get users custom quota. Returns none as the custom quota if none was
1261-
set. A maximum of 1000 members can be specified in a single call.
1260+
Get users custom quota. A maximum of 1000 members can be specified in a
1261+
single call. Note: to apply a custom space limit, a team admin needs to
1262+
set a member space limit for the team first. (the team admin can check
1263+
the settings here: https://www.dropbox.com/team/admin/settings/space).
12621264
12631265
Route attributes:
12641266
scope: members.read
@@ -1283,7 +1285,10 @@ def team_member_space_limits_remove_custom_quota(self,
12831285
users):
12841286
"""
12851287
Remove users custom quota. A maximum of 1000 members can be specified in
1286-
a single call.
1288+
a single call. Note: to apply a custom space limit, a team admin needs
1289+
to set a member space limit for the team first. (the team admin can
1290+
check the settings here:
1291+
https://www.dropbox.com/team/admin/settings/space).
12871292
12881293
Route attributes:
12891294
scope: members.write
@@ -1308,7 +1313,10 @@ def team_member_space_limits_set_custom_quota(self,
13081313
users_and_quotas):
13091314
"""
13101315
Set users custom quota. Custom quota has to be at least 15GB. A maximum
1311-
of 1000 members can be specified in a single call.
1316+
of 1000 members can be specified in a single call. Note: to apply a
1317+
custom space limit, a team admin needs to set a member space limit for
1318+
the team first. (the team admin can check the settings here:
1319+
https://www.dropbox.com/team/admin/settings/space).
13121320
13131321
Route attributes:
13141322
scope: members.read

dropbox/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class EchoArg(bb.Struct):
1111
"""
12-
EchoArg contains the arguments to be sent to the Dropbox servers.
12+
Contains the arguments to be sent to the Dropbox servers.
1313
1414
:ivar check.EchoArg.query: The string that you'd like to be echoed back to
1515
you.

dropbox/dropbox_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def __init__(self,
181181
Not required if PKCE was used to authorize the token
182182
:param list scope: list of scopes to request on refresh. If left blank,
183183
refresh will request all available scopes for application
184-
:param str ca_certs: path to CA certificate. If left blank, default certificate location \
185-
will be used
184+
:param str ca_certs: a path to a file of concatenated CA certificates in PEM format.
185+
Has the same meaning as when using :func:`ssl.wrap_socket`.
186186
"""
187187

188188
if not (oauth2_access_token or oauth2_refresh_token or (app_key and app_secret)):
@@ -590,7 +590,6 @@ def request_json_string(self,
590590
headers=headers,
591591
data=body,
592592
stream=stream,
593-
verify=True,
594593
timeout=timeout,
595594
)
596595
self.raise_dropbox_error_for_resp(r)

dropbox/files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10868,7 +10868,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1086810868
SearchV2Cursor_validator = bv.String(min_length=1)
1086910869
Sha256HexHash_validator = bv.String(min_length=64, max_length=64)
1087010870
SharedLinkUrl_validator = bv.String()
10871-
TagText_validator = bv.String(min_length=1, max_length=32, pattern='[A-Za-z0-9_]+')
10871+
TagText_validator = bv.String(min_length=1, max_length=32, pattern='[\\w]+')
1087210872
WritePath_validator = bv.String(pattern='(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)')
1087310873
WritePathOrId_validator = bv.String(pattern='(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)')
1087410874
AddTagArg.path.validator = Path_validator
@@ -11086,7 +11086,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1108611086
('parent_rev', DeleteArg.parent_rev.validator),
1108711087
]
1108811088

11089-
DeleteBatchArg.entries.validator = bv.List(DeleteArg_validator)
11089+
DeleteBatchArg.entries.validator = bv.List(DeleteArg_validator, max_items=1000)
1109011090
DeleteBatchArg._all_field_names_ = set(['entries'])
1109111091
DeleteBatchArg._all_fields_ = [('entries', DeleteBatchArg.entries.validator)]
1109211092

@@ -11979,7 +11979,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
1197911979
('rev', MinimalFileLinkMetadata.rev.validator),
1198011980
]
1198111981

11982-
RelocationBatchArgBase.entries.validator = bv.List(RelocationPath_validator, min_items=1)
11982+
RelocationBatchArgBase.entries.validator = bv.List(RelocationPath_validator, min_items=1, max_items=1000)
1198311983
RelocationBatchArgBase.autorename.validator = bv.Boolean()
1198411984
RelocationBatchArgBase._all_field_names_ = set([
1198511985
'entries',

0 commit comments

Comments
 (0)