Skip to content

Commit

Permalink
bump pylint to 3.2.1 (#4209)
Browse files Browse the repository at this point in the history
* bump pylint to 3.2.1

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix test-util

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* disable in test-util

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
  • Loading branch information
emdneto authored Oct 2, 2024
1 parent 6c4aed8 commit 01a670e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pylint==3.0.2
pylint==3.2.1
flake8==6.1.0
isort==5.12.0
black==24.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ def collect(self) -> Iterable[PrometheusMetric]:
)

if metric_family_id_metric_family:
for metric_family in metric_family_id_metric_family.values():
yield metric_family
yield from metric_family_id_metric_family.values()

# pylint: disable=too-many-locals,too-many-branches
def _translate_to_prometheus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def collect(self) -> Optional[MetricsData]:
metrics.append(
Metric(
# pylint: disable=protected-access
# pylint: disable=possibly-used-before-assignment
name=view_instrument_match._name,
description=view_instrument_match._description,
unit=view_instrument_match._instrument.unit,
Expand Down
7 changes: 5 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/util/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def get_dict_as_key(
labels: Mapping[str, AttributeValue]
) -> AttributesAsKey: ...

# pylint: disable=no-self-use
class BoundedList(Sequence[_T]):
"""An append only list with a fixed max size.
Expand All @@ -51,7 +52,9 @@ class BoundedList(Sequence[_T]):
def append(self, item: _T): ...
def extend(self, seq: Sequence[_T]): ...
@classmethod
def from_seq(cls, maxlen: int, seq: Iterable[_T]) -> BoundedList[_T]: ...
def from_seq(
cls, maxlen: int, seq: Iterable[_T]
) -> BoundedList[_T]: ... # pylint: disable=undefined-variable

class BoundedDict(MutableMapping[_KT, _VT]):
"""An ordered dict with a fixed max capacity.
Expand All @@ -70,4 +73,4 @@ class BoundedDict(MutableMapping[_KT, _VT]):
@classmethod
def from_map(
cls, maxlen: int, mapping: Mapping[_KT, _VT]
) -> BoundedDict[_KT, _VT]: ...
) -> BoundedDict[_KT, _VT]: ... # pylint: disable=undefined-variable
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ def test_exponent_index_min(self):

self.assertEqual(
exponent_mapping.map_to_index(
nextafter(MIN_NORMAL_VALUE, inf)
nextafter( # pylint: disable=possibly-used-before-assignment
MIN_NORMAL_VALUE, inf
)
),
MIN_NORMAL_EXPONENT >> -scale,
)
1 change: 1 addition & 0 deletions opentelemetry-sdk/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from opentelemetry.sdk.util import BoundedList


# pylint: disable=unsubscriptable-object
class TestBoundedList(unittest.TestCase):
base = [52, 36, 53, 29, 54, 99, 56, 48, 22, 35, 21, 65, 10, 95, 42, 60]

Expand Down

0 comments on commit 01a670e

Please sign in to comment.