-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
122 lines (112 loc) · 3.01 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
[project]
name = "quantity"
description = "Add units to any array-api compatible class"
requires-python = ">=3.11"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { file = "licenses/LICENSE.rst" }
authors = [
{ name = "The Astropy Developers", email = "[email protected]" }
]
dependencies = [
"array-api-compat>=1.9.1",
"astropy>=7.0",
"numpy>=2.0",
]
dynamic = ["version"]
[project.optional-dependencies]
# Include other array types than numpy/array-api-strict. Mostly for tests.
all = [
"dask>=2024.11.2",
"jax>=0.4.35",
]
test = [
"pytest",
"pytest-doctestplus",
"pytest-cov",
"array-api-strict",
]
docs = [
"sphinx",
"sphinx-automodapi",
]
[project.urls]
repository = "https://github.com/astropy/quantity-2.0"
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/quantity/_version.py"
build.hooks.vcs.template = '''
# This file is automatically generated by Hatch
__all__ = ["version", "version_info"]
version = {version!r}
version_tuple = {version_tuple!r}
'''
targets.sdist.only-include = ["src", "licenses", "README.rst"]
[tool.pytest.ini_options]
testpaths = [
"tests",
"quantity", # for doctests
"docs",
]
norecursedirs = [
"docs[\\/]_build",
"docs[\\/]generated",
]
doctest_plus = "enabled"
text_file_format = "rst"
addopts = "--doctest-rst"
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about packages we have installed
"except ImportError",
# Don't complain if tests don't hit assertions
"raise AssertionError",
"raise NotImplementedError",
# Don't complain about script hooks
"def main(.*):",
# Ignore branches that don't pertain to this version of Python
"pragma: py{ignore_python_version}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
# typing.TYPE_CHECKING is False at runtime
"if TYPE_CHECKING:",
# Ignore typing overloads
"@overload",
]
[tool.ruff.lint]
extend-select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # errors
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"NPY", # NumPy specific rules
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
]
ignore = [
"ISC001", # Conflicts with formatter
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"RET505", # Unnecessary `else`/`elif` after `return` statement
"RUF022", # `__all__` is not sorted
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
"noxfile.py" = ["T20"]