Skip to content

Commit 56b75e8

Browse files
author
thoth-zuul[bot]
authored
Merge pull request #50 from harshad16/coala-fixes
py linting and coala fixes Reviewed-by: https://github.com/thoth-zuul[bot]
2 parents 13b8ece + 4e1aeaa commit 56b75e8

File tree

5 files changed

+188
-130
lines changed

5 files changed

+188
-130
lines changed

.zuul.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
check:
33
jobs:
44
- "thoth-coala"
5-
- "thoth-pytest"
5+
- "thoth-pytest"
66
gate:
77
queue: "aicoe/prometheus"
88
jobs:
99
- "thoth-coala"
10-
- "thoth-pytest"
10+
- "thoth-pytest"
1111
kebechet-auto-gate:
1212
queue: "aicoe/prometheus"
1313
jobs:
1414
- "thoth-coala"
15-
- "thoth-pytest"
15+
- "thoth-pytest"

app.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
"""Simple example application."""
12
# Example Usage
23
import prometheus_connect
3-
url="www.example-prom-url.com"
4-
token='Auth_token'
4+
5+
url = "www.example-prom-url.com"
6+
token = "Auth_token"
57

68
prom = prometheus_connect.PrometheusConnect(url=url, token=token)
79

8-
labels = {'pod':'prometheus-k8s-0', '_id': 'f716a8c8-5d4e-417a-a95c-742c2bbcd3d2'}
9-
metric_data = (prom.get_metric_range_data(metric_name='up', start_time='20m', label_config=labels, chunk_size='10m', store_locally=True))
10+
labels = {"pod": "prometheus-k8s-0", "_id": "f716a8c8-5d4e-417a-a95c-742c2bbcd3d2"}
11+
metric_data = prom.get_metric_range_data(
12+
metric_name="up",
13+
start_time="20m",
14+
label_config=labels,
15+
chunk_size="10m",
16+
store_locally=True,
17+
)
1018

1119
prom.pretty_print_metric(metric_data)

docs/conf.py

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@
1111
# If extensions (or modules to document with autodoc) are in another directory,
1212
# add these directories to sys.path here. If the directory is relative to the
1313
# documentation root, use os.path.abspath to make it absolute, like shown here.
14-
#
14+
"""Configuration file for the Sphinx documentation builder."""
1515
import os
1616
import sys
17-
sys.path.insert(0, os.path.abspath('.'))
18-
sys.path.insert(0, os.path.abspath('../'))
17+
18+
sys.path.insert(0, os.path.abspath("."))
19+
sys.path.insert(0, os.path.abspath("../"))
1920

2021

2122
# -- Project information -----------------------------------------------------
2223

23-
project = 'Prometheus Client API Python'
24-
copyright = '2019, Anand Sanmukhani'
25-
author = 'Anand Sanmukhani'
24+
project = "Prometheus Client API Python"
25+
copyright = "2019, Anand Sanmukhani"
26+
author = "Anand Sanmukhani"
2627

2728
# The short X.Y version
28-
version = ''
29+
version = ""
2930
# The full version, including alpha/beta/rc tags
30-
release = '0.0.1'
31+
release = "0.0.1"
3132

3233

3334
# -- General configuration ---------------------------------------------------
@@ -40,26 +41,26 @@
4041
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4142
# ones.
4243
extensions = [
43-
'sphinx.ext.autodoc',
44-
'sphinx.ext.doctest',
45-
'sphinx.ext.intersphinx',
46-
'sphinx.ext.todo',
47-
'sphinx.ext.coverage',
48-
'sphinx.ext.viewcode',
49-
'sphinx.ext.githubpages',
44+
"sphinx.ext.autodoc",
45+
"sphinx.ext.doctest",
46+
"sphinx.ext.intersphinx",
47+
"sphinx.ext.todo",
48+
"sphinx.ext.coverage",
49+
"sphinx.ext.viewcode",
50+
"sphinx.ext.githubpages",
5051
]
5152

5253
# Add any paths that contain templates here, relative to this directory.
53-
templates_path = ['_templates']
54+
templates_path = ["_templates"]
5455

5556
# The suffix(es) of source filenames.
5657
# You can specify multiple suffix as a list of string:
5758
#
5859
# source_suffix = ['.rst', '.md']
59-
source_suffix = '.rst'
60+
source_suffix = ".rst"
6061

6162
# The master toctree document.
62-
master_doc = 'index'
63+
master_doc = "index"
6364

6465
# The language for content autogenerated by Sphinx. Refer to documentation
6566
# for a list of supported languages.
@@ -71,7 +72,7 @@
7172
# List of patterns, relative to source directory, that match files and
7273
# directories to ignore when looking for source files.
7374
# This pattern also affects html_static_path and html_extra_path.
74-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
75+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7576

7677
# The name of the Pygments (syntax highlighting) style to use.
7778
pygments_style = None
@@ -82,7 +83,7 @@
8283
# The theme to use for HTML and HTML Help pages. See the documentation for
8384
# a list of builtin themes.
8485
#
85-
html_theme = 'sphinx_rtd_theme'
86+
html_theme = "sphinx_rtd_theme"
8687

8788
# Theme options are theme-specific and customize the look and feel of a theme
8889
# further. For a list of options available for each theme, see the
@@ -93,7 +94,7 @@
9394
# Add any paths that contain custom static files (such as style sheets) here,
9495
# relative to this directory. They are copied after the builtin static files,
9596
# so a file named "default.css" will overwrite the builtin "default.css".
96-
html_static_path = ['_static']
97+
html_static_path = ["_static"]
9798

9899
# Custom sidebar templates, must be a dictionary that maps document names
99100
# to template names.
@@ -109,7 +110,7 @@
109110
# -- Options for HTMLHelp output ---------------------------------------------
110111

111112
# Output file base name for HTML help builder.
112-
htmlhelp_basename = 'PrometheusClientAPIPythondoc'
113+
htmlhelp_basename = "PrometheusClientAPIPythondoc"
113114

114115

115116
# -- Options for LaTeX output ------------------------------------------------
@@ -118,15 +119,12 @@
118119
# The paper size ('letterpaper' or 'a4paper').
119120
#
120121
# 'papersize': 'letterpaper',
121-
122122
# The font size ('10pt', '11pt' or '12pt').
123123
#
124124
# 'pointsize': '10pt',
125-
126125
# Additional stuff for the LaTeX preamble.
127126
#
128127
# 'preamble': '',
129-
130128
# Latex figure (float) alignment
131129
#
132130
# 'figure_align': 'htbp',
@@ -136,8 +134,13 @@
136134
# (source start file, target name, title,
137135
# author, documentclass [howto, manual, or own class]).
138136
latex_documents = [
139-
(master_doc, 'PrometheusClientAPIPython.tex', 'Prometheus Client API Python Documentation',
140-
'Anand Sanmukhani', 'manual'),
137+
(
138+
master_doc,
139+
"PrometheusClientAPIPython.tex",
140+
"Prometheus Client API Python Documentation",
141+
"Anand Sanmukhani",
142+
"manual",
143+
)
141144
]
142145

143146

@@ -146,8 +149,13 @@
146149
# One entry per manual page. List of tuples
147150
# (source start file, name, description, authors, manual section).
148151
man_pages = [
149-
(master_doc, 'prometheusclientapipython', 'Prometheus Client API Python Documentation',
150-
[author], 1)
152+
(
153+
master_doc,
154+
"prometheusclientapipython",
155+
"Prometheus Client API Python Documentation",
156+
[author],
157+
1,
158+
)
151159
]
152160

153161

@@ -157,9 +165,15 @@
157165
# (source start file, target name, title, author,
158166
# dir menu entry, description, category)
159167
texinfo_documents = [
160-
(master_doc, 'PrometheusClientAPIPython', 'Prometheus Client API Python Documentation',
161-
author, 'PrometheusClientAPIPython', 'One line description of project.',
162-
'Miscellaneous'),
168+
(
169+
master_doc,
170+
"PrometheusClientAPIPython",
171+
"Prometheus Client API Python Documentation",
172+
author,
173+
"PrometheusClientAPIPython",
174+
"One line description of project.",
175+
"Miscellaneous",
176+
)
163177
]
164178

165179

@@ -178,15 +192,15 @@
178192
# epub_uid = ''
179193

180194
# A list of files that should not be packed into the epub file.
181-
epub_exclude_files = ['search.html']
195+
epub_exclude_files = ["search.html"]
182196

183197

184198
# -- Extension configuration -------------------------------------------------
185199

186200
# -- Options for intersphinx extension ---------------------------------------
187201

188202
# Example configuration for intersphinx: refer to the Python standard library.
189-
intersphinx_mapping = {'https://docs.python.org/': None}
203+
intersphinx_mapping = {"https://docs.python.org/": None}
190204

191205
# -- Options for todo extension ----------------------------------------------
192206

prometheus_api_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" A Class for collection of metrics from a Prometheus Host """
1+
"""A Class for collection of metrics from a Prometheus Host."""
22

33
__title__ = "prometheus-connect"
44
__version__ = "0.0.1"

0 commit comments

Comments
 (0)