Skip to content

Commit

Permalink
Merge pull request #20 from zerlok/dependabot/pip/dev-dependencies-87…
Browse files Browse the repository at this point in the history
…f80df551

Bump ruff from 0.7.4 to 0.8.0 in the dev-dependencies group across 1 directory
  • Loading branch information
zerlok authored Nov 26, 2024
2 parents 0cb440b + 5507880 commit 9f30b24
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 76 deletions.
76 changes: 21 additions & 55 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mypy = "^1.13.0"
pytest = "^8.3.3"
pytest-cov = "^6.0.0"
pytest-mypy-plugins = "^3.1.2"
ruff = "^0.7.4"
ruff = ">=0.7.4,<0.9.0"
grpc-stubs = "^1.53.0.5"
BrokRPC = { version = "^0.2.0", python = ">=3.12,<4.0" }

Expand All @@ -49,6 +49,7 @@ build-backend = "poetry.core.masonry.api"


[tool.ruff]
target-version = "py39"
include = ["src/**/*.py", "tests/**/*.py"]
extend-exclude = ["tests/**/expected_gen/**.py"]
force-exclude = true
Expand Down
6 changes: 3 additions & 3 deletions src/pyprotostuben/codegen/mypy/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __build_protobuf_message_has_field_method_stub(self, scope: ScopeInfo) -> as
)

def __build_which_oneof_method_stubs(self, scope: ScopeInfo) -> t.Iterable[ast.stmt]:
oneofs: t.DefaultDict[str, t.List[ast.expr]] = defaultdict(list)
oneofs = defaultdict[str, list[ast.expr]](list)
for field in scope.fields:
if field.oneof_group is not None:
oneofs[field.oneof_group].append(self.__inner.build_const(field.name))
Expand Down Expand Up @@ -429,7 +429,7 @@ def __build_stub_method_def(self, info: MethodInfo) -> ast.stmt:
doc=info.doc,
)

def __build_servicer_method_inout_refs(self, info: MethodInfo) -> t.Tuple[ast.expr, ast.expr]:
def __build_servicer_method_inout_refs(self, info: MethodInfo) -> tuple[ast.expr, ast.expr]:
if not info.server_input_streaming and not info.server_output_streaming:
return (
self.__build_message_ref(info.server_input),
Expand Down Expand Up @@ -457,7 +457,7 @@ def __build_servicer_method_inout_refs(self, info: MethodInfo) -> t.Tuple[ast.ex
msg = "invalid method streaming options"
raise ValueError(msg, info)

def __build_stub_method_inout_refs(self, info: MethodInfo) -> t.Tuple[ast.expr, ast.expr]:
def __build_stub_method_inout_refs(self, info: MethodInfo) -> tuple[ast.expr, ast.expr]:
if not info.server_input_streaming and not info.server_output_streaming:
return (
self.__build_message_ref(info.server_input),
Expand Down
7 changes: 4 additions & 3 deletions src/pyprotostuben/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,17 @@ def configure(cls) -> None:
def get(
# allow callee to pass custom `cls` kwarg
__cls, # noqa: N804
__name: str,
name: str,
/,
**kwargs: object,
) -> "Logger":
return __cls(getLogger(__name), kwargs)
return __cls(getLogger(name), kwargs)

def process(
self,
msg: object,
kwargs: t.MutableMapping[str, object],
) -> t.Tuple[object, t.MutableMapping[str, object]]:
) -> tuple[object, t.MutableMapping[str, object]]:
exc_info = kwargs.pop("exc_info", None)
return msg, {
"exc_info": exc_info,
Expand Down
Loading

0 comments on commit 9f30b24

Please sign in to comment.