Skip to content

Set up ty in CI #61880

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ repos:
types: [pyi]
args: [scripts/run_stubtest.py]
stages: [manual]
- id: ty
# note: assumes python env is setup and activated
name: ty
entry: ty check
language: system
pass_filenames: false
types: [python]
stages: [manual]
- id: inconsistent-namespace-usage
name: 'Check for inconsistent use of pandas namespace'
entry: python scripts/check_for_inconsistent_pandas_namespace.py
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencies:
# code checks
- flake8=7.1.0 # run in subprocess over docstring examples
- mypy=1.13.0 # pre-commit uses locally installed mypy
- ty=0.0.1a14 # pre-commit uses locally installed ty
- tokenize-rt # scripts/check_for_inconsistent_pandas_namespace.py
- pre-commit>=4.2.0

Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,30 @@ module = [
]
ignore_errors = true

[tool.ty.src]
include = ["pandas"]

### TODO: Enable gradually
[tool.ty.rules]
unresolved-attribute = "ignore"
invalid-return-type = "ignore"
unsupported-operator = "ignore"
invalid-assignment = "ignore"
invalid-argument-type = "ignore"
unresolved-import = "ignore"
no-matching-overload = "ignore"
possibly-unbound-attribute = "ignore"
call-non-callable = "ignore"
missing-argument = "ignore"
non-subscriptable = "ignore"
unknown-argument = "ignore"
not-iterable = "ignore"
unresolved-reference = "ignore"
invalid-context-manager = "ignore"
too-many-positional-arguments = "ignore"
invalid-type-form = "ignore"
parameter-already-assigned = "ignore"

# To be kept consistent with "Import Formatting" section in contributing.rst
[tool.isort]
known_pre_libs = "pandas._config"
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ moto
asv>=0.6.1
flake8==7.1.0
mypy==1.13.0
ty==0.0.1a14
tokenize-rt
pre-commit>=4.2.0
gitpython
Expand Down
Loading