Skip to content

Commit fa2487e

Browse files
authored
Apply Black and Add Black Check in CI (#212)
* Add black in .travis.yml * Apply black * Add black in .travis.yml * Apply black * Fixed testenv order in tox.ini * Fixed black command * fixed order in .travis.yml
1 parent 866b54e commit fa2487e

File tree

11 files changed

+554
-592
lines changed

11 files changed

+554
-592
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: python
22
matrix:
33
include:
4+
- env: TOXENV=black
45
- env: TOXENV=flake8
56
- env: TOXENV=py35
67
python: 3.5

docs/source/conf.py

Lines changed: 67 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -18,182 +18,177 @@
1818
# If extensions (or modules to document with autodoc) are in another directory,
1919
# add these directories to sys.path here. If the directory is relative to the
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#sys.path.insert(0, os.path.abspath('.'))
21+
# sys.path.insert(0, os.path.abspath('.'))
2222

23-
sys.path.insert(0, os.path.abspath('../../pydruid'))
24-
sys.path.insert(0, os.path.abspath('../../pydruid/pydruid'))
23+
sys.path.insert(0, os.path.abspath("../../pydruid"))
24+
sys.path.insert(0, os.path.abspath("../../pydruid/pydruid"))
2525

2626
# -- General configuration ------------------------------------------------
2727

2828
# If your documentation needs a minimal Sphinx version, state it here.
29-
#needs_sphinx = '1.0'
29+
# needs_sphinx = '1.0'
3030

3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = [
35-
'sphinx.ext.autodoc',
36-
'sphinx.ext.doctest',
37-
]
34+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"]
3835

3936
# Add any paths that contain templates here, relative to this directory.
40-
templates_path = ['_templates']
37+
templates_path = ["_templates"]
4138

4239
# The suffix of source filenames.
43-
source_suffix = '.rst'
40+
source_suffix = ".rst"
4441

4542
# The encoding of source files.
46-
#source_encoding = 'utf-8-sig'
43+
# source_encoding = 'utf-8-sig'
4744

4845
# The master toctree document.
49-
master_doc = 'index'
46+
master_doc = "index"
5047

5148
# General information about the project.
52-
project = u'PyDruid'
53-
copyright = u'2014, Deep Ganguli'
49+
project = u"PyDruid"
50+
copyright = u"2014, Deep Ganguli"
5451

5552
# The version info for the project you're documenting, acts as replacement for
5653
# |version| and |release|, also used in various other places throughout the
5754
# built documents.
5855
#
5956
# The short X.Y version.
60-
version = '0.2.0'
57+
version = "0.2.0"
6158
# The full version, including alpha/beta/rc tags.
62-
release = '0.2.0'
59+
release = "0.2.0"
6360

6461
# The language for content autogenerated by Sphinx. Refer to documentation
6562
# for a list of supported languages.
66-
#language = None
63+
# language = None
6764

6865
# There are two options for replacing |today|: either, you set today to some
6966
# non-false value, then it is used:
70-
#today = ''
67+
# today = ''
7168
# Else, today_fmt is used as the format for a strftime call.
72-
#today_fmt = '%B %d, %Y'
69+
# today_fmt = '%B %d, %Y'
7370

7471
# List of patterns, relative to source directory, that match files and
7572
# directories to ignore when looking for source files.
7673
exclude_patterns = []
7774

7875
# The reST default role (used for this markup: `text`) to use for all
7976
# documents.
80-
#default_role = None
77+
# default_role = None
8178

8279
# If true, '()' will be appended to :func: etc. cross-reference text.
83-
#add_function_parentheses = True
80+
# add_function_parentheses = True
8481

8582
# If true, the current module name will be prepended to all description
8683
# unit titles (such as .. function::).
87-
#add_module_names = True
84+
# add_module_names = True
8885

8986
# If true, sectionauthor and moduleauthor directives will be shown in the
9087
# output. They are ignored by default.
91-
#show_authors = False
88+
# show_authors = False
9289

9390
# The name of the Pygments (syntax highlighting) style to use.
94-
pygments_style = 'sphinx'
91+
pygments_style = "sphinx"
9592

9693
# A list of ignored prefixes for module index sorting.
97-
#modindex_common_prefix = []
94+
# modindex_common_prefix = []
9895

9996
# If true, keep warnings as "system message" paragraphs in the built documents.
100-
#keep_warnings = False
97+
# keep_warnings = False
10198

10299

103100
# -- Options for HTML output ----------------------------------------------
104101

105102
# The theme to use for HTML and HTML Help pages. See the documentation for
106103
# a list of builtin themes.
107-
html_theme = 'default'
104+
html_theme = "default"
108105

109106
# Theme options are theme-specific and customize the look and feel of a theme
110107
# further. For a list of options available for each theme, see the
111108
# documentation.
112-
#html_theme_options = {}
109+
# html_theme_options = {}
113110

114111
# Add any paths that contain custom themes here, relative to this directory.
115-
#html_theme_path = []
112+
# html_theme_path = []
116113

117114
# The name for this set of Sphinx documents. If None, it defaults to
118115
# "<project> v<release> documentation".
119-
#html_title = None
116+
# html_title = None
120117

121118
# A shorter title for the navigation bar. Default is the same as html_title.
122-
#html_short_title = None
119+
# html_short_title = None
123120

124121
# The name of an image file (relative to this directory) to place at the top
125122
# of the sidebar.
126-
#html_logo = None
123+
# html_logo = None
127124

128125
# The name of an image file (within the static path) to use as favicon of the
129126
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
130127
# pixels large.
131-
#html_favicon = None
128+
# html_favicon = None
132129

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

138135
# Add any extra paths that contain custom files (such as robots.txt or
139136
# .htaccess) here, relative to this directory. These files are copied
140137
# directly to the root of the documentation.
141-
#html_extra_path = []
138+
# html_extra_path = []
142139

143140
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
144141
# using the given strftime format.
145-
#html_last_updated_fmt = '%b %d, %Y'
142+
# html_last_updated_fmt = '%b %d, %Y'
146143

147144
# If true, SmartyPants will be used to convert quotes and dashes to
148145
# typographically correct entities.
149-
#html_use_smartypants = True
146+
# html_use_smartypants = True
150147

151148
# Custom sidebar templates, maps document names to template names.
152-
#html_sidebars = {}
149+
# html_sidebars = {}
153150

154151
# Additional templates that should be rendered to pages, maps page names to
155152
# template names.
156-
#html_additional_pages = {}
153+
# html_additional_pages = {}
157154

158155
# If false, no module index is generated.
159-
#html_domain_indices = True
156+
# html_domain_indices = True
160157

161158
# If false, no index is generated.
162-
#html_use_index = True
159+
# html_use_index = True
163160

164161
# If true, the index is split into individual pages for each letter.
165-
#html_split_index = False
162+
# html_split_index = False
166163

167164
# If true, links to the reST sources are added to the pages.
168-
#html_show_sourcelink = True
165+
# html_show_sourcelink = True
169166

170167
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
171-
#html_show_sphinx = True
168+
# html_show_sphinx = True
172169

173170
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
174-
#html_show_copyright = True
171+
# html_show_copyright = True
175172

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

181178
# This is the file name suffix for HTML files (e.g. ".xhtml").
182-
#html_file_suffix = None
179+
# html_file_suffix = None
183180

184181
# Output file base name for HTML help builder.
185-
htmlhelp_basename = 'PyDruiddoc'
182+
htmlhelp_basename = "PyDruiddoc"
186183

187184

188185
# -- Options for LaTeX output ---------------------------------------------
189186

190187
latex_elements = {
191188
# The paper size ('letterpaper' or 'a4paper').
192189
#'papersize': 'letterpaper',
193-
194190
# The font size ('10pt', '11pt' or '12pt').
195191
#'pointsize': '10pt',
196-
197192
# Additional stuff for the LaTeX preamble.
198193
#'preamble': '',
199194
}
@@ -202,42 +197,38 @@
202197
# (source start file, target name, title,
203198
# author, documentclass [howto, manual, or own class]).
204199
latex_documents = [
205-
('index', 'PyDruid.tex', u'PyDruid Documentation',
206-
u'Deep Ganguli', 'manual'),
200+
("index", "PyDruid.tex", u"PyDruid Documentation", u"Deep Ganguli", "manual")
207201
]
208202

209203
# The name of an image file (relative to this directory) to place at the top of
210204
# the title page.
211-
#latex_logo = None
205+
# latex_logo = None
212206

213207
# For "manual" documents, if this is true, then toplevel headings are parts,
214208
# not chapters.
215-
#latex_use_parts = False
209+
# latex_use_parts = False
216210

217211
# If true, show page references after internal links.
218-
#latex_show_pagerefs = False
212+
# latex_show_pagerefs = False
219213

220214
# If true, show URL addresses after external links.
221-
#latex_show_urls = False
215+
# latex_show_urls = False
222216

223217
# Documents to append as an appendix to all manuals.
224-
#latex_appendices = []
218+
# latex_appendices = []
225219

226220
# If false, no module index is generated.
227-
#latex_domain_indices = True
221+
# latex_domain_indices = True
228222

229223

230224
# -- Options for manual page output ---------------------------------------
231225

232226
# One entry per manual page. List of tuples
233227
# (source start file, name, description, authors, manual section).
234-
man_pages = [
235-
('index', 'pydruid', u'PyDruid Documentation',
236-
[u'Deep Ganguli'], 1)
237-
]
228+
man_pages = [("index", "pydruid", u"PyDruid Documentation", [u"Deep Ganguli"], 1)]
238229

239230
# If true, show URL addresses after external links.
240-
#man_show_urls = False
231+
# man_show_urls = False
241232

242233

243234
# -- Options for Texinfo output -------------------------------------------
@@ -246,19 +237,25 @@
246237
# (source start file, target name, title, author,
247238
# dir menu entry, description, category)
248239
texinfo_documents = [
249-
('index', 'PyDruid', u'PyDruid Documentation',
250-
u'Deep Ganguli', 'PyDruid', 'One line description of project.',
251-
'Miscellaneous'),
240+
(
241+
"index",
242+
"PyDruid",
243+
u"PyDruid Documentation",
244+
u"Deep Ganguli",
245+
"PyDruid",
246+
"One line description of project.",
247+
"Miscellaneous",
248+
)
252249
]
253250

254251
# Documents to append as an appendix to all manuals.
255-
#texinfo_appendices = []
252+
# texinfo_appendices = []
256253

257254
# If false, no module index is generated.
258-
#texinfo_domain_indices = True
255+
# texinfo_domain_indices = True
259256

260257
# How to display URL addresses: 'footnote', 'no', or 'inline'.
261-
#texinfo_show_urls = 'footnote'
258+
# texinfo_show_urls = 'footnote'
262259

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

pydruid/query.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ def parse_datasource(datasource, query_type):
243243
isinstance(datasource, list)
244244
and all([isinstance(x, six.string_types) for x in datasource])
245245
)
246-
or
247-
isinstance(datasource, dict)
246+
or isinstance(datasource, dict)
248247
):
249248
raise ValueError(
250249
"Datasource definition not valid. Must be string or "
@@ -516,7 +515,7 @@ def scan(self, args):
516515
"metrics",
517516
"intervals",
518517
"limit",
519-
"order"
518+
"order",
520519
]
521520
self.validate_query(query_type, valid_parts, args)
522521
return self.build_query(query_type, args)

0 commit comments

Comments
 (0)