Skip to content

Commit a5050a2

Browse files
committed
Use black
1 parent 175535b commit a5050a2

Some content is hidden

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

51 files changed

+1267
-1042
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
extend-ignore = E203, E266, E501
3+
# line length is intentionally set to 80 here because black uses Bugbear
4+
# See https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length for more details
5+
max-line-length = 80

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ recursive-include doc *.py *.rst *.svg
55
include doc/source/_templates/piwik.html
66
include doc/Makefile
77
include tox.ini
8+
include .flake8
89
include Makefile
910
include README.rst CONTRIBUTING.rst CHANGELOG.rst
1011
include MANIFEST.in

doc/source/conf.py

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# If extensions (or modules to document with autodoc) are in another directory,
3333
# add these directories to sys.path here. If the directory is relative to the
3434
# documentation root, use os.path.abspath to make it absolute, like shown here.
35-
sys.path.insert(0, os.path.abspath('../..'))
35+
sys.path.insert(0, os.path.abspath("../.."))
3636

3737
# -- General configuration ------------------------------------------------
3838

@@ -43,36 +43,40 @@
4343
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4444
# ones.
4545
extensions = [
46-
'sphinx.ext.autodoc',
47-
'alabaster',
46+
"sphinx.ext.autodoc",
47+
"alabaster",
4848
]
4949
autodoc_member_order = "bysource"
5050

5151
# Add any paths that contain templates here, relative to this directory.
52-
templates_path = ['_templates']
52+
templates_path = ["_templates"]
5353

5454
# The suffix of source filenames.
55-
source_suffix = '.rst'
55+
source_suffix = ".rst"
5656

5757
# The encoding of source files.
5858
# source_encoding = 'utf-8-sig'
5959

6060
# The master toctree document.
61-
master_doc = 'index'
61+
master_doc = "index"
6262

6363
# General information about the project.
64-
project = u'testinfra'
65-
copyright = u'{}, Philippe Pepiot'.format(datetime.date.today().year)
64+
project = u"testinfra"
65+
copyright = u"{}, Philippe Pepiot".format(datetime.date.today().year)
6666

6767
# The version info for the project you're documenting, acts as replacement for
6868
# |version| and |release|, also used in various other places throughout the
6969
# built documents.
7070
#
7171
# The short X.Y version.
72-
version = subprocess.check_output(
73-
['python3', 'setup.py', '--version'],
74-
cwd=os.path.join(os.path.dirname(__file__), os.pardir, os.pardir),
75-
).decode().strip()
72+
version = (
73+
subprocess.check_output(
74+
["python3", "setup.py", "--version"],
75+
cwd=os.path.join(os.path.dirname(__file__), os.pardir, os.pardir),
76+
)
77+
.decode()
78+
.strip()
79+
)
7680
# The full version, including alpha/beta/rc tags.
7781
release = version
7882

@@ -106,7 +110,7 @@
106110
# show_authors = False
107111

108112
# The name of the Pygments (syntax highlighting) style to use.
109-
pygments_style = 'sphinx'
113+
pygments_style = "sphinx"
110114

111115
# A list of ignored prefixes for module index sorting.
112116
# modindex_common_prefix = []
@@ -119,19 +123,19 @@
119123

120124
# The theme to use for HTML and HTML Help pages. See the documentation for
121125
# a list of builtin themes.
122-
html_theme = 'alabaster'
126+
html_theme = "alabaster"
123127

124128
# Theme options are theme-specific and customize the look and feel of a theme
125129
# further. For a list of options available for each theme, see the
126130
# documentation.
127131
html_theme_options = {
128-
'logo': 'logo.svg',
129-
'github_user': 'pytest-dev',
130-
'github_repo': 'pytest-testinfra',
131-
'github_button': True,
132-
'travis_button': True,
133-
'extra_nav_links': {
134-
'View on github': 'https://github.com/pytest-dev/pytest-testinfra',
132+
"logo": "logo.svg",
133+
"github_user": "pytest-dev",
134+
"github_repo": "pytest-testinfra",
135+
"github_button": True,
136+
"travis_button": True,
137+
"extra_nav_links": {
138+
"View on github": "https://github.com/pytest-dev/pytest-testinfra",
135139
},
136140
}
137141

@@ -157,7 +161,7 @@
157161
# Add any paths that contain custom static files (such as style sheets) here,
158162
# relative to this directory. They are copied after the builtin static files,
159163
# so a file named "default.css" will overwrite the builtin "default.css".
160-
html_static_path = ['_static']
164+
html_static_path = ["_static"]
161165

162166
# Add any extra paths that contain custom files (such as robots.txt or
163167
# .htaccess) here, relative to this directory. These files are copied
@@ -174,11 +178,11 @@
174178

175179
# Custom sidebar templates, maps document names to template names.
176180
html_sidebars = {
177-
'**': [
178-
'about.html',
179-
'navigation.html',
180-
'searchbox.html',
181-
'piwik.html',
181+
"**": [
182+
"about.html",
183+
"navigation.html",
184+
"searchbox.html",
185+
"piwik.html",
182186
],
183187
}
184188

@@ -213,28 +217,25 @@
213217
# html_file_suffix = None
214218

215219
# Output file base name for HTML help builder.
216-
htmlhelp_basename = 'testinfradoc'
220+
htmlhelp_basename = "testinfradoc"
217221

218222

219223
# -- Options for LaTeX output ---------------------------------------------
220224

221225
latex_elements = {
222226
# The paper size ('letterpaper' or 'a4paper')
223227
# 'papersize': 'letterpaper',
224-
225228
# The font size ('10pt', '11pt' or '12pt').
226229
# 'pointsize': '10pt',
227-
228230
# Additional stuff for the LaTeX preamble.
229231
# 'preamble': '',
230232
}
231233

232234
# Grouping the document tree into LaTeX files. List of tuples
233235
# (source start file, target name, title,
234236
# author, documentclass [howto, manual, or own class]).
235-
latex_documents = [(
236-
'index', 'testinfra.tex', 'testinfra Documentation',
237-
'Philippe Pepiot', 'manual'),
237+
latex_documents = [
238+
("index", "testinfra.tex", "testinfra Documentation", "Philippe Pepiot", "manual"),
238239
]
239240

240241
# The name of an image file (relative to this directory) to place at the top of
@@ -262,10 +263,7 @@
262263

263264
# One entry per manual page. List of tuples
264265
# (source start file, name, description, authors, manual section).
265-
man_pages = [
266-
('index', 'testinfra', 'testinfra Documentation',
267-
['Philippe Pepiot'], 1)
268-
]
266+
man_pages = [("index", "testinfra", "testinfra Documentation", ["Philippe Pepiot"], 1)]
269267

270268
# If true, show URL addresses after external links.
271269
# man_show_urls = False
@@ -276,10 +274,16 @@
276274
# Grouping the document tree into Texinfo files. List of tuples
277275
# (source start file, target name, title, author,
278276
# dir menu entry, description, category)
279-
texinfo_documents = [(
280-
'index', 'testinfra', 'testinfra Documentation',
281-
'Philippe Pepiot', 'testinfra', 'One line description of project.',
282-
'Miscellaneous'),
277+
texinfo_documents = [
278+
(
279+
"index",
280+
"testinfra",
281+
"testinfra Documentation",
282+
"Philippe Pepiot",
283+
"testinfra",
284+
"One line description of project.",
285+
"Miscellaneous",
286+
),
283287
]
284288

285289
# Documents to append as an appendix to all manuals.

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def local_scheme(version):
2020
import setuptools_scm.version # only present during setup time
2121

2222
return (
23-
''
24-
if 'PEP440_VERSION' in os.environ
23+
""
24+
if "PEP440_VERSION" in os.environ
2525
else setuptools_scm.version.get_local_node_and_date(version)
2626
)
2727

2828

29-
if __name__ == '__main__':
29+
if __name__ == "__main__":
3030
setuptools.setup(
31-
use_scm_version={'local_scheme': local_scheme},
31+
use_scm_version={"local_scheme": local_scheme},
3232
setup_requires=["setuptools_scm"],
3333
)

0 commit comments

Comments
 (0)