Skip to content

Commit 840ef6d

Browse files
Upgrade stone version 2 (#560)
* Upgrade Stone pyproject.toml * introduce ruff
1 parent e3f6c14 commit 840ef6d

47 files changed

Lines changed: 47914 additions & 36177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install -U pip
33-
python -m pip install -U build flake8 pytest
33+
python -m pip install -U build pytest ruff
3434
python -m pip install -r requirements.txt
3535
python -m pip install -r test/requirements.txt
3636
@@ -54,7 +54,8 @@ jobs:
5454
5555
- name: Run linter
5656
run: |
57-
flake8 dropbox example test
57+
ruff check dropbox example test
58+
ruff format --check dropbox example test
5859
5960
- name: Run unit tests
6061
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ __pycache__/
2222
.venv
2323
venv/
2424
venv3/
25+
26+
dropbox/_version.py

docs/conf.py

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,44 @@
1818
# Assumes that the dropbox package to generate docs for is one-level above in
1919
# the directory hierarchy. This takes precendence over other dropbox packages
2020
# that may be in the sys.path.
21-
sys.path.insert(0, os.path.abspath('..'))
21+
sys.path.insert(0, os.path.abspath(".."))
2222

2323
import dropbox
2424

2525
# If extensions (or modules to document with autodoc) are in another directory,
2626
# add these directories to sys.path here. If the directory is relative to the
2727
# documentation root, use os.path.abspath to make it absolute, like shown here.
28-
#sys.path.insert(0, os.path.abspath('.'))
28+
# sys.path.insert(0, os.path.abspath('.'))
2929

3030
# -- General configuration ------------------------------------------------
3131

3232
# If your documentation needs a minimal Sphinx version, state it here.
33-
#needs_sphinx = '1.0'
33+
# needs_sphinx = '1.0'
3434

3535
# Add any Sphinx extension module names here, as strings. They can be
3636
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3737
# ones.
3838
extensions = [
39-
'sphinx.ext.autodoc',
40-
'sphinx.ext.mathjax',
41-
'sphinx_rtd_theme',
39+
"sphinx.ext.autodoc",
40+
"sphinx.ext.mathjax",
41+
"sphinx_rtd_theme",
4242
]
4343

4444
# Add any paths that contain templates here, relative to this directory.
45-
templates_path = ['_templates']
45+
templates_path = ["_templates"]
4646

4747
# The suffix of source filenames.
48-
source_suffix = '.rst'
48+
source_suffix = ".rst"
4949

5050
# The encoding of source files.
51-
#source_encoding = 'utf-8-sig'
51+
# source_encoding = 'utf-8-sig'
5252

5353
# The master toctree document.
54-
master_doc = 'index'
54+
master_doc = "index"
5555

5656
# General information about the project.
57-
project = u'Dropbox for Python'
58-
copyright = u'2015-2024, Dropbox, Inc.'
57+
project = "Dropbox for Python"
58+
copyright = "2015-2024, Dropbox, Inc."
5959

6060
# The version info for the project you're documenting, acts as replacement for
6161
# |version| and |release|, also used in various other places throughout the
@@ -68,131 +68,131 @@
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.
71-
#language = None
71+
# language = None
7272

7373
# There are two options for replacing |today|: either, you set today to some
7474
# non-false value, then it is used:
75-
#today = ''
75+
# today = ''
7676
# Else, today_fmt is used as the format for a strftime call.
77-
#today_fmt = '%B %d, %Y'
77+
# today_fmt = '%B %d, %Y'
7878

7979
# List of patterns, relative to source directory, that match files and
8080
# directories to ignore when looking for source files.
81-
exclude_patterns = ['_build']
81+
exclude_patterns = ["_build"]
8282

8383
# The reST default role (used for this markup: `text`) to use for all
8484
# documents.
85-
#default_role = None
85+
# default_role = None
8686

8787
# If true, '()' will be appended to :func: etc. cross-reference text.
88-
#add_function_parentheses = True
88+
# add_function_parentheses = True
8989

9090
# If true, the current module name will be prepended to all description
9191
# unit titles (such as .. function::).
92-
#add_module_names = True
92+
# add_module_names = True
9393

9494
# If true, sectionauthor and moduleauthor directives will be shown in the
9595
# output. They are ignored by default.
96-
#show_authors = False
96+
# show_authors = False
9797

9898
# The name of the Pygments (syntax highlighting) style to use.
99-
pygments_style = 'sphinx'
99+
pygments_style = "sphinx"
100100

101101
# A list of ignored prefixes for module index sorting.
102-
#modindex_common_prefix = []
102+
# modindex_common_prefix = []
103103

104104
# If true, keep warnings as "system message" paragraphs in the built documents.
105-
#keep_warnings = False
105+
# keep_warnings = False
106106

107107

108108
# -- Options for HTML output ----------------------------------------------
109109

110110
# The theme to use for HTML and HTML Help pages. See the documentation for
111111
# a list of builtin themes.
112-
html_theme = 'sphinx_rtd_theme'
112+
html_theme = "sphinx_rtd_theme"
113113

114114
# Theme options are theme-specific and customize the look and feel of a theme
115115
# further. For a list of options available for each theme, see the
116116
# documentation.
117-
#html_theme_options = {}
117+
# html_theme_options = {}
118118

119119
# Add any paths that contain custom themes here, relative to this directory.
120-
#html_theme_path = []
120+
# html_theme_path = []
121121

122122
# The name for this set of Sphinx documents. If None, it defaults to
123123
# "<project> v<release> documentation".
124-
#html_title = None
124+
# html_title = None
125125

126126
# A shorter title for the navigation bar. Default is the same as html_title.
127-
#html_short_title = None
127+
# html_short_title = None
128128

129129
# The name of an image file (relative to this directory) to place at the top
130130
# of the sidebar.
131-
#html_logo = None
131+
# html_logo = None
132132

133133
# The name of an image file (within the static path) to use as favicon of the
134134
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
135135
# pixels large.
136-
#html_favicon = None
136+
# html_favicon = None
137137

138138
# Add any paths that contain custom static files (such as style sheets) here,
139139
# relative to this directory. They are copied after the builtin static files,
140140
# so a file named "default.css" will overwrite the builtin "default.css".
141-
html_static_path = ['_static']
141+
html_static_path = ["_static"]
142142

143143
# Add any extra paths that contain custom files (such as robots.txt or
144144
# .htaccess) here, relative to this directory. These files are copied
145145
# directly to the root of the documentation.
146-
#html_extra_path = []
146+
# html_extra_path = []
147147

148148
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
149149
# using the given strftime format.
150-
#html_last_updated_fmt = '%b %d, %Y'
150+
# html_last_updated_fmt = '%b %d, %Y'
151151

152152
# If true, SmartyPants will be used to convert quotes and dashes to
153153
# typographically correct entities.
154-
#html_use_smartypants = True
154+
# html_use_smartypants = True
155155

156156
# Custom sidebar templates, maps document names to template names.
157-
#html_sidebars = {}
157+
# html_sidebars = {}
158158

159159
# Additional templates that should be rendered to pages, maps page names to
160160
# template names.
161-
#html_additional_pages = {}
161+
# html_additional_pages = {}
162162

163163
# If false, no module index is generated.
164-
#html_domain_indices = True
164+
# html_domain_indices = True
165165

166166
# If false, no index is generated.
167-
#html_use_index = True
167+
# html_use_index = True
168168

169169
# If true, the index is split into individual pages for each letter.
170-
#html_split_index = False
170+
# html_split_index = False
171171

172172
# If true, links to the reST sources are added to the pages.
173-
#html_show_sourcelink = True
173+
# html_show_sourcelink = True
174174

175175
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
176-
#html_show_sphinx = True
176+
# html_show_sphinx = True
177177

178178
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
179-
#html_show_copyright = True
179+
# html_show_copyright = True
180180

181181
# If true, an OpenSearch description file will be output, and all pages will
182182
# contain a <link> tag referring to it. The value of this option must be the
183183
# base URL from which the finished HTML is served.
184-
#html_use_opensearch = ''
184+
# html_use_opensearch = ''
185185

186186
# This is the file name suffix for HTML files (e.g. ".xhtml").
187-
#html_file_suffix = None
187+
# html_file_suffix = None
188188

189189
# Output file base name for HTML help builder.
190-
htmlhelp_basename = 'DropboxforPythondoc'
190+
htmlhelp_basename = "DropboxforPythondoc"
191191

192192

193193
# -- Options for LaTeX output ---------------------------------------------
194194

195-
#latex_elements = {
195+
# latex_elements = {
196196
# The paper size ('letterpaper' or 'a4paper').
197197
#'papersize': 'letterpaper',
198198

@@ -201,69 +201,69 @@
201201

202202
# Additional stuff for the LaTeX preamble.
203203
#'preamble': '',
204-
#}
204+
# }
205205

206206
# Grouping the document tree into LaTeX files. List of tuples
207207
# (source start file, target name, title,
208208
# author, documentclass [howto, manual, or own class]).
209-
#latex_documents = [
209+
# latex_documents = [
210210
# ('index2', 'DropboxforPython.tex', u'Dropbox for Python Documentation',
211211
# u'Ken Elkabany', 'manual'),
212-
#]
212+
# ]
213213

214214
# The name of an image file (relative to this directory) to place at the top of
215215
# the title page.
216-
#latex_logo = None
216+
# latex_logo = None
217217

218218
# For "manual" documents, if this is true, then toplevel headings are parts,
219219
# not chapters.
220-
#latex_use_parts = False
220+
# latex_use_parts = False
221221

222222
# If true, show page references after internal links.
223-
#latex_show_pagerefs = False
223+
# latex_show_pagerefs = False
224224

225225
# If true, show URL addresses after external links.
226-
#latex_show_urls = False
226+
# latex_show_urls = False
227227

228228
# Documents to append as an appendix to all manuals.
229-
#latex_appendices = []
229+
# latex_appendices = []
230230

231231
# If false, no module index is generated.
232-
#latex_domain_indices = True
232+
# latex_domain_indices = True
233233

234234

235235
# -- Options for manual page output ---------------------------------------
236236

237237
# One entry per manual page. List of tuples
238238
# (source start file, name, description, authors, manual section).
239-
#man_pages = [
239+
# man_pages = [
240240
# ('index2', 'dropboxforpython', u'Dropbox for Python Documentation',
241241
# [u'Dropbox, Inc.'], 1)
242-
#]
242+
# ]
243243

244244
# If true, show URL addresses after external links.
245-
#man_show_urls = False
245+
# man_show_urls = False
246246

247247

248248
# -- Options for Texinfo output -------------------------------------------
249249

250250
# Grouping the document tree into Texinfo files. List of tuples
251251
# (source start file, target name, title, author,
252252
# dir menu entry, description, category)
253-
#texinfo_documents = [
253+
# texinfo_documents = [
254254
# ('index2', 'DropboxforPython', u'Dropbox for Python Documentation',
255255
# u'Dropbox, Inc.', 'DropboxforPython', 'One line description of project.',
256256
# 'Miscellaneous'),
257-
#]
257+
# ]
258258

259259
# Documents to append as an appendix to all manuals.
260-
#texinfo_appendices = []
260+
# texinfo_appendices = []
261261

262262
# If false, no module index is generated.
263-
#texinfo_domain_indices = True
263+
# texinfo_domain_indices = True
264264

265265
# How to display URL addresses: 'footnote', 'no', or 'inline'.
266-
#texinfo_show_urls = 'footnote'
266+
# texinfo_show_urls = 'footnote'
267267

268268
# If true, do not generate a @detailmenu in the "Top" node's menu.
269-
#texinfo_no_detailmenu = False
269+
# texinfo_no_detailmenu = False

dropbox/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
from __future__ import absolute_import
22

33
from dropbox.dropbox_client import ( # noqa: F401 # pylint: disable=unused-import
4-
__version__, Dropbox, DropboxTeam, create_session
4+
__version__,
5+
Dropbox,
6+
DropboxTeam,
7+
create_session,
58
)
69
from dropbox.oauth import ( # noqa: F401 # pylint: disable=unused-import
7-
DropboxOAuth2Flow, DropboxOAuth2FlowNoRedirect
10+
DropboxOAuth2Flow,
11+
DropboxOAuth2FlowNoRedirect,
812
)

0 commit comments

Comments
 (0)