|
| 1 | +[build-system] |
| 2 | +requires = ["hatchling"] |
| 3 | +build-backend = "hatchling.build" |
| 4 | + |
| 5 | +[project] |
| 6 | +name = "numpy-stubs" |
| 7 | +version = "2.2.2.0.dev0" |
| 8 | +description = "Official typing stubs for NumPy" |
| 9 | +readme = "README.md" |
| 10 | +authors = [{ name = "Joren Hammudoglu", email = "[email protected]"}] |
| 11 | +maintainers = [{ name = "NumPy Developers", email = "[email protected]"}] |
| 12 | +license = "BSD-3-Clause" |
| 13 | +keywords = ["numpy", "stubs", "typing", "types", "pep484"] |
| 14 | +classifiers = [ |
| 15 | + "Development Status :: 3 - Alpha", |
| 16 | + "Intended Audience :: Developers", |
| 17 | + "License :: OSI Approved :: BSD License", |
| 18 | + "Operating System :: OS Independent", |
| 19 | + "Programming Language :: Python", |
| 20 | + "Programming Language :: Python :: 3", |
| 21 | + "Programming Language :: Python :: 3.10", |
| 22 | + "Programming Language :: Python :: 3.11", |
| 23 | + "Programming Language :: Python :: 3.12", |
| 24 | + "Programming Language :: Python :: 3.13", |
| 25 | + "Typing :: Stubs Only", |
| 26 | + "Typing :: Typed", |
| 27 | +] |
| 28 | +requires-python = ">=3.11" |
| 29 | +dependencies = [] |
| 30 | + |
| 31 | + [project.optional-dependencies] |
| 32 | + numpy = ["numpy>=2.2.2,<2.3"] |
| 33 | + |
| 34 | + [project.urls] |
| 35 | + Homepage = "https://numpy.org/" |
| 36 | + Repository = "https://github.com/jorenham/numpyi/" |
| 37 | + Issues = "https://github.com/jorenham/numpyi/issues" |
| 38 | + Changelog = "https://github.com/jorenham/numpyi/releases" |
| 39 | + |
| 40 | +[dependency-groups] |
| 41 | +numpy = ["numpy-stubs[numpy]"] |
| 42 | +dev = [ |
| 43 | + {include-group = "numpy"}, |
| 44 | + "ruff>=0.9.3", |
| 45 | + "basedmypy[faster-cache]>=2.9.1", |
| 46 | + "basedpyright>=1.24.0", |
| 47 | +] |
| 48 | + |
| 49 | +[tool.hatch.build] |
| 50 | +packages = ["numpy-stubs"] |
| 51 | + |
| 52 | + |
| 53 | +[tool.mypy] |
| 54 | +files = ["src/**/*.py", "src/**/*.pyi"] |
| 55 | +python_version = "3.11" |
| 56 | +strict = true |
| 57 | +disable_bytearray_promotion = true |
| 58 | +disable_memoryview_promotion = true |
| 59 | +enable_error_code = ["ignore-without-code", "truthy-bool"] |
| 60 | + |
| 61 | +# basedmypy only |
| 62 | +warn_unreachable = false |
| 63 | +warn_unused_ignores = false |
| 64 | +disallow_any_explicit = false |
| 65 | + |
| 66 | + |
| 67 | +[tool.pyright] |
| 68 | +include = ["src"] |
| 69 | +ignore = [".venv"] |
| 70 | +venv = ".venv" |
| 71 | +venvPath = "." |
| 72 | +stubPath = "." |
| 73 | +pythonVersion = "3.11" |
| 74 | +pythonPlatform = "All" |
| 75 | +typeCheckingMode = "strict" |
| 76 | + |
| 77 | +deprecateTypingAliases = true |
| 78 | +enableReachabilityAnalysis = false |
| 79 | +enableTypeIgnoreComments = false |
| 80 | +reportCallInDefaultInitializer = true |
| 81 | +reportImplicitOverride = true |
| 82 | +reportImportCycles = true |
| 83 | +reportMissingSuperCall = true |
| 84 | +reportPrivateUsage = false |
| 85 | +reportPropertyTypeMismatch = false |
| 86 | +reportShadowedImports = true |
| 87 | +reportUninitializedInstanceVariable = true |
| 88 | +reportUnnecessaryTypeIgnoreComment = true |
| 89 | + |
| 90 | +# basedpyright only |
| 91 | +failOnWarnings = true |
| 92 | +reportIgnoreCommentWithoutRule = true |
| 93 | +reportImplicitAbstractClass = true |
| 94 | +reportImplicitRelativeImport = true |
| 95 | +reportImplicitStringConcatenation = false |
| 96 | +reportInvalidCast = true |
| 97 | +reportPrivateLocalImportUsage = true |
| 98 | +reportUnannotatedClassAttribute = true |
| 99 | +strictGenericNarrowing = true |
| 100 | + |
| 101 | + |
| 102 | +[tool.ruff] |
| 103 | +src = ["src"] |
| 104 | +extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"] |
| 105 | +force-exclude = true |
| 106 | +# https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#maximum-line-length |
| 107 | +line-length = 130 |
| 108 | +preview = true |
| 109 | + |
| 110 | + [tool.ruff.format] |
| 111 | + docstring-code-format = true |
| 112 | + line-ending = "lf" |
| 113 | + |
| 114 | + [tool.ruff.lint] |
| 115 | + select = ["ALL"] |
| 116 | + ignore = [ |
| 117 | + "COM812", # flake8-commas: missing-trailing-comma |
| 118 | + "CPY", # flake8-copyright |
| 119 | + "EM", # flake8-errmsg |
| 120 | + "FA100", # flake8-future-annotations: future-rewritable-type-annotation |
| 121 | + "T20", # flake8-print |
| 122 | + "TC001", # flake8-type-checking: typing-only-first-party-import |
| 123 | + "TC003", # flake8-type-checking: typing-only-standard-library-import |
| 124 | + "TD003", # flake8-todo: Missing issue link for this TODO |
| 125 | + "FIX", # flake8-fixme |
| 126 | + ] |
| 127 | + |
| 128 | + [tool.ruff.lint.per-file-ignores] |
| 129 | + "*.pyi" = [ |
| 130 | + "E741", # pycodestyle/E: ambiguous-variable-name |
| 131 | + "E742", # pycodestyle/E: ambiguous-class-name |
| 132 | + "E743", # pycodestyle/E: ambiguous-function-name |
| 133 | + "N", # pep8-naming |
| 134 | + "D", # pydocstyle |
| 135 | + "ANN401", # flake8-annotations: any-type |
| 136 | + "A", # flake8-builtins |
| 137 | + "DOC", # flake8-docstrings |
| 138 | + "PYI054", # flake8-pyi: numeric-literal-too-long |
| 139 | + "PYI064", # flake8-pyi: redundant-final-literal |
| 140 | + "PLC2701", # pylint/C: import-private-name |
| 141 | + "PLR0904", # pylint/R: too-many-public-methods |
| 142 | + "PLR0913", # pylint/R: too-many-arguments |
| 143 | + "PLR0917", # pylint/R: too-many-positional-arguments |
| 144 | + "PLR2044", # pylint/R: empty-comment |
| 145 | + "PLR6301", # pylint/R: no-self-use |
| 146 | + "PLW3201", # pylint/W: bad-dunder-method-name |
| 147 | + "FURB", # refurb |
| 148 | + ] |
| 149 | + |
| 150 | + [tool.ruff.lint.flake8-annotations] |
| 151 | + suppress-dummy-args = true |
| 152 | + |
| 153 | + [tool.ruff.lint.flake8-import-conventions] |
| 154 | + banned-from = ["abc", "ctypes", "datetime", "os", "sys", "numpy", "numpy.typing"] |
| 155 | + [tool.ruff.lint.flake8-import-conventions.extend-aliases] |
| 156 | + "ctypes" = "ct" |
| 157 | + "datetime" = "dt" |
| 158 | + "numpy" = "np" |
| 159 | + "numpy.typing" = "npt" |
| 160 | + |
| 161 | + [tool.ruff.lint.isort] |
| 162 | + case-sensitive = true |
| 163 | + combine-as-imports = true |
| 164 | + extra-standard-library = ["_typeshed", "typing_extensions"] |
| 165 | + known-first-party = ["numpy"] |
| 166 | + split-on-trailing-comma = true |
| 167 | + |
| 168 | + [tool.ruff.lint.pydocstyle] |
| 169 | + convention = "numpy" |
| 170 | + |
| 171 | + |
| 172 | +[tool.typos.files] |
| 173 | +extend-exclude = ["*.pyi", ".mypyignore"] |
0 commit comments