Skip to content

Commit 3c3a2e0

Browse files
nstarmanjorenham
andauthored
πŸ”§: add tool config (#11)
* πŸ”§: add tool config Signed-off-by: nstarman <nstarman@users.noreply.github.com> * πŸ”§: update mypy config Signed-off-by: nstarman <nstarman@users.noreply.github.com> * πŸ”§: update ruff config Signed-off-by: nstarman <nstarman@users.noreply.github.com> * πŸ’„: re-style the pyproject.toml Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com> Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com> --------- Signed-off-by: nstarman <nstarman@users.noreply.github.com> Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com> Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
1 parent 9027b7d commit 3c3a2e0

File tree

2 files changed

+460
-13
lines changed

2 files changed

+460
-13
lines changed

β€Žpyproject.toml

Lines changed: 94 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
requires-python = ">=3.10"
77
license = "MIT"
88
authors = [
9-
{name="Consortium for Python Data API Standards", email="data-apis@users.noreply.github.com"},
10-
{name="Joren Hammudoglu", email="jhammudoglu@gmail.com"},
11-
{name="Nathaniel Starkman", email="nstarman@users.noreply.github.com"}
9+
{ name = "Consortium for Python Data API Standards", email = "data-apis@users.noreply.github.com" },
10+
{ name = "Joren Hammudoglu", email = "jhammudoglu@gmail.com" },
11+
{ name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" },
1212
]
1313
classifiers = [
1414
"Development Status :: 1 - Planning",
@@ -28,24 +28,105 @@
2828
dependencies = []
2929

3030
[project.urls]
31-
Changelog = "https://github.com/data-apis/array-api-typing/releases"
32-
Repository = "https://github.com/data-apis/array-api-typing"
31+
Repository = "https://github.com/data-apis/array-api-typing"
32+
Changelog = "https://github.com/data-apis/array-api-typing/releases"
3333

3434

3535
[build-system]
36-
requires = ["hatch-vcs", "hatchling"]
36+
requires = ["hatch-vcs", "hatchling"]
3737
build-backend = "hatchling.build"
3838

3939

4040
[dependency-groups]
41-
test = [
42-
"pytest>=8.3.3",
43-
"pytest-cov >=3",
44-
"pytest-github-actions-annotate-failures",
45-
"sybil>=8.0.0",
46-
]
41+
dev = [
42+
"pre-commit>=4.0.1",
43+
{ include-group = "test" },
44+
]
45+
test = [
46+
"pytest>=8.3.3",
47+
"pytest-cov >=3",
48+
"pytest-github-actions-annotate-failures",
49+
"sybil>=8.0.0",
50+
]
4751

4852

4953
[tool.hatch]
5054
build.hooks.vcs.version-file = "src/array_api_typing/_version.py"
51-
version.source = "vcs"
55+
version.source = "vcs"
56+
57+
58+
[tool.coverage]
59+
report.exclude_also = ['\.\.\.', 'if typing.TYPE_CHECKING:']
60+
run.source = ["array-api-typing"]
61+
run.branch = true
62+
63+
64+
[tool.mypy]
65+
files = ["src", "tests"]
66+
python_version = "3.10"
67+
68+
strict = true
69+
disallow_incomplete_defs = true
70+
disallow_untyped_defs = true
71+
disable_bytearray_promotion = true # Note(2024-12-05): these are private flags
72+
disable_memoryview_promotion = true # Note(2024-12-05): these are private flags
73+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
74+
75+
warn_return_any = true
76+
warn_unreachable = true
77+
warn_unused_configs = true
78+
79+
80+
[tool.pytest.ini_options]
81+
addopts = [
82+
"--showlocals",
83+
"--strict-config",
84+
"--strict-markers",
85+
"-p no:doctest", # using sybil
86+
"-ra",
87+
]
88+
filterwarnings = [
89+
"error",
90+
# Sybil
91+
"ignore:Attribute s is deprecated and will be removed in Python 3\\.14:DeprecationWarning",
92+
"ignore:ast\\.Str is deprecated and will be removed in Python 3\\.14:DeprecationWarning",
93+
]
94+
log_cli_level = "INFO"
95+
minversion = "8.3"
96+
testpaths = ["README.md", "src/", "docs", "tests/"]
97+
norecursedirs = ["docs/_build"]
98+
xfail_strict = true
99+
100+
101+
[tool.ruff]
102+
preview = true
103+
force-exclude = true
104+
105+
[tool.ruff.lint]
106+
extend-select = ["ALL"]
107+
ignore = [
108+
"COM812", # Conflicts with formatter
109+
"CPY", # Missing copyright notice at top of file (NOTE revisit when autofixable)
110+
"D105", # Missing docstring in magic method
111+
"D107", # Missing docstring in __init__
112+
"D203", # 1 blank line required before class docstring
113+
"D213", # Multi-line docstring summary should start at the second line
114+
"FBT", # flake8-boolean-trap
115+
"FIX", # flake8-fixme
116+
"ISC001", # Conflicts with formatter
117+
]
118+
119+
[tool.ruff.lint.flake8-import-conventions]
120+
banned-from = ["array_api_typing"]
121+
122+
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
123+
array_api_typing = "xpt"
124+
125+
[tool.ruff.lint.isort]
126+
combine-as-imports = true
127+
extra-standard-library = ["typing_extensions"]
128+
known-local-folder = ["array_api_typing"]
129+
130+
[tool.ruff.format]
131+
docstring-code-format = true
132+
line-ending = "lf"

0 commit comments

Comments
Β (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy