8000 Fix lint around operator spacing (#244) · sonlinux/client_python@8c1cddd · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c1cddd

Browse files
bz2brian-brazil
authored andcommitted
Fix lint around operator spacing (prometheus#244)
Resolves E222, E225, E226, E231, and E251.
1 parent fd334b8 commit 8c1cddd

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

prometheus_client/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
_RESERVED_METRIC_LABEL_NAME_RE = re.compile(r'^__.*$')
2929
_INF = float("inf")
3030
_MINUS_INF = float("-inf")
31-
_INITIAL_MMAP_SIZE = 1024*1024
31+
_INITIAL_MMAP_SIZE = 1 << 20
3232

3333

3434
class CollectorRegistry(object):
@@ -440,7 +440,7 @@ def __init__(self, typ, metric_name, name, labelnames, labelvalues, multiprocess
440440
def __reset(self):
441441
typ, metric_name, name, labelnames, labelvalues, multiprocess_mode = self._params
442442
if typ == 'gauge':
443-
file_prefix = typ + '_' + multiprocess_mode
443+
file_prefix = typ + '_' + multiprocess_mode
444444
else:
445445
file_prefix = typ
446446
if file_prefix not in files:

prometheus_client/exposition.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,10 @@ def _use_gateway(method, gateway, job, registry, grouping_key, timeout, handler)
290290
'/{0}/{1}'.format(quote_plus(str(k)), quote_plus(str(v)))
291291
for k, v in sorted(grouping_key.items()))
292292

293-
headers=[('Content-Type', CONTENT_TYPE_LATEST)]
294-
handler(url=url, method=method, timeout=timeout,
295-
headers=headers, data=data)()
293+
handler(
294+
url=url, method=method, timeout=timeout,
295+
headers=[('Content-Type', CONTENT_TYPE_LATEST)], data=data,
296+
)()
296297

297298

298299
def instance_ip_grouping_key():

setup.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
from setuptools import setup
33

44
setup(
5-
name = "prometheus_client",
6-
version = "0.1.0",
7-
author = "Brian Brazil",
8-
author_email = "brian.brazil@robustperception.io",
9-
description = ("Python client for the Prometheus monitoring system."),
10-
long_description = ("See https://github.com/prometheus/client_python/blob/master/README.md for documentation."),
11-
license = "Apache Software License 2.0",
12-
keywords = "prometheus monitoring instrumentation client",
13-
url = "https://github.com/prometheus/client_python",
14-
packages=['prometheus_client', 'prometheus_client.bridge', 'prometheus_client.twisted'],
5+
name="prometheus_client",
6+
version="0.1.0",
7+
author="Brian Brazil",
8+
author_email="brian.brazil@robustperception.io",
9+
description="Python client for the Prometheus monitoring system.",
10+
long_description=(
11+
"See https://github.com/prometheus/client_python/blob/master/README.md"
12+
" for documentation."),
13+
license="Apache Software License 2.0",
14+
keywords="prometheus monitoring instrumentation client",
15+
url="https://github.com/prometheus/client_python",
16+
packages=[
17+
'prometheus_client',
18+
'prometheus_client.bridge',
19+
'prometheus_client.twisted',
20+
],
1521
extras_require={
1622
'twisted': ['twisted'],
1723
},

tests/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def test_gauge_labels(self):
349349
cmf = GaugeMetricFamily('g', 'help', labels=['a'])
350350
cmf.add_metric(['b'], 2)
351351
self.custom_collector(cmf)
352-
self.assertEqual(2, self.registry.get_sample_value('g', {'a':'b'}))
352+
self.assertEqual(2, self.registry.get_sample_value('g', {'a': 'b'}))
353353

354354
def test_summary(self):
355355
self.custom_collector(SummaryMetricFamily('s', 'help', count_value=1, sum_value=2))

tests/test_graphite_bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_prefix(self):
5353
labels = Counter('labels', 'help', ['a', 'b'], registry=self.registry)
5454
labels.labels('c', 'd').inc()
5555

56-
self.gb.push(prefix = 'pre.fix')
56+
self.gb.push(prefix='pre.fix')
5757
self.t.join()
5858

5959
self.assertEqual(b'pre.fix.labels.a.c.b.d 1.0 1434898897\n', self.data)

tox.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ ignore =
6161
D,
6262
I,
6363
E123,
64-
E231,
65-
E222,
66-
E225,
67-
E226,
68-
E251,
6964
E302,
7065
E303,
7166
E305,

0 commit comments

Comments
 (0)
0