Skip to content
Merged
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
34 changes: 21 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,32 @@ packages = ["src/numpy-stubs"]


[tool.mypy]
files = ["src/**/*.py", "src/**/*.pyi"]
files = ["src/**/*.py", "src/**/*.pyi", "tests/**/*.py", "tests/**/*.pyi"]
python_version = "3.10"
strict = true

disable_bytearray_promotion = true
disable_memoryview_promotion = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
disable_error_code = ["explicit-override"] # TODO
# basedmypy only
warn_unreachable = false
warn_unused_ignores = false
warn_unused_ignores = true
disallow_any_explicit = false
# TODO
disable_error_code = ["explicit-override"]

[tool.pyright]
include = ["src/numpy-stubs"]
include = ["src/numpy-stubs", "tests"]
ignore = [".venv"]
stubPath = "src"
pythonVersion = "3.10"
pythonPlatform = "All"
typeCheckingMode = "standard"
pythonVersion = "3.10"
typeCheckingMode = "standard" # TODO(jorenham): set to "all"

deprecateTypingAliases = true
enableReachabilityAnalysis = false
enableTypeIgnoreComments = false
reportCallInDefaultInitializer = true
reportImplicitOverride = false # TODO
reportImportCycles = true
reportMissingSuperCall = false
reportPrivateUsage = false
Expand All @@ -104,10 +105,12 @@ reportInvalidCast = true
reportPrivateLocalImportUsage = true
reportUnannotatedClassAttribute = true
strictGenericNarrowing = true
# TODO
reportImplicitOverride = false


[tool.ruff]
src = ["src"]
src = ["src", "tests"]
extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"]
force-exclude = true
# https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#maximum-line-length
Expand All @@ -121,14 +124,14 @@ preview = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"FBT", # flake8-boolean-trap
"COM812", # flake8-commas: missing-trailing-comma
"CPY", # flake8-copyright
"EM", # flake8-errmsg
"FA100", # flake8-future-annotations: future-rewritable-type-annotation
"T20", # flake8-print
"TC001", # flake8-type-checking: typing-only-first-party-import
"TC003", # flake8-type-checking: typing-only-standard-library-import
"TD003", # flake8-todo: Missing issue link for this TODO
"FIX", # flake8-fixme
]

Expand All @@ -140,6 +143,7 @@ preview = true
"N", # pep8-naming
"D", # pydocstyle
"ANN401", # flake8-annotations: any-type
"S", # flake8-bandit
"A", # flake8-builtins
"DOC", # flake8-docstrings
"PYI054", # flake8-pyi: numeric-literal-too-long
Expand All @@ -153,10 +157,14 @@ preview = true
"PLR6301", # pylint/R: no-self-use
"PLW3201", # pylint/W: bad-dunder-method-name
"FURB", # refurb
# TODO:
"PYI042",
"PYI046",
"PYI047",
# TODO(jorenham): re-enable
"TD", # flake8-todo
]
"src/numpy-stubs/**/*.pyi" = [
# TODO(jorenham): re-enable
"PYI042", # flake8-pyi: snake-case-type-alias
"PYI046", # flake8-pyi: unused-private-protocol
"PYI047", # flake8-pyi: unused-private-type-alias
]

[tool.ruff.lint.flake8-annotations]
Expand Down
7 changes: 6 additions & 1 deletion src/numpy-stubs/f2py/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ class _F2PyDict(_F2PyDictBase, total=False):
fsrc: list[str]
ltx: list[str]

#
def get_include() -> str: ...

#
def run_main(comline_list: Iterable[str]) -> dict[str, _F2PyDict]: ...

#
@overload
def compile(
source: str | bytes,
Expand All @@ -37,4 +43,3 @@ def compile(
*,
full_output: L[True],
) -> subprocess.CompletedProcess[bytes]: ...
def get_include() -> str: ...
6 changes: 3 additions & 3 deletions src/numpy-stubs/polynomial/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Final, Literal

from numpy._pytesttester import PytestTester as _PytestTester

from . import chebyshev, hermite, hermite_e, laguerre, legendre, polynomial
from .chebyshev import Chebyshev
from .hermite import Hermite
Expand All @@ -26,6 +28,4 @@ __all__ = [

def set_default_printstyle(style: Literal["ascii", "unicode"]) -> None: ...

from numpy._pytesttester import PytestTester as _PytestTester

test: Final[_PytestTester]
test: Final[_PytestTester] = ...
Loading
Loading