forked from luminartech/dev-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
chore: migrate from mypy to ty #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a9f417d
chore: migrate from mypy to ty
cbachhuber 81ae9dd
Add types-regex for ty
cbachhuber c4050be
Remove unneeded exclusions
cbachhuber 12a8c11
Reset to main
cbachhuber 62cc5f7
Pass filenames
cbachhuber 577da37
style: pre-commit.ci fixes
pre-commit-ci[bot] f169215
Call ty directly
cbachhuber 968ad47
style: pre-commit.ci fixes
pre-commit-ci[bot] 494db0f
Remove unneeded dependency
cbachhuber b41178c
update lockfile
cbachhuber 9f406da
Create .venv for prek
cbachhuber 11d52e8
Explain
cbachhuber 2489f6c
use uv sync
cbachhuber b7765bf
Also install dev deps
cbachhuber e1f914a
Re-introduce types-regex
cbachhuber cd1a3c9
Fix format
cbachhuber 8001721
skip in pre-commit.ci
cbachhuber b0bad09
Update .pre-commit-config.yaml
hofbi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ dependencies = [ | |
| dev = [ | ||
| "pytest>=9.0.3", | ||
| "pytest-cov", | ||
| "pyfakefs" | ||
| "pyfakefs", | ||
| "types-regex" | ||
| ] | ||
|
|
||
| [project.scripts] | ||
|
|
@@ -41,24 +42,6 @@ print-pre-commit-metrics = "dev_tools.print_pre_commit_metrics:main" | |
| sync-vscode-config = "dev_tools.sync_vscode_config:main" | ||
| sync-tool-versions = "dev_tools.sync_tool_versions:main" | ||
|
|
||
| [tool.mypy] | ||
| check_untyped_defs = true | ||
| disallow_incomplete_defs = true | ||
| disallow_untyped_calls = true | ||
| disallow_untyped_defs = true | ||
| ignore_missing_imports = true | ||
| no_implicit_optional = true | ||
| show_column_numbers = true | ||
| show_error_codes = true | ||
| show_error_context = true | ||
| strict_equality = true | ||
| strict_optional = true | ||
| warn_no_return = true | ||
| warn_redundant_casts = true | ||
| warn_return_any = true | ||
| warn_unused_configs = true | ||
| warn_unused_ignores = true | ||
|
Comment on lines
-44
to
-60
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are all on in ty per default |
||
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = "--cov-report term-missing --cov=dev_tools --cov=packages/whoowns/whoowns --cov=packages/configure_vscode_for_bazel/configure_vscode_for_bazel -vv" | ||
| testpaths = [ | ||
|
|
@@ -98,6 +81,9 @@ ignore = [ | |
| "S101" # allow assertions in tests | ||
| ] | ||
|
|
||
| [tool.ty.terminal] | ||
| error-on-warning = true | ||
|
|
||
| [tool.uv.build-backend] | ||
| module-root = "" # required to avoid the "src" layout, which is the default for uv_build | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In contrast to mypy, ty can't work with this type, see this run. So, we need to install the stubs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this would work when adding to the additional dependencies as we do for ty itself? Iguess not since we point ty to our venv, but just wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work. Probably because we point ty to uv's
.venv, so it doesn't see modules added to prek's venv viaadditional_dependencies.