Skip to content

Declare direct dependencies flagged by ty missing-direct-dependency - #955

Merged
Sun Haoran (haoranpb) merged 4 commits into
ty/strict-redundant-conditionfrom
ty/strict-direct-dependencies
Oct 8, 2026
Merged

Sun Haoran (haoranpb) merged 4 commits into
ty/strict-redundant-conditionfrom
ty/strict-direct-dependencies

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

What

Fix ty missing-direct-dependency. Package code may only import project.dependencies or extras, so this PR touches manifests (unavoidable for this rule):

  • Add packaging and rich to project.dependencies (previously only transitive).
  • Move redteam from a dependency group to [project.optional-dependencies]. Install with uv sync --extra redteam; CI's setup-python-uv action now uses --all-groups --all-extras.
  • Update CLI messages/help, CONTRIBUTING, .env.sample and tests accordingly.
  • uv.lock: only the bcbench stanza changes.

Part of the stack that makes ty strict (all = "error") across the whole uv workspace. Each PR fixes one rule in Python code only; the config change lands in #956.

@haoranpb
Sun Haoran (haoranpb) added this pull request to stack #957 October 7, 2026 12:57
@github-code-quality

github-code-quality Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest

The overall line coverage in commit 29e8f9c in the ty/strict-direct-dep... branch remains at 86%, unchanged from commit c30246c in the ty/strict-redundant-... branch.

Show a line coverage summary of the most impacted files.
File ty/strict-redundant-... c30246c ty/strict-direct-dep... 29e8f9c +/-
src/bcbench/eva...stgeneration.py 46% 41% -5%
src/bcbench/col...t_codereview.py 89% 88% -1%
src/bcbench/ope...p_operations.py 92% 91% -1%
src/bcbench/ope...n_operations.py 88% 87% -1%
src/bcbench/age...opilot/agent.py 74% 73% -1%
src/bcbench/eva...view_parsing.py 70% 70% 0%
src/bcbench/types.py 91% 92% +1%
src/bcbench/config.py 97% 98% +1%
src/bcbench/age.../mcp_gateway.py 91% 92% +1%
src/bcbench/age...t/shared/mcp.py 92% 95% +3%

Updated October 08, 2026 11:36 UTC

@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch 2 times, most recently from 246af9f to b5f4e86 Compare October 8, 2026 09:01
@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch from b5f4e86 to 7b7f206 Compare October 8, 2026 09:09
@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch from 7b7f206 to 0a54de6 Compare October 8, 2026 09:23
@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch 2 times, most recently from 0136bab to 9d1637d Compare October 8, 2026 10:11
@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch from 9d1637d to 2ff848d Compare October 8, 2026 10:13
@haoranpb
Sun Haoran (haoranpb) marked this pull request as ready for review October 8, 2026 11:16
Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The development-container setup still omits --all-extras, unintentionally dropping previously installed red-team dependencies.

1 open finding
What changed in this PR

Declares direct dependencies required by strict ty checks and converts red-team tooling into an optional extra.

Changes:

  • Adds direct packaging and rich dependencies.
  • Moves red-team dependencies to an optional extra.
  • Updates installation workflows, CLI messaging, tests, and documentation.
File Description
pyproject.toml Updates dependency declarations.
uv.lock Reflects manifest changes.
.github/​actions/​setup-python-uv/​action.yml Adds full groups/extras installation.
.github/​workflows/​CI.yml Enables full installation in CI.
.github/​workflows/​copilot-setup-steps.yml Enables full Copilot setup.
src/​bcbench/​cli.py Renames red-team availability handling.
src/​bcbench/​commands/​redteam.py Updates installation guidance.
tests/​test_cli_commands.py Updates helper tests.
tests/​test_redteam.py Updates extra terminology.
CONTRIBUTING.md Documents extras installation.
.env.sample Updates red-team setup guidance.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread pyproject.toml
Sun Haoran (haoranpb) and others added 2 commits October 8, 2026 13:23
Add rich and packaging to project dependencies and move the redteam dependency group to an optional extra, since package code may only import project dependencies or extras.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 70c54f79-d7a0-4cde-baf2-e53dfff3deb4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haoranpb
Sun Haoran (haoranpb) force-pushed the ty/strict-direct-dependencies branch from 3ce9441 to ae3697c Compare October 8, 2026 11:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The manifest, lockfile, workflows, tests, and user-facing instructions consistently implement the dependency changes.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haoranpb
Sun Haoran (haoranpb) merged commit d474e8e into main Oct 8, 2026
18 checks passed
@haoranpb
Sun Haoran (haoranpb) deleted the ty/strict-direct-dependencies branch October 8, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants