155 строки
3.9 KiB
TOML
155 строки
3.9 KiB
TOML
[build-system]
|
|
requires = ["setuptools >= 69.0"] # v69 includes type information by default
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "microsoft-python-type-stubs"
|
|
dynamic = ["version"]
|
|
|
|
# Allow these stubs to be installed from GitHub
|
|
# We need an explicit mapping instead of just
|
|
# [tool.setuptools]
|
|
# package-dir = {"" = "stubs"}
|
|
# because the folder names don't all match "*-stubs"
|
|
# see https://github.com/microsoft/python-type-stubs/issues/315
|
|
[tool.setuptools.package-dir]
|
|
# See README.md as to why matplotlib is not included
|
|
"networkx-stubs" = "stubs/networkx"
|
|
"skimage-stubs" = "stubs/skimage"
|
|
"sklearn-stubs" = "stubs/sklearn"
|
|
"sympy-stubs" = "stubs/sympy-stubs"
|
|
"transformers-stubs" = "stubs/transformers-stubs"
|
|
"vispy-stubs" = "stubs/vispy"
|
|
|
|
[tool.ruff]
|
|
line-length = 130
|
|
# Target oldest supported Python version
|
|
target-version = "py39"
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"I", # isort
|
|
]
|
|
|
|
[tool.ruff.lint.isort]
|
|
combine-as-imports = true
|
|
extra-standard-library = [
|
|
"typing_extensions",
|
|
"_typeshed",
|
|
# Extra modules not recognized by Ruff/isort
|
|
"_ast",
|
|
"_bisect",
|
|
"_bootlocale",
|
|
"_codecs",
|
|
"_collections_abc",
|
|
"_compat_pickle",
|
|
"_compression",
|
|
"_csv",
|
|
"_ctypes",
|
|
"_curses",
|
|
"_decimal",
|
|
"_dummy_thread",
|
|
"_dummy_threading",
|
|
"_heapq",
|
|
"_imp",
|
|
"_json",
|
|
"_locale",
|
|
"_lsprof",
|
|
"_markupbase",
|
|
"_msi",
|
|
"_operator",
|
|
"_osx_support",
|
|
"_posixsubprocess",
|
|
"_py_abc",
|
|
"_pydecimal",
|
|
"_random",
|
|
"_sitebuiltins",
|
|
"_socket",
|
|
"_sqlite3",
|
|
"_ssl",
|
|
"_stat",
|
|
"_thread",
|
|
"_threading_local",
|
|
"_tkinter",
|
|
"_tracemalloc",
|
|
"_warnings",
|
|
"_weakref",
|
|
"_weakrefset",
|
|
"_winapi",
|
|
"genericpath",
|
|
"opcode",
|
|
"pyexpat",
|
|
"zoneinfo",
|
|
]
|
|
|
|
[tool.pyright]
|
|
exclude = ["build", ".git"]
|
|
# Target oldest supported Python version
|
|
pythonversion = "3.9"
|
|
typeCheckingMode = "standard"
|
|
# Partial stubs are acceptable
|
|
reportUnknownArgumentType = false
|
|
# Stubs-only packages are fine for testing
|
|
reportMissingModuleSource = false
|
|
# Stubs are allowed to use private variables
|
|
reportPrivateUsage = false
|
|
reportPrivateImportUsage = false
|
|
# Incompatible overrides and property type mismatches are out of our stubs' control
|
|
# as they are inherited from the implementation.
|
|
reportIncompatibleMethodOverride = false
|
|
reportIncompatibleVariableOverride = false
|
|
reportPropertyTypeMismatch = false
|
|
# Overlapping overloads are often necessary in a stub, meaning pyright's check
|
|
# (which is stricter than mypy's; see mypy issue #10143 and #10157)
|
|
# would cause many false positives and catch few bugs.
|
|
reportOverlappingOverload = false
|
|
# The name of the self/cls parameter is out of third-party stubs' control.
|
|
reportSelfClsParameterName = false
|
|
# Not an error by default in standard mode
|
|
reportUnsupportedDunderAll = "error"
|
|
|
|
# Error reports to fix in code
|
|
reportAssertTypeFailure = "none" # TODO
|
|
reportGeneralTypeIssues = "none" # TODO
|
|
|
|
[tool.mypy]
|
|
# Target oldest supported Python version
|
|
python_version = "3.9"
|
|
# Allow dynamic typing
|
|
disallow_any_unimported = false # TODO
|
|
disallow_any_expr = false # TODO
|
|
disallow_any_decorated = false # TODO
|
|
disallow_any_explicit = false # TODO
|
|
disallow_any_generics = false # TODO
|
|
disallow_subclassing_any = false # TODO
|
|
# Untyped definitions and calls
|
|
disallow_untyped_calls = false # TODO
|
|
disallow_untyped_defs = false # TODO
|
|
disallow_incomplete_defs = false # TODO
|
|
check_untyped_defs = true
|
|
disallow_untyped_decorators = true
|
|
# Configuring warnings
|
|
warn_redundant_casts = true
|
|
warn_unused_ignores = false # Change from pandas
|
|
# Suppressing errors
|
|
disable_error_code = [
|
|
# Not all imports in these stubs are gonna be typed
|
|
"import-untyped",
|
|
# TODO
|
|
"assert-type",
|
|
"assignment",
|
|
"attr-defined",
|
|
"import-not-found",
|
|
"misc",
|
|
"name-defined",
|
|
"no-redef",
|
|
"operator",
|
|
"override",
|
|
"return",
|
|
"type-var",
|
|
"valid-type",
|
|
"var-annotated",
|
|
]
|
|
# Configuring error messages
|
|
show_column_numbers = true
|