Skip to content

🏷️ types: move to ty#24

Merged
SigureMo merged 3 commits intomainfrom
copilot/move-to-ty
Apr 25, 2026
Merged

🏷️ types: move to ty#24
SigureMo merged 3 commits intomainfrom
copilot/move-to-ty

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

Summary

  • replace pyright with ty in the dev dependency set and lockfile
  • update the lint command and VS Code recommendation to use ty
  • remove stale Pyright-specific workspace/type-checker config and make the small typing cleanup needed for ty

Validation

  • uv run ty check --error-on-warning src/expr_simplifier tests
  • uv run ruff check .
  • uv run pytest --reruns 3 --reruns-delay 1
  • uv build

References

Copilot AI and others added 2 commits April 25, 2026 17:49
Agent-Logs-Url: https://github.com/ShigureLab/expr-simplifier/sessions/bbbf3ae0-179b-40ad-9694-e6a3a440f32a

Co-authored-by: SigureMo <38436475+SigureMo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ShigureLab/expr-simplifier/sessions/bbbf3ae0-179b-40ad-9694-e6a3a440f32a

Co-authored-by: SigureMo <38436475+SigureMo@users.noreply.github.com>
Comment thread src/expr_simplifier/__main__.py Outdated
passes: list[Pass],
description: str,
subparser: argparse._SubParsersAction[argparse.ArgumentParser], # pyright: ignore [reportPrivateUsage]
subparser: Any,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot 这个不能用某种方式保持类型吗?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

已改成保留类型信息的写法了,见 39da1f6。现在这里用一个只约束 add_parser(...) -> argparse.ArgumentParser 的 Protocol,避免退回 Any,也不再依赖 Pyright 的私有类型。

Agent-Logs-Url: https://github.com/ShigureLab/expr-simplifier/sessions/8d74859a-e701-4f8a-97bc-3e7d404c7baa

Co-authored-by: SigureMo <38436475+SigureMo@users.noreply.github.com>
Copilot AI requested a review from SigureMo April 25, 2026 18:01
@SigureMo SigureMo marked this pull request as ready for review April 25, 2026 18:05
Copilot AI review requested due to automatic review settings April 25, 2026 18:05
@SigureMo SigureMo merged commit 4fa3875 into main Apr 25, 2026
6 checks passed
@SigureMo SigureMo deleted the copilot/move-to-ty branch April 25, 2026 18:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project’s type-checking tooling from Pyright to ty, updating dev dependencies and editor/lint workflow accordingly.

Changes:

  • Replaced pyright with ty in pyproject.toml and uv.lock.
  • Updated just lint to run ty check (with --error-on-warning) and removed Pyright-specific VS Code settings/recommendations.
  • Adjusted typing in src/expr_simplifier/__main__.py to avoid reliance on argparse private types.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
uv.lock Removes pyright/nodeenv and adds locked ty distribution artifacts.
src/expr_simplifier/__main__.py Introduces a Protocol to type add_parser without referencing private argparse types.
pyproject.toml Swaps dev dependency pyrightty and removes [tool.pyright] configuration.
justfile Updates lint command to use uv run ty check --error-on-warning.
.vscode/settings.json Removes Pyright/Pylance strict type-checking mode setting.
.vscode/extensions.json Recommends the ty VS Code extension instead of Pylance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .vscode/extensions.json
@@ -1,7 +1,7 @@
{
"recommendations": [
"ms-python.python",
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

.vscode/settings.json still contains python.analysis.* settings (inlay hints), which are provided by Pylance. Since this change replaces the Pylance recommendation with astral-sh.ty, contributors may lose those editor features unless they manually install Pylance. Consider recommending both ms-python.vscode-pylance and astral-sh.ty, or remove the remaining python.analysis.* settings if the project is intentionally moving away from Pylance.

Suggested change
"ms-python.python",
"ms-python.python",
"ms-python.vscode-pylance",

Copilot uses AI. Check for mistakes.
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