-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
183 lines (160 loc) · 6.29 KB
/
Copy pathpyproject.toml
File metadata and controls
183 lines (160 loc) · 6.29 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
# Copyright 2025 BrainX Ecosystem Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.package-data]
# Include CUDA source files (.cu) and header files (.h) so they are bundled in the wheel and
# available at runtime via Path(__file__).parent / 'name.cu'.read_text().
# The wildcard key "*" applies to every discovered package/subpackage.
"*" = ["*.cu", "*.h"]
# Explicitly include nested C++ headers (brainevent/ subdir is 2 levels deep in include/).
# "py.typed" is the PEP 561 marker that tells downstream type checkers brainevent ships
# inline type information; it must be bundled in the wheel to have any effect.
"brainevent" = ["include/brainevent/*.h", "py.typed"]
[tool.setuptools.packages.find]
exclude = [
"dev*",
"docs*",
"tests*",
"examples*",
"experiments*",
"benchmark*",
"build*",
"dist*",
"brainevent.egg-info*",
"brainevent/__pycache__*",
"brainevent/__init__.py"
]
[tool.setuptools.dynamic]
version = { attr = "brainevent._version.__version__" }
[project]
name = "brainevent"
description = "Enabling Event-driven Computation in CPU/GPU/TPU."
readme = 'README.md'
requires-python = '>=3.11'
authors = [{ name = 'BrainEvent Developers', email = 'chao.brain@qq.com' }]
dynamic = ["version"]
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',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development :: Libraries',
]
keywords = [
'computational neuroscience',
'brain-inspired computing',
'brain simulation',
'brain modeling',
'event-driven computation',
'spiking neural networks',
'neuromorphic computing',
'dynamic sparsity',
]
dependencies = [
'numpy>=2.0',
'brainunit>=0.0.8',
# No upper bound: the XLA FFI ABI (XLA_FFI_API_MINOR, ffi.h layout) used by
# the compiled kernels can change across minor releases, but the numba FFI
# bridge now detects the installed jaxlib's ABI version at runtime
# (``_detect_xla_ffi_api_version``) and warns when jax is newer than the
# validated range (``_warn_if_untested_jax`` in ``_op/numba_ffi.py``),
# instead of pinning a hard ceiling here.
'jax>=0.8.0',
]
[project.urls]
homepage = 'https://github.com/chaobrain/brainevent'
repository = 'https://github.com/chaobrain/brainevent'
"Bug Tracker" = 'https://github.com/chaobrain/brainevent/issues'
"Documentation" = 'https://brainx.chaobrain.com/brainevent/'
"Source Code" = 'https://github.com/chaobrain/brainevent'
[project.scripts]
brainevent = "brainevent._cli:main"
[project.optional-dependencies]
# Lower bound mirrors the core 'jax' pin above; no upper bound — FFI ABI
# compatibility is checked at runtime (see the core 'jax' dependency note).
cpu = ['jax[cpu]>=0.8.0', 'numba']
cuda12 = ['jax[cuda12]>=0.8.0']
cuda13 = ['jax[cuda13]>=0.8.0']
tpu = ['jax[tpu]>=0.8.0']
testing = ['pytest', 'pytest-cov']
[tool.pytest.ini_options]
# Local runs skip the `slow` marker by default. `slow` covers compilation-heavy backend
# variants (numba / native kernels) that recompile per test and dominate wall-clock. The
# marker is applied automatically by the root conftest.py based on the backend parameter.
#
# Run the FULL suite (including slow variants) with: pytest -m ""
# Run ONLY the slow variants with: pytest -m slow
# CI runs the full suite (see .github/workflows/CI.yml).
testpaths = ["brainevent"]
addopts = "-m 'not slow'"
markers = [
"slow: compilation-heavy backend variants (numba/native); deselected by default, run in CI via `pytest -m ''`",
]
[tool.mypy]
# Configuration for the mypy CI gate (see .github/workflows/CI.yml `type_check`).
#
# The gate runs with ONLY mypy installed (no runtime deps), so every third-party
# import must resolve to `Any` via ignore_missing_imports. python_version and
# platform are pinned so the mypy verdict reproduces exactly on CI.
files = ["brainevent"]
exclude = ['_test\.py$']
python_version = "3.13"
platform = "linux"
ignore_missing_imports = true
show_error_codes = true
[tool.coverage.run]
# Measure line coverage of the importable package only. Test modules, throwaway
# benchmark helpers and the pure-CUDA ``.cu`` sources (not Python, hence invisible
# to coverage.py) are excluded so the reported figure reflects exercised library code.
source = ["brainevent"]
branch = false
omit = [
"*/_test.py",
"*_test.py",
"brainevent/test_util.py",
"brainevent/_test_util.py",
"brainevent/**/test_util.py",
"brainevent/_op/benchmark.py",
"brainevent/pararnn/_benchmark.py",
]
[tool.coverage.report]
# Lines that are unreachable-by-design or environment-gated should not count against
# coverage. ``skip_covered`` keeps the terminal report focused on the gaps.
show_missing = true
precision = 2
exclude_also = [
"def __repr__",
"raise NotImplementedError",
"raise AssertionError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
"@(typing\\.)?overload",
"pragma: no cover",
]
[tool.coverage.paths]
# Treat the repo checkout and any installed copy as the same source so coverage data
# combined across environments (local + CI) maps back to a single set of files.
source = ["brainevent/", "*/site-packages/brainevent/"]