-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathpyproject.toml
More file actions
187 lines (171 loc) · 5.63 KB
/
Copy pathpyproject.toml
File metadata and controls
187 lines (171 loc) · 5.63 KB
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
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "brainpy"
description = "BrainPy: Brain Dynamics Programming in Python"
readme = "README.md"
requires-python = ">=3.11"
authors = [
{ name = "BrainPy Team", email = "chao.brain@qq.com" }
]
classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries",
]
keywords = [
"computational neuroscience",
"brain-inspired computation",
"brain modeling",
"brain dynamics modeling",
"brain dynamics programming"
]
dependencies = [
"numpy>=1.15",
"jax",
"tqdm",
"brainstate>=0.5.1",
"brainunit>=0.2.0",
"brainevent>=0.0.7",
"braintools>=0.3.0",
'brainpy_state>=0.0.3',
]
dynamic = ['version']
[project.urls]
"Bug Tracker" = "https://github.com/brainpy/BrainPy/issues"
"Documentation" = "https://brainpy.readthedocs.io/"
"Source Code" = "https://github.com/brainpy/BrainPy"
[project.optional-dependencies]
cpu = ["jax[cpu]", 'brainevent[cpu]']
cuda12 = ["jax[cuda12]", 'brainevent[cuda12]']
cuda13 = ["jax[cuda13]", 'brainevent[cuda13]']
tpu = ["jax[tpu]", 'brainevent[tpu]']
[tool.setuptools]
package-dir = { "" = "." }
[tool.setuptools.package-data]
# PEP 561: ship the inline type information marker so downstream type checkers
# consume BrainPy's annotations.
brainpy = ["py.typed"]
[tool.setuptools.packages.find]
where = ["."]
exclude = [
"lib*",
"dev*",
"docs*",
"tests*",
"docker*",
"examples*",
"scripts",
"images",
"dist*",
"bug*",
]
[tool.setuptools.dynamic]
version = { attr = "brainpy.__version__" }
# ---------------------------------------------------------------------------
# Docstring style
# ---------------------------------------------------------------------------
# BrainPy standardizes on NumPy-style docstrings (see CLAUDE.md and the napoleon
# settings in docs/conf.py). This records the convention as a single source of
# truth so ``pydocstyle`` / ``ruff --select D`` enforce the NumPy style on demand.
[tool.pydocstyle]
convention = "numpy"
[tool.coverage.run]
# Measure coverage of the library source only -- never of the test files
# themselves (a test file's lines are not "product code", and several
# co-located ``*_test.py`` files are intentionally disabled via a module-level
# ``pytest.skip`` and would otherwise inflate the denominator with dead lines).
omit = [
"*_test.py",
"*/tests/*",
"brainpy/_version.py",
]
[tool.coverage.report]
omit = [
"*_test.py",
"*/tests/*",
"brainpy/_version.py",
]
# Exclude only genuinely-unreachable-under-test lines. These are standard,
# defensible exclusions (not metric gaming): module ``__main__`` guards never
# run under pytest, ``TYPE_CHECKING`` blocks are import-time only, abstract
# methods and ``NotImplementedError`` stubs have no body to exercise.
exclude_also = [
"pragma: no cover",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"raise NotImplementedError",
"@(abc\\.)?abstractmethod",
"def __repr__",
]
# ---------------------------------------------------------------------------
# Static type checking (mypy)
# ---------------------------------------------------------------------------
# BrainPy is a large (~74K LOC), JAX-based scientific library. Strict, fully
# type-checked coverage of the whole code base is a long-term effort. To make
# that effort incremental *and* enforceable, mypy is configured to:
#
# * type-check ONLY a curated, fully-annotated subset of modules (``files``),
# * apply strict rules to exactly that subset (the ``overrides`` block),
# * resolve imports into the rest of the package silently
# (``follow_imports = "silent"``) so the unchecked majority neither blocks
# nor pollutes the curated check.
#
# CI runs a bare ``mypy`` (no arguments); it picks up ``files`` from here, so the
# curated set lives in exactly one place. Grow ``files`` (and the override
# ``module`` list) as more modules are fully typed.
[tool.mypy]
python_version = "3.11"
ignore_missing_imports = true
follow_imports = "silent"
warn_unused_ignores = true
warn_redundant_casts = true
show_error_codes = true
files = [
"brainpy/_errors.py",
"brainpy/types.py",
"brainpy/tools/__init__.py",
"brainpy/tools/codes.py",
"brainpy/tools/dicts.py",
"brainpy/tools/functions.py",
"brainpy/tools/install.py",
"brainpy/tools/math_util.py",
"brainpy/tools/others.py",
"brainpy/tools/package.py",
"brainpy/tools/progress.py",
]
# Strict enforcement for the curated subset only.
[[tool.mypy.overrides]]
module = [
"brainpy._errors",
"brainpy.types",
"brainpy.tools",
"brainpy.tools.codes",
"brainpy.tools.dicts",
"brainpy.tools.functions",
"brainpy.tools.install",
"brainpy.tools.math_util",
"brainpy.tools.others",
"brainpy.tools.package",
"brainpy.tools.progress",
]
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_return_any = true
disallow_any_generics = true
strict_equality = true