Skip to content

ci: enable Ruff UP007 - #44106

Merged
asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:lint/ruff-up007
Oct 16, 2026
Merged

asukaminato0721 merged 5 commits into
langgenius:mainfrom
asukaminato0721:lint/ruff-up007

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Enable Ruff UP007 for the backend and resolve its existing violations. This PR enables only this rule.

Validation: make lint and make type-check passed. The affected unit tests passed (26 tests).

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 14, 2026
@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-10-16 01:28:56.589144721 +0000
+++ /tmp/pyrefly_pr.txt	2026-10-16 01:28:47.841098896 +0000
@@ -3321,51 +3321,51 @@
 ERROR Object of type `AudioContent | EmbeddedResource | ImageContent | ResourceLink | TextContent` has no attribute `text` [missing-attribute]
    --> tests/unit_tests/core/mcp/server/test_streamable_http.py:390:16
 ERROR `MockNotificationParams` is not assignable to upper bound `NotificationParams | dict[str, Any] | None` of type variable `NotificationParamsT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:52:24
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:51:24
 ERROR `MockRequest` is not assignable to upper bound `ClientRequest | ServerRequest` of type variable `SendRequestT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:65:19
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:64:19
 ERROR `MockNotification` is not assignable to upper bound `ClientNotification | ServerNotification` of type variable `SendNotificationT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:65:19
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:64:19
 ERROR `MockResult` is not assignable to upper bound `ClientResult | ServerResult` of type variable `SendResultT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:65:19
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:64:19
 ERROR `ReceiveRequest` is not assignable to upper bound `ClientRequest | ServerRequest` of type variable `ReceiveRequestT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:65:19
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:64:19
 ERROR `ReceiveNotification` is not assignable to upper bound `ClientNotification | ServerNotification` of type variable `ReceiveNotificationT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:65:19
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:64:19
 ERROR Argument `object` is not assignable to parameter `read_stream` with type `Queue[Unknown]` in function `core.mcp.session.base_session.BaseSession.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:67:26
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:66:26
 ERROR Argument `object` is not assignable to parameter `write_stream` with type `Queue[Unknown]` in function `core.mcp.session.base_session.BaseSession.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:67:26
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:66:26
 ERROR Argument `object` is not assignable to parameter `receive_request_type` with type `type[ReceiveRequest]` in function `core.mcp.session.base_session.BaseSession.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:67:26
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:66:26
 ERROR Argument `object` is not assignable to parameter `receive_notification_type` with type `type[ReceiveNotification]` in function `core.mcp.session.base_session.BaseSession.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:67:26
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:66:26
 ERROR Argument `object` is not assignable to parameter `read_timeout_seconds` with type `timedelta | None` in function `core.mcp.session.base_session.BaseSession.__init__` [bad-argument-type]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:67:26
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:66:26
 ERROR Class member `MockSession._received_request` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:72:9
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:71:9
 ERROR Class member `MockSession._received_notification` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:75:9
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:74:9
 ERROR Class member `MockSession._handle_incoming` overrides parent class `BaseSession` in an inconsistent manner [bad-override-param-name]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:78:9
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:77:9
 ERROR Class member `MockSession._handle_incoming` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:78:9
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:77:9
 ERROR `ReceiveRequest` is not assignable to upper bound `ClientRequest | ServerRequest` of type variable `ReceiveRequestT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:94:33
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:93:33
 ERROR `MockResult` is not assignable to upper bound `ClientResult | ServerResult` of type variable `SendResultT` [bad-specialization]
-  --> tests/unit_tests/core/mcp/session/test_base_session.py:94:33
+  --> tests/unit_tests/core/mcp/session/test_base_session.py:93:33
 ERROR `ReceiveRequest` is not assignable to upper bound `ClientRequest | ServerRequest` of type variable `ReceiveRequestT` [bad-specialization]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:121:33
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:120:33
 ERROR `MockResult` is not assignable to upper bound `ClientResult | ServerResult` of type variable `SendResultT` [bad-specialization]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:121:33
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:120:33
 ERROR Object of class `NoneType` has no attribute `result` [missing-attribute]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:149:5
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:148:5
 ERROR Object of class `NoneType` has no attribute `done` [missing-attribute]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:150:12
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:149:12
 ERROR `ReceiveRequest` is not assignable to upper bound `ClientRequest | ServerRequest` of type variable `ReceiveRequestT` [bad-specialization]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:596:26
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:595:26
 ERROR `ReceiveNotification` is not assignable to upper bound `ClientNotification | ServerNotification` of type variable `ReceiveNotificationT` [bad-specialization]
-   --> tests/unit_tests/core/mcp/session/test_base_session.py:596:26
+   --> tests/unit_tests/core/mcp/session/test_base_session.py:595:26
 ERROR Argument `(c: Unknown, p: Unknown) -> None` is not assignable to parameter `sampling_callback` with type `SamplingFnT | None` in function `core.mcp.session.client_session.ClientSession.__init__` [bad-argument-type]
   --> tests/unit_tests/core/mcp/session/test_client_session.py:97:54
 ERROR Argument `(c: Unknown) -> None` is not assignable to parameter `list_roots_callback` with type `ListRootsFnT | None` in function `core.mcp.session.client_session.ClientSession.__init__` [bad-argument-type]

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 75.03% 75.03% 0.00%
Strict coverage 74.70% 74.70% 0.00%
Typed symbols 61,972 61,972 0
Untyped symbols 20,716 20,716 0
Modules 3793 3793 0

@asukaminato0721 asukaminato0721 changed the title lint(api): enable Ruff UP007 ci: enable Ruff UP007 Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.96907% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.94%. Comparing base (37a9e4c) to head (312e065).

Files with missing lines Patch % Lines
api/core/model_manager.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44106   +/-   ##
=======================================
  Coverage   88.94%   88.94%           
=======================================
  Files        5304     5304           
  Lines      326595   326587    -8     
  Branches    63840    63840           
=======================================
- Hits       290495   290491    -4     
+ Misses      30903    30897    -6     
- Partials     5197     5199    +2     
Flag Coverage Δ
api 88.52% <98.96%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

hjlarry
hjlarry previously approved these changes Oct 15, 2026
hjlarry
hjlarry previously approved these changes Oct 16, 2026
@asukaminato0721
asukaminato0721 added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 16, 2026
@asukaminato0721
asukaminato0721 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into langgenius:main with commit c30c19b Oct 16, 2026
42 checks passed
@asukaminato0721
asukaminato0721 deleted the lint/ruff-up007 branch October 16, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants