-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
192 lines (169 loc) · 5.32 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "array_api"
version = "0.1.0"
description = "Array API dispatcher."
readme = "README.rst"
requires-python = ">=3.10"
license = {file = "LICENSE"}
keywords = ["numpy", "interoperability"]
authors = [
{name = "Nathaniel Starkman", email = "n.starkman@mail.utoronto.ca"}
]
maintainers = [
{name = "Nathaniel Starkman", email = "n.starkman@mail.utoronto.ca"}
]
classifiers = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = []
[project.optional-dependencies]
all = []
test = [
"coverage[toml]",
"numpy>=1.18",
"pytest",
"pytest-astropy",
"typing_extensions>=4.4",
]
docs = [
"graphviz",
"IPython",
"jupyter_client",
"nbsphinx",
"pydata-sphinx-theme",
"sphinx",
"sphinx-astropy",
"sphinxcontrib.bibtex < 2.0.0",
"tomlkit",
]
[project.urls]
homepage = "https://github.com/nstarman/array_api"
repository = "https://github.com/nstarman/array_api"
documentation = "https://github.com/nstarman/array_api"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/array_api/_version.py"
metadata.allow-direct-references = true
[tool.hatch.env.default]
features = ["test"]
scripts.test = "pytest {args}"
[tool.cibuildwheel]
build-verbosity = 1
# So these are the environments we target:
# - Python: CPython 3.10+ only
# - Architecture (64-bit only): amd64 / x86_64, universal2, and arm64
# - OS: Linux (no musl), Windows, and macOS
build = "cp3*-*"
skip = ["*-manylinux_i686", "*-musllinux_*", "*-win32", "pp-*"]
before-build = ["pip install -r .github/mypyc-requirements.txt"]
# This is the bare minimum needed to run the test suite. Pulling in the full
# test_requirements.txt would download a bunch of other packages not necessary
# here and would slow down the testing step a fair bit.
test-requires = ["pip install -r .github/test-requirements.txt"]
test-command = 'pytest {project}/tests -v -k "not incompatible_with_mypyc"'
# Skip trying to test arm64 builds on Intel Macs. (so cross-compilation doesn't
# straight up crash)
test-skip = ["*-macosx_arm64", "*-macosx_universal2:arm64"]
[tool.cibuildwheel.environment]
CIBW_BUILD_VERBOSITY = "1"
NPOVERLOAD_USE_MYPYC = "1"
MYPYC_OPT_LEVEL = "3"
MYPYC_DEBUG_LEVEL = "0"
# The dependencies required to build wheels with mypyc aren't specified in
# [build-system].requires so we'll have to manage the build environment ourselves.
PIP_NO_BUILD_ISOLATION = "no"
[tool.cibuildwheel.linux]
before-build = [
"pip install -r .github/mypyc-requirements.txt",
"yum install -y clang",
]
[tool.cibuildwheel.linux.environment]
CIBW_BUILD_VERBOSITY = "1"
NPOVERLOAD_USE_MYPYC = "1"
MYPYC_OPT_LEVEL = "3"
MYPYC_DEBUG_LEVEL = "0"
PIP_NO_BUILD_ISOLATION = "no"
[tool.cibuildwheel.windows]
before-build = ["pip install -r .github/mypyc-requirements.txt"]
[tool.black]
line-length = 80
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.coverage.run]
omit = [
"*/overload_numpy/conftest.py",
"*setup_package*",
"*/overload_numpy/tests/*",
]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
# and branches that don't pertain to this version of Python
"pragma: no cover",
"pragma: py{ignore_python_version}",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
'@(abc\.)?abstractmethod',
# Exclude type check blocks and Protocol contents, they aren't run:
"if TYPE_CHECKING:",
'\.\.\.',
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
]
[tool.ruff]
select = ["ALL"]
ignore = [
"A001", "A002", "A003", # shadowing a built-in
"ANN101", # Missing type annotation for self in method
"COM812", # Missing trailing comma
"D200", # One-line docstring should fit on one line
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D401", # First line should be in imperative mood
"F403", # 'from module import *' used; unable to detect undefined names
"PD", # Pandas
"PLE0605", # Invalid format for `__all__`, must be `tuple` or `list`
"PLR0913", # Too many arguments to function call
]
line-length = 80
[tool.mypy]
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
warn_return_any = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
exclude = '''(^|/)tests/'''
plugins = []
python_version = "3.10"
[[tool.mypy.overrides]]
module = "*/tests/*"
ignore_errors = true
[[tool.mypy.overrides]]
module = "tests/*"
ignore_errors = true