-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
182 lines (158 loc) · 4.47 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
[project]
name = "cosmology.api"
version = "0.1.1.dev"
description = "Cosmology API standard"
readme = "README.rst"
requires-python = ">=3.9"
license = {file = "LICENSE.txt"}
keywords = ["cosmology", "API"]
authors = [
{name = "Nathaniel Starkman", email = "[email protected]"},
{name = "Nicolas Tessore", email = "[email protected]"}
]
maintainers = [
{name = "Nathaniel Starkman", email = "[email protected]"},
{name = "Nicolas Tessore", email = "[email protected]"}
]
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.21",
"packaging",
"pytest",
"pytest-cov",
"sybil",
"typing_extensions",
]
docs = [
"furo",
"numpydoc",
"sphinx",
"sphinx-copybutton",
"sybil",
"tomli",
"typing_extensions",
]
[project.urls]
homepage = "https://cosmology.readthedocs.org/projects/api"
repository = "https://github.com/cosmology-api/cosmology.api"
documentation = "https://cosmology.readthedocs.org/projects/api"
[build-system]
requires = [
"mypy>=0.991",
"setuptools>=45.0",
"setuptools_scm[toml]>=6.3.1",
"wheel",
]
build-backend = 'setuptools.build_meta'
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools_scm]
[tool.coverage.run]
omit = ["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.mypy]
python_version = 3.9
namespace_packages = true
explicit_package_bases = true
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
strict = true
disallow_subclassing_any = false
disallow_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unreachable = true
exclude = '''(^|/)tests/|(^/)docs/|(^/)conftest\.py'''
[[tool.mypy.overrides]]
module = [
"tests/*",
"docs/*",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"sybil.*",
"tomli.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = 7.0
testpaths = [
"tests",
"src/cosmology",
"docs",
]
addopts = "-p no:doctest"
markers = [
"incompatible_with_mypyc: run when testing mypyc compiled code",
]
filterwarnings = [
# tomlkit
"ignore:The config value",
# NumPy
"ignore:The numpy.array_api submodule is still experimental. See NEP 47.:UserWarning",
]
[tool.ruff]
target-version = "py39"
line-length = 88
select = ["ALL"]
ignore = [
"ANN101", # Missing type annotation for {name} in method # TODO: report to Ruff
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"COM812", # trailing-comma-missing
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line of docstring should be in imperative mood
"FBT003", # Boolean positional value in function call
"FIX002", # Line contains TODO,
"N802", # Function name {name} should be lowercase
"PD", # pandas-vet
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
]
[tool.ruff.per-file-ignores]
"src/cosmology/api/_array_api/*.py" = ["A002", "A003", "D212", "D205", "E501", "N801"]
"docs/*.py" = ["INP001"]
"tests/*.py" = [
"ANN",
"PLR0913", # Too many arguments to function call
"TID252",
]
"test_*.py" = ["D", "N8", "S101"]
[tool.ruff.isort]
forced-separate = ["tests"]
required-imports = ["from __future__ import annotations"]