Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ on:
workflow_call:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v6
with:
version: "latest"
- name: Install dependencies
run: uv sync --extra dev
- name: Run pre-commit hooks
run: uv run pre-commit run --all-files
env:
# Commit-message hooks check `git log` HEAD — not meaningful in CI
SKIP: conventional-gitmoji,commitizen

build:
runs-on: ubuntu-latest

Comment on lines +14 to 34

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Ci missing black --check 📘 Rule violation ✧ Quality

The updated GitHub Actions workflow runs pre-commit and pytest but does not run Black in check mode,
so Black formatting is not enforced in CI. The project configuration also lacks a [tool.black]
section, so Black cannot be applied consistently using project settings.
Agent Prompt
## Issue description
The CI workflow does not enforce Black formatting, and the project lacks a `[tool.black]` configuration section.

## Issue Context
Compliance requires Black to be configured via project configuration and executed in CI check mode.

## Fix Focus Areas
- .github/workflows/python-package.yml[14-53]
- pyproject.toml[92-127]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Expand All @@ -30,12 +48,6 @@ jobs:
with:
version: "latest"
- name: Install dependencies
run: |
uv sync --extra dev --extra deploy
- name: Lint with ruff
run: |
# Run ruff linting with same args as pre-commit, excluding tools/ and tests/ directories
uv run ruff check . --exclude tools/,tests/
- name: Test with pytest and capture coverage
run: |
uv run pytest --no-cov
run: uv sync --extra dev --extra deploy
- name: Test with pytest
run: uv run pytest --no-cov
8 changes: 2 additions & 6 deletions src/supervaizer/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ async def update_case_with_answer(
answer_payload = request.answer
if isinstance(answer_payload, dict):
fields = {
k: v
for k, v in answer_payload.items()
if k != "casestep_index"
k: v for k, v in answer_payload.items() if k != "casestep_index"
}
else:
fields = answer_payload
Expand All @@ -299,9 +297,7 @@ async def update_case_with_answer(
params,
)
except Exception as hook_exc:
log.error(
f"[human_answer hook] {owning_agent.name}: {hook_exc}"
)
log.error(f"[human_answer hook] {owning_agent.name}: {hook_exc}")

log.info(
f"[Case update] Job {job_id}, Case {case_id} - Answer processed successfully"
Expand Down
12 changes: 9 additions & 3 deletions tests/test_routes_case_update.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) 2024-2025 Alain Prasquier - Supervaize.com. All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, you can obtain one at
# https://mozilla.org/MPL/2.0/.

# Copyright (c) 2024-2025 Alain Prasquier - Supervaize.com. All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -344,9 +350,9 @@ def test_human_answer_only_owning_agent_executed(
custom={"m1": stub_method},
human_answer=ha,
)
params_setup = ParametersSetup.from_list(
[Parameter(name="p", value="v", is_environment=True)]
)
params_setup = ParametersSetup.from_list([
Parameter(name="p", value="v", is_environment=True)
])
assert params_setup is not None
owner = Agent(
name="owner-agent",
Expand Down
Loading