From 2ecc2c3d3a80513ba9900fb6bb9d37a4a64c65e9 Mon Sep 17 00:00:00 2001 From: skzinc Date: Wed, 21 Mar 2018 23:21:26 +0530 Subject: [PATCH] Fix: use __all__ to avoid noqa in import --- opentracing/__init__.py | 15 +++------------ opentracing/propagation.py | 2 ++ opentracing/span.py | 2 ++ opentracing/tracer.py | 2 ++ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/opentracing/__init__.py b/opentracing/__init__.py index bc8bc26..33546ae 100644 --- a/opentracing/__init__.py +++ b/opentracing/__init__.py @@ -20,18 +20,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. from __future__ import absolute_import -from .span import Span # noqa -from .span import SpanContext # noqa -from .tracer import child_of # noqa -from .tracer import follows_from # noqa -from .tracer import Reference # noqa -from .tracer import ReferenceType # noqa -from .tracer import Tracer # noqa -from .tracer import start_child_span # noqa -from .propagation import Format # noqa -from .propagation import InvalidCarrierException # noqa -from .propagation import SpanContextCorruptedException # noqa -from .propagation import UnsupportedFormatException # noqa +from .span import * +from .tracer import * +from .propagation import * # Global variable that should be initialized to an instance of real tracer. # Note: it should be accessed via 'opentracing.tracer', not via diff --git a/opentracing/propagation.py b/opentracing/propagation.py index cb3257a..be57691 100644 --- a/opentracing/propagation.py +++ b/opentracing/propagation.py @@ -97,3 +97,5 @@ class Format(object): prefix or other convention to distinguish Tracer-specific key:value pairs. """ + +__all__ = ['Format', 'InvalidCarrierException', 'SpanContextCorruptedException', 'UnsupportedFormatException'] diff --git a/opentracing/span.py b/opentracing/span.py index b5c87e7..c448898 100644 --- a/opentracing/span.py +++ b/opentracing/span.py @@ -228,3 +228,5 @@ def log(self, **kwargs): if 'timestamp' in kwargs: timestamp = kwargs['timestamp'] return self.log_kv(key_values, timestamp) + +__all__ = ['Span', 'SpanContext'] diff --git a/opentracing/tracer.py b/opentracing/tracer.py index 57709c3..42db195 100644 --- a/opentracing/tracer.py +++ b/opentracing/tracer.py @@ -224,3 +224,5 @@ def start_child_span(parent_span, operation_name, tags=None, start_time=None): tags=tags, start_time=start_time ) + +__all__ = ['child_of', 'follows_from', 'Reference', 'ReferenceType', 'Tracer', 'start_child_span']