Skip to content

Commit

Permalink
ci(typing): Disable mypy code [annotation-unchecked] on examples
Browse files Browse the repository at this point in the history
Disables the non-blocking warning that appeared since (1d01fa0)

https://github.com/vega/altair/actions/runs/12843721674/job/35815966648?pr=3747#step:8:13

> tests\examples_methods_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
> tests\examples_arguments_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

I don't consider this useful because:
1. The signature annotations were removed deliberately. Prior to this, they already did the dance of making the stubs of `pandas`, `numpy` and `scipy` happy.
2. The default of `mypy` is the opposite of ((`pyright`|`pylance`))[https://microsoft.github.io/pyright/#/mypy-comparison?id=type-checking-unannotated-code]. I'm not planning to enable `--check-untyped-defs` - but I do want to avoid having warnings in VSCode.
3. Annotations within examples are helpful for getting the correct completions, in cases where inference fails. This is why `pd.Series[float]` was added - to resolve `pandas` complex indexing `@overload`(s)
  • Loading branch information
dangotbanned committed Jan 18, 2025
1 parent 144befb commit c680866
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ module = [
ignore_missing_imports = true
disable_error_code = ["import-untyped"]

[[tool.mypy.overrides]]
module = [
"tests/examples_arguments_syntax.*",
"tests/examples_methods_syntax.*",
]
disable_error_code = ["annotation-unchecked"]

[tool.pyright]
enableExperimentalFeatures=true
extraPaths=["./tools"]
Expand Down

0 comments on commit c680866

Please sign in to comment.