Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
276 lines (246 loc) · 7.83 KB
/
Copy pathpyproject.toml
File metadata and controls
276 lines (246 loc) · 7.83 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# ---- Project Info and Dependencies ----
[project.urls]
Repository = "https://github.com/sichaohe/canns"
# Homepage = "https://..."
Documentation = "https://routhleck.com/canns"
[project]
name = "canns"
description = "A Python Library for Continuous Attractor Neural Networks"
authors = [
{ name="Sichao He", email="sichaohe@outlook.com" },
]
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.11,<4.0"
dynamic = ["version"]
# https://pypi.org/classifiers/
# Adjust as needed:
classifiers = [
# Adjust as needed:
"Development Status :: 4 - Beta",
# "Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"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",
"Typing :: Typed",
# Include this to avoid accidentally publishing to PyPI:
# "Private :: Do Not Upload",
]
# ---- Main dependencies ----
dependencies = [
"brainpy[cpu]",
"canns-lib>=0.11.0",
"furo>=2025.7.19",
"notebook>=7.4.4",
"tqdm",
"numpy>=1.24,<3",
"numba>=0.56.0",
"scipy>=1.9.0",
"scikit-image>=0.19",
"matplotlib>=3.5",
"h5py>=3.7",
"seaborn>=0.13.2",
"imageio[ffmpeg]>=2.37.0",
"textual>=7.3.0",
"climage>=0.2.2",
"igraph>=1.0.0",
"leidenalg>=0.11.0",
]
# ---- Dev dependencies ----
[dependency-groups]
dev = [
"pytest>=8.3.5",
"pytest-sugar>=1.0.0",
"pytest-cov>=6.0.0",
"ruff>=0.11.9",
"codespell>=2.4.1",
"rich>=14.0.0",
"basedpyright>=1.29.1",
"funlog>=0.2.1",
"jupyter>=1.1.1",
"datasets>=4.4.1",
"sphinx-copybutton>=0.5.2",
]
dev-gui = [
"PySide6>=6.6.0",
"pillow",
"imageio",
"qtawesome",
"pytest-qt",
"requests>=2.31.0",
]
docs = [
"myst-parser>=4.0.1",
"nbsphinx>=0.9.7",
"sphinx>=8.1.3",
"sphinx-autoapi>=3.6.0",
"sphinx-autodoc-typehints>=3.0.1",
"sphinx-design>=0.6.1",
"sphinx-intl>=2.3.1",
"sphinx-rtd-theme>=3.0.2",
"sphinxcontrib-bibtex>=2.6.0",
]
[project.optional-dependencies]
cpu = [
"brainpy[cpu]"
]
cuda12 = [
"brainpy[cuda12]; platform_system == 'Linux'"
]
cuda13 = [
"brainpy[cuda13]; platform_system == 'Linux'"
]
tpu = [
"brainpy[tpu]; platform_system == 'Linux'"
]
gui = [
"PySide6>=6.6.0",
"pillow",
"imageio",
"qtawesome",
"requests>=2.31.0",
]
[project.scripts]
# Add script entry points here:
canns = "canns.__main__:main"
canns-tui = "canns.pipeline.launcher:main"
canns-gallery = "canns.pipeline.gallery:main"
canns-gui = "canns.pipeline.asa_gui:main"
# ---- Build system ----
# Dynamic versioning from:
# https://github.com/ninoseki/uv-dynamic-versioning/
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
# Note JSON schemas don't seem to be right for tool.hatch.version.source so
# this may cause false warnings in IDEs.
# https://github.com/ninoseki/uv-dynamic-versioning/issues/21
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
bump = true
[tool.hatch.build.targets.wheel]
# The source location for the package.
packages = ["src/canns"]
include = [
"src/canns/pipeline/asa_gui/resources/**",
]
[tool.hatch.build.targets.sdist]
# Only include essential files in source distribution
include = [
"/src",
"/README.md",
"/README_zh.md",
"/LICENSE",
"/CHANGELOG.md",
"/CITATION.cff",
"/pyproject.toml",
]
# ---- Settings ----
[tool.ruff]
# Set as desired, typically 88 (black standard) or 100 (wide).
line-length = 100
[tool.ruff.lint]
select = [
# See: https://docs.astral.sh/ruff/rules/
# Basic list from: https://docs.astral.sh/ruff/linter/#rule-selection
"E", # https://docs.astral.sh/ruff/rules/#error-e
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"I", # https://docs.astral.sh/ruff/rules/#isort-i
# Other possibilities:
# "D" # https://docs.astral.sh/ruff/rules/#pydocstyle-d
# "Q" # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
# "COM" # https://docs.astral.sh/ruff/rules/#flake8-commas-com
# "SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
]
ignore = [
# Disable some rules that are overly pedantic. Add/remove as desired:
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file/
"E731", # https://docs.astral.sh/ruff/rules/lambda-assignment/
# We use both ruff formatter and linter so some rules should always be disabled.
# See: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", # https://docs.astral.sh/ruff/rules/tab-indentation/
"E111", # https://docs.astral.sh/ruff/rules/indentation-with-invalid-multiple/
"E114", # https://docs.astral.sh/ruff/rules/indentation-with-invalid-multiple-comment/
"E117", # https://docs.astral.sh/ruff/rules/over-indented/
"D206", # https://docs.astral.sh/ruff/rules/docstring-tab-indentation/
"D300", # https://docs.astral.sh/ruff/rules/triple-single-quotes/
"Q000", # https://docs.astral.sh/ruff/rules/bad-quotes-inline-string/
"Q001", # https://docs.astral.sh/ruff/rules/bad-quotes-multiline-string/
"Q002", # https://docs.astral.sh/ruff/rules/bad-quotes-docstring/
"Q003", # https://docs.astral.sh/ruff/rules/avoidable-escaped-quote/
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"COM819", # https://docs.astral.sh/ruff/rules/prohibited-trailing-comma/
"ISC002", # https://docs.astral.sh/ruff/rules/multi-line-implicit-string-concatenation/
]
[tool.basedpyright]
# BasedPyright currently seems like the best type checker option, much faster
# than mypy and with a good extension for VSCode/Cursor.
# https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright
# https://docs.basedpyright.com/latest/configuration/config-files/#sample-pyprojecttoml-file
include = ["src"]
#exclude = [ ... ]
#include = ["src", "tests", "devtools"]
# By default BasedPyright is very strict, so you almost certainly want to disable
# some of the rules.
# First, these turn off warnings about (yes) how you ignore warnings:
reportIgnoreCommentWithoutRule = false
reportUnnecessaryTypeIgnoreComment = false
# A few typically noisy warnings are next.
# How many you enable is up to you. The first few are off by default, but you can
# comment/uncomment these as desired:
reportMissingTypeStubs = false
reportUnusedCallResult = false
reportAny = false
reportExplicitAny = false
reportImplicitStringConcatenation = false
reportUnreachable = false
# reportPrivateImportUsage = false
# reportPrivateLocalImportUsage = false
# reportMissingImports = false
# reportUnnecessaryIsInstance = false
reportArgumentType = false
reportGeneralTypeIssues = false
reportUnknownArgumentType = false
reportUnknownVariableType = false
reportOperatorIssue = false
[tool.codespell]
# Add here as needed:
# ignore-words-list = "foo,bar"
# skip = "foo.py,bar.py"
[tool.pytest.ini_options]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
testpaths = [
"tests",
]
norecursedirs = []
filterwarnings = []
addopts = "--assert=plain -ra"
markers = [
"integration: tests that exercise multi-module flows or external dependencies",
"visualization: tests that generate plots or graphics",
"slow: tests that are notably slower than unit tests",
]
[tool.coverage.run]
branch = true
source = ["canns"]
[tool.coverage.report]
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
]