Skip to content

Commit

Permalink
ci: Update pre-commit configs and apply auto-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Sep 5, 2023
1 parent 4fe1a99 commit 8a94ad7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ repos:
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies: [
'types-python-dateutil',
'attrs>=21.3',
]
10 changes: 6 additions & 4 deletions scripts/extract-release-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ def main():
if m is not None:
content = m.group(1).strip()
content += (
"\n\n### Full Changelog\n\nCheck out [the full changelog](%s) until this release (%s).\n"
% (changelog_url, tag)
f"\n\n### Full Changelog"
f"\n\nCheck out [the full changelog]({changelog_url}) "
f"until this release ({tag}).\n"
)
content += (
"\n\n### Full Commit Logs\n\nCheck out [the full commit logs](%s) between release (%s) and (%s).\n"
% (commitlog_url, prev_tag, tag)
f"\n\n### Full Commit Logs"
f"\n\nCheck out [the full commit logs]({commitlog_url}) "
f"between release ({prev_tag}) and ({tag}).\n"
)
if not args.draft:
output_path.write_text(content)
Expand Down
10 changes: 7 additions & 3 deletions src/callosum/lower/dispatch_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class RedisStreamAddress(AbstractAddress):


class DispatchRedisConnection(AbstractConnection):

__slots__ = ("transport",)

transport: DispatchRedisTransport
Expand All @@ -54,8 +53,10 @@ async def recv_message(self) -> AsyncGenerator[Optional[RawHeaderBody], None]:
stream_key = self.addr.stream_key
else:
stream_key = f"{self.addr.stream_key}.{self.direction_keys[0]}"

# _s = asyncio.shield
_s = lambda x: x
def _s(x):
return x

async def _xack(raw_msg):
await self.transport._redis.xack(raw_msg[0], self.addr.group, raw_msg[1])
Expand Down Expand Up @@ -87,8 +88,11 @@ async def send_message(self, raw_msg: RawHeaderBody) -> None:
stream_key = self.addr.stream_key
else:
stream_key = f"{self.addr.stream_key}.{self.direction_keys[1]}"

# _s = asyncio.shield
_s = lambda x: x
def _s(x):
return x

await _s(
self.transport._redis.xadd(
stream_key, {b"hdr": raw_msg[0], b"msg": raw_msg[1]}
Expand Down
10 changes: 7 additions & 3 deletions src/callosum/lower/rpc_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class RedisStreamAddress(AbstractAddress):


class RPCRedisConnection(AbstractConnection):

__slots__ = ("transport",)

transport: RPCRedisTransport
Expand All @@ -48,8 +47,10 @@ async def recv_message(self) -> AsyncGenerator[Optional[RawHeaderBody], None]:
stream_key = self.addr.stream_key
else:
stream_key = f"{self.addr.stream_key}.{self.direction_keys[0]}"

# _s = asyncio.shield
_s = lambda x: x
def _s(x):
return x

async def _xack(raw_msg):
await self.transport._redis.xack(raw_msg[0], self.addr.group, raw_msg[1])
Expand Down Expand Up @@ -81,8 +82,11 @@ async def send_message(self, raw_msg: RawHeaderBody) -> None:
stream_key = self.addr.stream_key
else:
stream_key = f"{self.addr.stream_key}.{self.direction_keys[1]}"

# _s = asyncio.shield
_s = lambda x: x
def _s(x):
return x

await _s(
self.transport._redis.xadd(
stream_key, {b"hdr": raw_msg[0], b"msg": raw_msg[1]}
Expand Down

0 comments on commit 8a94ad7

Please sign in to comment.