Skip to content

Commit b32c86a

Browse files
chore: appease pylint (#2890)
* chore: bump py-version * fix: import `final` from typing * style: pre-commit fixes * chore: bump pylint, appease inheritance We use this heirarchy internally and it feels sensible * chore: more appease! --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e2510ca commit b32c86a

File tree

11 files changed

+13
-14
lines changed

11 files changed

+13
-14
lines changed

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def pylint(session):
5656
Run the pylint process.
5757
"""
5858

59-
session.install("pylint==2.12.2")
59+
session.install("pylint==3.0.2")
6060
session.run("pylint", "src", *session.posargs)
6161

6262

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ filterwarnings = [
130130
log_cli_level = "info"
131131

132132
[tool.pylint.master]
133-
py-version = "3.7"
133+
py-version = "3.8"
134134
jobs = "0"
135135
ignore-paths = [
136136
"src/awkward/_typeparser/generated_parser.py",
@@ -154,6 +154,7 @@ disable = [
154154
"consider-using-f-string",
155155
"consider-using-max-builtin",
156156
"consider-using-min-builtin",
157+
"cyclic-import",
157158
"duplicate-code",
158159
"exec-used",
159160
"fixme",
@@ -174,7 +175,6 @@ disable = [
174175
"no-else-return",
175176
"no-member",
176177
"no-name-in-module",
177-
"no-self-use",
178178
"no-value-for-parameter",
179179
"property-with-parameters",
180180
"protected-access",

src/awkward/_nplikes/cupy.py

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

1818

1919
@register_nplike
20-
class Cupy(ArrayModuleNumpyLike):
20+
class Cupy(ArrayModuleNumpyLike): # pylint: disable=too-many-ancestors
2121
is_eager: Final = False
2222
supports_structured_dtypes: Final = False
2323

src/awkward/_nplikes/jax.py

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

1212

1313
@register_nplike
14-
class Jax(ArrayModuleNumpyLike):
14+
class Jax(ArrayModuleNumpyLike): # pylint: disable=too-many-ancestors
1515
is_eager: Final = True
1616
supports_structured_dtypes: Final = False
1717

src/awkward/_nplikes/numpy.py

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

1818

1919
@register_nplike
20-
class Numpy(ArrayModuleNumpyLike["NDArray"]):
20+
class Numpy(ArrayModuleNumpyLike["NDArray"]): # pylint: disable=too-many-ancestors
2121
is_eager: Final = True
2222
supports_structured_dtypes: Final = True
2323

src/awkward/_nplikes/typetracer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def derive_slice_for_length(
10551055
return start, stop, step, self.index_as_shape_item(slice_length)
10561056

10571057
def broadcast_shapes(self, *shapes: tuple[ShapeItem, ...]) -> tuple[ShapeItem, ...]:
1058-
ndim = max([len(s) for s in shapes], default=0)
1058+
ndim = max((len(s) for s in shapes), default=0)
10591059
result: list[ShapeItem] = [1] * ndim
10601060

10611061
for shape in shapes:

src/awkward/_parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def parameters_intersect(
115115
if result is None:
116116
result = {key: left_value}
117117
else:
118-
result[key] = left_value # pylint: disable-msg=E1137
118+
result[key] = left_value
119119
return result
120120

121121

@@ -151,7 +151,7 @@ def parameters_union(
151151
if parameters is None:
152152
parameters = {key: value}
153153
else:
154-
parameters[key] = value # pylint: disable-msg=E1137
154+
parameters[key] = value
155155

156156
return parameters
157157

src/awkward/_singleton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _new(cls) -> Self:
1616
)
1717

1818
self = super().__new__(cls)
19-
self.__init__()
19+
self.__init__() # pylint: disable=unnecessary-dunder-call
2020
cls._instance = self
2121

2222
return self

src/awkward/_typing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
AxisMaybeNone = TypeVar("AxisMaybeNone", int, None) # noqa: F405
3535

3636
if sys.version_info < (3, 11):
37-
from typing import ClassVar, Final, SupportsIndex, runtime_checkable
37+
from typing import ClassVar, Final, SupportsIndex, final, runtime_checkable
3838

3939
from typing_extensions import (
4040
Literal,
@@ -45,7 +45,6 @@
4545
TypedDict,
4646
TypeGuard,
4747
Unpack,
48-
final,
4948
)
5049
else:
5150
from typing import (

src/awkward/operations/ak_concatenate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def concatenate(
6969
def _merge_as_union(
7070
contents: Sequence[Content], parameters=None
7171
) -> ak.contents.UnionArray:
72-
length = sum([c.length for c in contents])
72+
length = sum(c.length for c in contents)
7373
first = contents[0]
7474
tags = ak.index.Index8.empty(length, first.backend.index_nplike)
7575
index = ak.index.Index64.empty(length, first.backend.index_nplike)

src/awkward/operations/ak_from_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def _build_assembly(schema, container, instructions):
547547
if not isinstance(schema, dict):
548548
raise TypeError(f"unrecognized JSONSchema: expected dict, got {schema!r}")
549549

550-
if "type" not in schema is None:
550+
if "type" not in schema:
551551
raise TypeError(f"unrecognized JSONSchema: no 'type' in {schema!r}")
552552

553553
tpe = schema["type"]

0 commit comments

Comments
 (0)