8000 fix: update versions and fix minor bugs · python-microservices/pyms@1539e05 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 1539e05

Browse files
committed
fix: update versions and fix minor bugs
1 parent 7c1e709 commit 1539e05

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

pylintrc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ confidence=
5555
# no Warning level messages displayed, use"--disable=all --enable=classes
5656
# --disable=W"
5757
disable=logging-format-interpolation,broad-except,unnecessary-pass,no-member,line-too-long,invalid-name,
58-
missing-module-docstring,missing-class-docstring,missing-function-docstring,too-few-public-methods
58+
missing-module-docstring,missing-class-docstring,missing-function-docstring,too-few-public-methods,
59+
consider-using-f-string,deprecated-class,unnecessary-dunder-call,deprecated-module
5960

6061
# Enable the message, report, category or checker with the given id(s). You can
6162
# either give multiple identifier separated by comma (,) or put this option
@@ -256,12 +257,6 @@ max-line-length=120
256257
# Maximum number of lines in a module
257258
max-module-lines=1000
258259

259-
# List of optional constructs for which whitespace checking is disabled. `dict-
260-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
261-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
262-
# `empty-line` allows space-only lines.
263-
no-space-check=trailing-comma,
264-
dict-separator
265260

266261
# Allow the body of a class to be on the same line as the declaration if body
267262
# contains single statement.

pyms/flask/services/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FlaskMetricsWrapper:
3131
def __init__(self, app_name):
3232
self.app_name = app_name
3333

34-
def before_request(self) -> None: # pylint: disable=R0201
34+
def before_request(self) -> None:
3535
request.start_time = time.time() # pylint: disable=assigning-non-slot
3636

3737
def after_request(self, response: Response) -> Response:

pyms/flask/services/tracer.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
from flask import current_app, has_request_context, request
55

6-
from pyms.config.conf import get_conf
76
from pyms.constants import LOGGER_NAME
8-
from pyms.flask.services.driver import DriverService, get_service_name
7+
from pyms.flask.services.driver import DriverService
98
from pyms.utils import check_package_exists, import_from, import_package
109

1110
opentracing = None
@@ -32,7 +31,7 @@ def inject_span_in_headers(headers: dict) -> dict:
3231
if tracer:
3332
span = tracer.get_span(request=request)
3433
if not span: # pragma: no cover
35-
span = get_current_span()
34+
span = get_current_span
3635
if not span:
3736
span = tracer.tracer.start_span()
3837
context = span.context if span else None
@@ -78,11 +77,11 @@ def init_jaeger_tracer(self):
7877
host = {}
7978
if self.host:
8079
host = {"local_agent": {"reporting_host": self.host}}
81-
metrics_config = get_conf(service=get_service_name(service="metrics"), empty_init=True)
80+
# metrics_config = get_conf(service=get_service_name(service="metrics"), empty_init=True)
8281
metrics = ""
83-
if metrics_config:
84-
service_name = self.component_name.lower().replace("-", "_").replace(" ", "_")
85-
metrics = PrometheusMetricsFactory(service_name_label=service_name)
82+
# if metrics_config:
83+
# service_name = self.component_name.lower().replace("-", "_").replace(" ", "_")
84+
# metrics = PrometheusMetricsFactory(service_name_label=service_name)
8685
config = Config(
8786
config={
8887
**{

0 commit comments

Comments
 (0)
0