Skip to content

CLN: move mypy config to pyproject.toml #42620

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 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then
mypy --version

MSG='Performing static analysis using mypy' ; echo $MSG
mypy pandas
mypy
RET=$(($RET + $?)) ; echo $MSG "DONE"
fi

Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/contributing_codebase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ pandas uses `mypy <http://mypy-lang.org>`_ to statically analyze the code base a

.. code-block:: shell

mypy pandas
mypy

.. _contributing.ci:

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/xml/test_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def test_names_option_wrong_type(datapath, parser):

with pytest.raises(TypeError, match=("is not a valid type for names")):
read_xml(
filename, names="Col1, Col2, Col3", parser=parser # type: ignore[arg-type]
filename, names="Col1, Col2, Col3", parser=parser
)


Expand Down
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,40 @@ markers = [
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]

[tool.mypy]
files = "pandas"
platform = "linux-64"
namespace_packages = true
ignore_missing_imports = true
no_implicit_optional = true
check_untyped_defs = true
strict_equality = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true

[[tool.mypy.overrides]]
module = [
"pandas.tests.*",
"pandas._version",
"pandas.io.clipboard",
]
check_untyped_defs = false

[[tool.mypy.overrides]]
module = [
"pandas.tests.apply.test_series_apply",
"pandas.tests.arithmetic.conftest",
"pandas.tests.arrays.sparse.test_combine_concat",
"pandas.tests.dtypes.test_common",
"pandas.tests.frame.methods.test_to_records",
"pandas.tests.groupby.test_rank",
"pandas.tests.groupby.transform.test_transform",
"pandas.tests.indexes.interval.test_interval",
"pandas.tests.indexing.test_categorical",
"pandas.tests.io.excel.test_writers",
"pandas.tests.reductions.test_reductions",
"pandas.tests.test_expressions",
]
ignore_errors = true
55 changes: 0 additions & 55 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -205,58 +205,3 @@ force_grid_wrap = True
force_sort_within_sections = True
skip_glob = env,
skip = pandas/__init__.py

[mypy]
platform = linux-64
ignore_missing_imports = True
no_implicit_optional = True
check_untyped_defs = True
strict_equality = True
warn_redundant_casts = True
warn_unused_ignores = True
show_error_codes = True

[mypy-pandas.tests.*]
check_untyped_defs = False

[mypy-pandas._version]
check_untyped_defs = False

[mypy-pandas.io.clipboard]
check_untyped_defs = False

[mypy-pandas.tests.apply.test_series_apply]
ignore_errors = True

[mypy-pandas.tests.arithmetic.conftest]
ignore_errors = True

[mypy-pandas.tests.arrays.sparse.test_combine_concat]
ignore_errors = True

[mypy-pandas.tests.dtypes.test_common]
ignore_errors = True

[mypy-pandas.tests.frame.methods.test_to_records]
ignore_errors = True

[mypy-pandas.tests.groupby.test_rank]
ignore_errors = True

[mypy-pandas.tests.groupby.transform.test_transform]
ignore_errors = True

[mypy-pandas.tests.indexes.interval.test_interval]
ignore_errors = True

[mypy-pandas.tests.indexing.test_categorical]
ignore_errors = True

[mypy-pandas.tests.io.excel.test_writers]
ignore_errors = True

[mypy-pandas.tests.reductions.test_reductions]
ignore_errors = True

[mypy-pandas.tests.test_expressions]
ignore_errors = True