Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint unused imports in init modules #447

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
ignored-argument-names=_.*|^ignored_|^unused_

# Tells whether we should check for unused import in __init__ files.
init-import=no
init-import=yes

# List of qualified module names which can have objects that can redefine
# builtins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
import re
from typing import Sequence

from prometheus_client import start_http_server
from prometheus_client.core import (
REGISTRY,
CollectorRegistry,
CounterMetricFamily,
GaugeMetricFamily,
UnknownMetricFamily,
)

from opentelemetry.metrics import Counter, Gauge, Measure, Metric
from opentelemetry.metrics import Counter, Gauge, Measure
from opentelemetry.sdk.metrics.export import (
MetricRecord,
MetricsExporter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

"""
The opentelemetry-ext-psycopg2 package allows tracing PostgreSQL queries made by the
Psycopg2 library.
The opentelemetry-ext-psycopg2 package allows tracing PostgreSQL queries made
by the Psycopg2 library.
"""

import logging
Expand All @@ -25,7 +25,6 @@
from psycopg2.sql import Composable

from opentelemetry.ext.dbapi import DatabaseApiIntegration, TracedCursor
from opentelemetry.trace import Tracer

logger = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions opentelemetry-api/src/opentelemetry/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from pkg_resources import iter_entry_points

# pylint: disable=unused-import
from opentelemetry.context.context import Context, RuntimeContext

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional

from opentelemetry.trace import INVALID_SPAN_CONTEXT, Span, SpanContext

_SPAN_CONTEXT_KEY = "extracted-span-context"
SPAN_KEY = "current-span"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from contextlib import contextmanager

from opentelemetry import distributedcontext as dctx_api
from opentelemetry.context import Context, get_value, set_value
from opentelemetry.context import Context
from opentelemetry.distributedcontext import (
distributed_context_from_context,
with_distributed_context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import logging
from collections import OrderedDict
from typing import Dict, Sequence, Tuple, Type

from opentelemetry import metrics as metrics_api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from enum import Enum
from typing import Sequence, Tuple
from typing import Sequence


class MetricsExportResult(Enum):
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from opentelemetry import trace as trace_api
from opentelemetry.sdk import util
from opentelemetry.sdk.util import BoundedDict, BoundedList
from opentelemetry.trace import SpanContext, sampling
from opentelemetry.trace import sampling
from opentelemetry.trace.propagation import SPAN_KEY
from opentelemetry.trace.status import Status, StatusCanonicalCode
from opentelemetry.util import time_ns, types
Expand Down