Skip to content

Commit cf8e9fd

Browse files
committed
lint and check action permissions
1 parent 59916fe commit cf8e9fd

23 files changed

Lines changed: 33 additions & 29 deletions

.github/workflows/codspeed_benchmarks.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ jobs:
3737
ports:
3838
- 6379:6379
3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
41+
with:
42+
persist-credentials: false
4143
- name: Install uv
42-
uses: astral-sh/setup-uv@v5
44+
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
45+
with:
46+
version: "latest"
4347
- name: Set up Python
44-
uses: actions/setup-python@v5
48+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
4549
with:
4650
python-version: "3.13"
4751
- name: Install Dependencies
@@ -50,7 +54,8 @@ jobs:
5054
- name: Install Pydantic v2
5155
run: uv pip install --system --prerelease=disallow "pydantic>=2.0.0,<3.0.0"
5256
- name: Run the benchmarks
53-
uses: CodSpeedHQ/action@v4
57+
uses: GitHubSecurityLab/actions-permissions/monitor@main
58+
uses: CodSpeedHQ/action@dbda7111f8ac363564b0c51b992d4ce76bb89f2f # v4.5.2
5459
with:
5560
mode: walltime
5661
run: uv run pytest benchmarks/ --codspeed

benchmarks/confluent_cases/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ async def start(self) -> AsyncIterator[float]:
5151
yield start_time
5252

5353
async def test_consume_message(self) -> None:
54-
async with self.start() as start_time:
54+
async with self.start():
5555
await asyncio.sleep(6.0)
5656
assert self.EVENTS_PROCESSED > 1

benchmarks/confluent_cases/test_confluent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ def handle() -> None:
8787
await run_in_executor(None, self.consumer.close)
8888

8989
async def test_consume_message(self) -> None:
90-
async with self.start() as start_time:
90+
async with self.start():
9191
await asyncio.sleep(6.0)
9292
assert self.EVENTS_PROCESSED > 1

benchmarks/confluent_cases/test_msgspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ async def start(self) -> AsyncIterator[float]:
5555
yield start_time
5656

5757
async def test_consume_message(self) -> None:
58-
async with self.start() as start_time:
58+
async with self.start():
5959
await asyncio.sleep(6.0)
6060
assert self.EVENTS_PROCESSED > 1

benchmarks/confluent_cases/test_pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ async def start(self) -> AsyncIterator[float]:
5050
yield start_time
5151

5252
async def test_consume_message(self) -> None:
53-
async with self.start() as start_time:
53+
async with self.start():
5454
await asyncio.sleep(6.0)
5555
assert self.EVENTS_PROCESSED > 1

benchmarks/kafka_cases/test_aiokafka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ async def message_loop() -> None:
8787
await consumer.stop()
8888

8989
async def test_consume_message(self) -> None:
90-
async with self.start() as start_time:
90+
async with self.start():
9191
await asyncio.sleep(1)
9292
assert self.EVENTS_PROCESSED > 1

benchmarks/kafka_cases/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ async def start(self) -> AsyncIterator[float]:
4949
yield start_time
5050

5151
async def test_consume_message(self) -> None:
52-
async with self.start() as start_time:
52+
async with self.start():
5353
await asyncio.sleep(1)
5454
assert self.EVENTS_PROCESSED > 1

benchmarks/kafka_cases/test_msgspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ async def start(self) -> AsyncIterator[float]:
5555
yield start_time
5656

5757
async def test_consume_message(self) -> None:
58-
async with self.start() as start_time:
58+
async with self.start():
5959
await asyncio.sleep(1)
6060
assert self.EVENTS_PROCESSED > 1

benchmarks/kafka_cases/test_pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ async def start(self) -> AsyncIterator[float]:
5050
yield start_time
5151

5252
async def test_consume_message(self) -> None:
53-
async with self.start() as start_time:
53+
async with self.start():
5454
await asyncio.sleep(1)
5555
assert self.EVENTS_PROCESSED > 1

benchmarks/nats_cases/test_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TestNatsCase:
1818
comment = "Consume Any Message"
1919
broker_type = "NATS"
2020

21-
def setup_method(self):
21+
def setup_method(self) -> None:
2222
broker = self.broker = NatsBroker(logger=None, graceful_timeout=10)
2323
self.EVENTS_PROCESSED = 0
2424

@@ -48,6 +48,6 @@ async def start(self) -> AsyncIterator[float]:
4848
yield start_time
4949

5050
async def test_consume_message(self) -> None:
51-
async with self.start() as start_time:
51+
async with self.start():
5252
await asyncio.sleep(1)
5353
assert self.EVENTS_PROCESSED > 1

0 commit comments

Comments
 (0)