Skip to content

Commit ee82a5c

Browse files
committed
chore: update py version in lint workflow to 3.13
This upgrade was delayed due to an issue where pylint was unable to import collections.abc Update references to 3.13 now that the underlying issue has been resolved. Add pylint disable comments for existing violations
1 parent 5381509 commit ee82a5c

File tree

24 files changed

+46
-46
lines changed

24 files changed

+46
-46
lines changed

.github/workflows/templates/lint.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
2525
uses: actions/checkout@v4
2626

27-
- name: Set up Python 3.12
27+
- name: Set up Python 3.13
2828
uses: actions/setup-python@v5
2929
with:
30-
python-version: "3.12"
30+
python-version: "3.13"
3131

3232
- name: Install tox
3333
run: pip install tox

exporter/opentelemetry-exporter-zipkin-json/src/opentelemetry/exporter/zipkin/json/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898

9999
class ZipkinExporter(SpanExporter):
100-
def __init__(
100+
def __init__( # pylint: disable=too-many-arguments
101101
self,
102102
version: Protocol = Protocol.V2,
103103
endpoint: Optional[str] = None,

opentelemetry-api/src/opentelemetry/_events/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232

3333
class Event(LogRecord):
34-
def __init__(
34+
def __init__( # pylint: disable=too-many-arguments
3535
self,
3636
name: str,
3737
timestamp: Optional[int] = None,

opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class LogRecord(ABC):
5757
pertinent to the event being logged.
5858
"""
5959

60-
def __init__(
60+
def __init__( # pylint: disable=too-many-arguments
6161
self,
6262
timestamp: Optional[int] = None,
6363
observed_timestamp: Optional[int] = None,

opentelemetry-api/src/opentelemetry/metrics/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def schema_url(self) -> Optional[str]:
232232
"""
233233
return self._schema_url
234234

235-
def _register_instrument(
235+
def _register_instrument( # pylint: disable=too-many-arguments
236236
self,
237237
name: str,
238238
type_: type,

opentelemetry-api/src/opentelemetry/trace/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class Tracer(ABC):
283283
"""
284284

285285
@abstractmethod
286-
def start_span(
286+
def start_span( # pylint: disable=too-many-arguments
287287
self,
288288
name: str,
289289
context: Optional[Context] = None,
@@ -338,7 +338,7 @@ def start_span(
338338

339339
@_agnosticcontextmanager
340340
@abstractmethod
341-
def start_as_current_span(
341+
def start_as_current_span( # pylint: disable=too-many-arguments
342342
self,
343343
name: str,
344344
context: Optional[Context] = None,
@@ -458,7 +458,7 @@ class NoOpTracer(Tracer):
458458
All operations are no-op.
459459
"""
460460

461-
def start_span(
461+
def start_span( # pylint: disable=too-many-arguments
462462
self,
463463
name: str,
464464
context: Optional[Context] = None,
@@ -473,7 +473,7 @@ def start_span(
473473
return INVALID_SPAN
474474

475475
@_agnosticcontextmanager
476-
def start_as_current_span(
476+
def start_as_current_span( # pylint: disable=too-many-arguments
477477
self,
478478
name: str,
479479
context: Optional[Context] = None,

opentelemetry-api/src/opentelemetry/trace/span.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class SpanContext(
438438
trace_state: Tracing-system-specific info to propagate.
439439
"""
440440

441-
def __new__(
441+
def __new__( # pylint: disable=too-many-arguments
442442
cls,
443443
trace_id: int,
444444
span_id: int,

opentelemetry-api/tests/propagators/test_propagators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def traceparent_helper(
134134

135135
return context
136136

137-
def traceparent_helper_generator(
137+
def traceparent_helper_generator( # pylint: disable=too-many-arguments
138138
self,
139139
version=0x00,
140140
trace_id=0x00000000000000000000000000000001,
@@ -146,7 +146,7 @@ def traceparent_helper_generator(
146146
carrier = {"traceparent": traceparent}
147147
return self.traceparent_helper(carrier)
148148

149-
def valid_traceparent_helper(
149+
def valid_traceparent_helper( # pylint: disable=too-many-arguments
150150
self,
151151
version=0x00,
152152
trace_id=0x00000000000000000000000000000001,
@@ -188,7 +188,7 @@ def valid_traceparent_helper(
188188

189189
return context, span, span_context
190190

191-
def invalid_traceparent_helper(
191+
def invalid_traceparent_helper( # pylint: disable=too-many-arguments
192192
self,
193193
version=0x00,
194194
trace_id=0x00000000000000000000000000000001,

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def _import_id_generator(id_generator_name: str) -> IdGenerator:
359359
raise RuntimeError(f"{id_generator_name} is not an IdGenerator")
360360

361361

362-
def _initialize_components(
362+
def _initialize_components( # pylint: disable=too-many-arguments
363363
auto_instrumentation_version: Optional[str] = None,
364364
trace_exporter_names: Optional[List[str]] = None,
365365
metric_exporter_names: Optional[List[str]] = None,

opentelemetry-sdk/src/opentelemetry/sdk/_events/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
class EventLogger(APIEventLogger):
30-
def __init__(
30+
def __init__( # pylint: disable=too-many-arguments
3131
self,
3232
logger_provider: LoggerProvider,
3333
name: str,

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class LogRecord(APILogRecord):
170170
pertinent to the event being logged.
171171
"""
172172

173-
def __init__(
173+
def __init__( # pylint: disable=too-many-arguments
174174
self,
175175
timestamp: Optional[int] = None,
176176
observed_timestamp: Optional[int] = None,

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/export/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class BatchLogRecordProcessor(LogRecordProcessor):
168168
_flush_request: Optional[_FlushRequest]
169169
_log_records: List[Optional[LogData]]
170170

171-
def __init__(
171+
def __init__( # pylint: disable=too-many-arguments
172172
self,
173173
exporter: LogExporter,
174174
schedule_delay_millis: float = None,

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class MeterProvider(APIMeterProvider):
409409
_all_metric_readers_lock = Lock()
410410
_all_metric_readers = weakref.WeakSet()
411411

412-
def __init__(
412+
def __init__( # pylint: disable=too-many-arguments
413413
self,
414414
metric_readers: Sequence[
415415
"opentelemetry.sdk.metrics.export.MetricReader"

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def collect(
163163

164164

165165
class _SumAggregation(_Aggregation[Sum]):
166-
def __init__(
166+
def __init__( # pylint: disable=too-many-arguments
167167
self,
168168
attributes: Attributes,
169169
instrument_is_monotonic: bool,
@@ -465,7 +465,7 @@ def collect(
465465

466466

467467
class _ExplicitBucketHistogramAggregation(_Aggregation[HistogramPoint]):
468-
def __init__(
468+
def __init__( # pylint: disable=too-many-arguments
469469
self,
470470
attributes: Attributes,
471471
instrument_aggregation_temporality: AggregationTemporality,
@@ -625,7 +625,7 @@ class _ExponentialBucketHistogramAggregation(_Aggregation[HistogramPoint]):
625625
# giant exponential bucket histograms.
626626
_max_max_size = 16384
627627

628-
def __init__(
628+
def __init__( # pylint: disable=too-many-arguments
629629
self,
630630
attributes: Attributes,
631631
reservoir_builder: ExemplarReservoirBuilder,
@@ -1129,7 +1129,7 @@ def _downscale(change: int, positive, negative):
11291129
positive.downscale(change)
11301130
negative.downscale(change)
11311131

1132-
def _merge(
1132+
def _merge( # pylint: disable=too-many-arguments
11331133
self,
11341134
previous_buckets: Buckets,
11351135
current_buckets: Buckets,

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848

4949
class _Synchronous:
50-
def __init__(
50+
def __init__( # pylint: disable=too-many-arguments
5151
self,
5252
name: str,
5353
instrumentation_scope: InstrumentationScope,
@@ -79,7 +79,7 @@ def __init__(
7979

8080

8181
class _Asynchronous:
82-
def __init__(
82+
def __init__( # pylint: disable=too-many-arguments
8383
self,
8484
name: str,
8585
instrumentation_scope: InstrumentationScope,
@@ -222,7 +222,7 @@ def __new__(cls, *args, **kwargs):
222222

223223

224224
class Histogram(_Synchronous, APIHistogram):
225-
def __init__(
225+
def __init__( # pylint: disable=too-many-arguments
226226
self,
227227
name: str,
228228
instrumentation_scope: InstrumentationScope,

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class View:
103103

104104
_default_aggregation = DefaultAggregation()
105105

106-
def __init__(
106+
def __init__( # pylint: disable=too-many-arguments
107107
self,
108108
instrument_type: Optional[Type[Instrument]] = None,
109109
instrument_name: Optional[str] = None,

opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class ReadableSpan:
374374
375375
"""
376376

377-
def __init__(
377+
def __init__( # pylint: disable=too-many-arguments
378378
self,
379379
name: str,
380380
context: Optional[trace_api.SpanContext] = None,
@@ -609,7 +609,7 @@ class SpanLimits:
609609

610610
UNSET = -1
611611

612-
def __init__(
612+
def __init__( # pylint: disable=too-many-arguments
613613
self,
614614
max_attributes: Optional[int] = None,
615615
max_events: Optional[int] = None,
@@ -761,7 +761,7 @@ def __new__(cls, *args, **kwargs):
761761
return super().__new__(cls)
762762

763763
# pylint: disable=too-many-locals
764-
def __init__(
764+
def __init__( # pylint: disable=too-many-arguments
765765
self,
766766
name: str,
767767
context: trace_api.SpanContext,
@@ -1053,7 +1053,7 @@ class _Span(Span):
10531053
class Tracer(trace_api.Tracer):
10541054
"""See `opentelemetry.trace.Tracer`."""
10551055

1056-
def __init__(
1056+
def __init__( # pylint: disable=too-many-arguments
10571057
self,
10581058
sampler: sampling.Sampler,
10591059
resource: Resource,
@@ -1074,7 +1074,7 @@ def __init__(
10741074
self._instrumentation_scope = instrumentation_scope
10751075

10761076
@_agnosticcontextmanager # pylint: disable=protected-access
1077-
def start_as_current_span(
1077+
def start_as_current_span( # pylint: disable=too-many-arguments
10781078
self,
10791079
name: str,
10801080
context: Optional[context_api.Context] = None,
@@ -1104,7 +1104,7 @@ def start_as_current_span(
11041104
) as span:
11051105
yield span
11061106

1107-
def start_span( # pylint: disable=too-many-locals
1107+
def start_span( # pylint: disable=too-many-locals # pylint: disable=too-many-arguments
11081108
self,
11091109
name: str,
11101110
context: Optional[context_api.Context] = None,
@@ -1184,7 +1184,7 @@ def start_span( # pylint: disable=too-many-locals
11841184
class TracerProvider(trace_api.TracerProvider):
11851185
"""See `opentelemetry.trace.TracerProvider`."""
11861186

1187-
def __init__(
1187+
def __init__( # pylint: disable=too-many-arguments
11881188
self,
11891189
sampler: Optional[sampling.Sampler] = None,
11901190
resource: Optional[Resource] = None,

opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class BatchSpanProcessor(SpanProcessor):
152152
- :envvar:`OTEL_BSP_EXPORT_TIMEOUT`
153153
"""
154154

155-
def __init__(
155+
def __init__( # pylint: disable=too-many-arguments
156156
self,
157157
span_exporter: SpanExporter,
158158
max_queue_size: int = None,

opentelemetry-sdk/src/opentelemetry/sdk/trace/sampling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def __init__(
197197

198198
class Sampler(abc.ABC):
199199
@abc.abstractmethod
200-
def should_sample(
200+
def should_sample( # pylint: disable=too-many-arguments
201201
self,
202202
parent_context: Optional["Context"],
203203
trace_id: int,
@@ -220,7 +220,7 @@ class StaticSampler(Sampler):
220220
def __init__(self, decision: "Decision") -> None:
221221
self._decision = decision
222222

223-
def should_sample(
223+
def should_sample( # pylint: disable=too-many-arguments
224224
self,
225225
parent_context: Optional["Context"],
226226
trace_id: int,
@@ -281,7 +281,7 @@ def rate(self) -> float:
281281
def bound(self) -> int:
282282
return self._bound
283283

284-
def should_sample(
284+
def should_sample( # pylint: disable=too-many-arguments
285285
self,
286286
parent_context: Optional["Context"],
287287
trace_id: int,
@@ -322,7 +322,7 @@ class ParentBased(Sampler):
322322
not sampled.
323323
"""
324324

325-
def __init__(
325+
def __init__( # pylint: disable=too-many-arguments
326326
self,
327327
root: Sampler,
328328
remote_parent_sampled: Sampler = ALWAYS_ON,
@@ -336,7 +336,7 @@ def __init__(
336336
self._local_parent_sampled = local_parent_sampled
337337
self._local_parent_not_sampled = local_parent_not_sampled
338338

339-
def should_sample(
339+
def should_sample( # pylint: disable=too-many-arguments
340340
self,
341341
parent_context: Optional["Context"],
342342
trace_id: int,

opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def test_defaults(self):
134134
with self.assertLogs(level=WARNING):
135135
pmr.shutdown()
136136

137-
def _create_periodic_reader(
137+
def _create_periodic_reader( # pylint: disable=too-many-arguments
138138
self, metrics, exporter, collect_wait=0, interval=60000, timeout=30000
139139
):
140140
pmr = PeriodicExportingMetricReader(

opentelemetry-sdk/tests/trace/test_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ def test_dropped_attributes(self):
19101910
self.assertEqual(2, span.events[0].dropped_attributes)
19111911
self.assertEqual(2, span.links[0].dropped_attributes)
19121912

1913-
def _test_span_limits(
1913+
def _test_span_limits( # pylint: disable=too-many-arguments
19141914
self,
19151915
tracer,
19161916
max_attrs,

propagator/opentelemetry-propagator-jaeger/tests/test_jaeger_propagator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_trace_id(self):
8585
old_carrier = {FORMAT.TRACE_ID_KEY: self.serialized_uber_trace_id}
8686
_, new_carrier = get_context_new_carrier(old_carrier)
8787
self.assertEqual(
88-
self.serialized_uber_trace_id.split(":")[0],
88+
self.serialized_uber_trace_id.split(":", maxsplit=1)[0],
8989
new_carrier[FORMAT.TRACE_ID_KEY].split(":")[0],
9090
)
9191

shim/opentelemetry-opentracing-shim/src/opentelemetry/shim/opentracing_shim/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def unwrap(self):
557557

558558
return self._otel_tracer
559559

560-
def start_active_span(
560+
def start_active_span( # pylint: disable=too-many-arguments
561561
self,
562562
operation_name: str,
563563
child_of: Union[SpanShim, SpanContextShim] = None,
@@ -611,7 +611,7 @@ def start_active_span(
611611
)
612612
return self._scope_manager.activate(span, finish_on_close)
613613

614-
def start_span(
614+
def start_span( # pylint: disable=too-many-arguments
615615
self,
616616
operation_name: str = None,
617617
child_of: Union[SpanShim, SpanContextShim] = None,

0 commit comments

Comments
 (0)