-
Notifications
You must be signed in to change notification settings - Fork 400
Expand file tree
/
Copy pathpyproject.toml
More file actions
308 lines (282 loc) · 9.17 KB
/
pyproject.toml
File metadata and controls
308 lines (282 loc) · 9.17 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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
[build-system]
requires = ["scikit-build-core",
"cython>=0.28.3",
"setuptools>=61",
"wheel"
]
build-backend = "scikit_build_core.build"
[project]
name = "nest-simulator"
dynamic = ["version"]
description = "NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons."
keywords = ["nest", "simulator", "neuroscience", "neural", "neuron", "network", "ai", "spike", "spiking"]
readme = "README.md"
license.file = "LICENSE"
authors = [
{ name = "NEST Initiative", email = "users@nest-simulator.org" },
]
maintainers = [
{ name = "Steffen Graber", email = "s.graber@fz-juelich.de" },
]
requires-python = ">=3.9, <4.0"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: C++",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
dependencies = [
"cython >= 0.28.3",
"numpy",
"matplotlib"
]
[project.optional-dependencies]
server = [
"Flask",
"flask-cors",
"gunicorn",
"requests",
"RestrictedPython"
]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
"flake8",
"black",
"isort",
"mypy",
"scipy",
"pandas"
]
docs = [
"sphinx >= 6.2.1",
"sphinx_rtd_theme",
"sphinx_autobuild",
"sphinx_gallery",
"sphinx-tabs",
"sphinx_design",
"sphinx-material",
"sphinx-copybutton",
"sphinx-carousel",
"sphinx-notfound-page",
"sphinxcontrib-mermaid",
"sphinxcontrib-plantuml",
"nbsphinx",
"numpydoc",
"example",
"Image",
"breathe",
"csvkit",
"docutils",
"PyYAML >= 4.2b1",
"tqdm",
"yamllint"
]
examples = [
"networkx",
"seaborn",
"ipython",
"cycler",
"imageio",
"requests"
]
sonata = [
"h5py>=3.8.0",
]
full = [
# Examples dependencies
"networkx", "seaborn", "ipython", "cycler", "imageio", "requests",
# Sonata support
"h5py>=3.8.0",
# Additional tools
"nestml", "nest-desktop",
# Nest server dependencies
"Flask", "flask-cors", "gunicorn", "requests", "RestrictedPython",
# Development tools
"jupyter", "jupyterlab", "notebook"
]
[project.urls]
Homepage = "https://nest-simulator.org/"
Documentation = "https://nest-simulator.readthedocs.io/en/stable/"
"Bug Tracker" = "https://github.com/nest/nest-simulator/issues"
Changelog = "https://nest-simulator.readthedocs.io/en/stable/whats_new/index.html"
[tool.scikit-build]
sdist.cmake = false
build-dir = "build/{wheel_tag}"
metadata.version.provider = "scikit_build_core.metadata.regex"
metadata.version.input = "VERSION"
metadata.version.regex = "(?P<value>.*)"
# Conditional exclusions based on package type
wheel.exclude = [
".git*", # Always exclude git files
".github/", # Always exclude CI configuration
"build_support/", # Always exclude build tools
"docs/", # Exclude docs from package
]
[tool.scikit-build.cmake.define]
with-optimize = "-O2"
with-warning = "ON"
with-python = "ON"
with-boost = "ON"
with-gsl = "ON"
with-openmp = "ON"
[tool.cibuildwheel]
build-frontend = "default"
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
skip = "*-win* *-manylinux_i686" # Skip
test-skip = ""
test-requires = [
"isort",
"junitparser",
"matplotlib",
"mypy",
"numpy",
"pandas",
"pytest",
"pytest-cov",
"pytest-xdist",
]
test-command = """
python <<'EOF'
import nest
nest.ResetKernel()
print('NEST kernel reset successful')
n = nest.Create('iaf_psc_alpha')
print(f'Created neuron: {n}')
try:
import nest.lib.hl_api_sonata
print('Sonata support: AVAILABLE')
except ImportError:
print('Sonata support: NOT AVAILABLE')
EOF
"""
archs = ["auto64"]
config-settings = {}
dependency-versions = "pinned"
environment-pass = ["CIBW_BUILD_VERBOSITY", "PIP_PREFER_BINARY", "PIP_ONLY_BINARY", "PIP_NO_BUILD_ISOLATION"]
build-verbosity = 1
before-all = """
set -e
export MAKEFLAGS="-j2"
NEST_SRC_DIR=${PWD}
# Clean up any existing build artifacts
rm -rf build/ *.so *.c 2>/dev/null || true
if [[ "$OSTYPE" == "darwin"* ]]; then
# Use uname -m instead of arch for macOS architecture detection
ARCH=$(uname -m)
echo "=== macOS $ARCH Setup ==="
echo "Architecture: $ARCH | OS: $OSTYPE"
# Determine correct Homebrew paths based on architecture
if [[ "$ARCH" == "arm64" ]]; then
# Apple Silicon - uses /opt/homebrew
EXPECTED_BREW_PREFIX="/opt/homebrew"
echo "Detected Apple Silicon (ARM64) - using $EXPECTED_BREW_PREFIX"
elif [[ "$ARCH" == "x86_64" ]]; then
# Intel - uses /usr/local
EXPECTED_BREW_PREFIX="/usr/local"
echo "Detected Intel ($ARCH) - using $EXPECTED_BREW_PREFIX"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
# Install dependencies and configure OpenMP
brew install llvm libomp gsl libtool open-mpi graphviz ncurses cmake hdf5
brew install boost@1.85
brew link boost@1.85 --force
brew link --force libomp
# Get actual Homebrew prefix and verify it matches expected
HOMEBREW_PREFIX=$(brew --prefix)
echo "Homebrew prefix: $HOMEBREW_PREFIX (expected: $EXPECTED_BREW_PREFIX)"
# Verify Homebrew installation location matches architecture
if [[ "$HOMEBREW_PREFIX" != "$EXPECTED_BREW_PREFIX" ]]; then
echo "Warning: Homebrew prefix mismatch. Expected $EXPECTED_BREW_PREFIX, got $HOMEBREW_PREFIX"
echo "Continuing with detected path: $HOMEBREW_PREFIX"
fi
# Configure build environment with detected paths
export LDFLAGS="-L$HOMEBREW_PREFIX/lib"
export CPPFLAGS="-I$HOMEBREW_PREFIX/include"
# Dynamic path configuration for specific packages
export LIBOMP_PATH=$(brew --prefix libomp)
export LLVM_PATH=$(brew --prefix llvm)
export BOOST_ROOT=$(brew --prefix boost)
export HDF5_ROOT=$(brew --prefix hdf5)
# Verify OpenMP installation
[[ -f "$LIBOMP_PATH/lib/libomp.dylib" ]] || {
echo "OpenMP not found at $LIBOMP_PATH/lib/libomp.dylib"
exit 1
}
# Configure CMake arguments for macOS build with HDF5 support
export CMAKE_ARGS="${CMAKE_ARGS} -Dwith-hdf5=ON -DHDF5_ROOT=$HDF5_ROOT"
echo "macOS $ARCH setup complete with Homebrew at $HOMEBREW_PREFIX"
elif [ "${AUDITWHEEL_POLICY:-}" = "musllinux_1_2" ]; then
apk add --no-cache git libc6-compat gsl gsl-dev wget bzip2 cmake boost-dev hdf5-dev
export CMAKE_ARGS="${CMAKE_ARGS} -Dwith-hdf5=ON"
elif command -v yum >/dev/null 2>&1; then
yum install -y git glibc glibc-devel gsl gsl-devel wget bzip2 cmake make gcc gcc-c++ gcc-gfortran
export PIP_PREFER_BINARY=1
export PIP_ONLY_BINARY="scipy,numpy,pandas"
wget -q https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.bz2
tar --bzip2 -xf boost_1_88_0.tar.bz2
cd boost_1_88_0
./bootstrap.sh --with-libraries=system,filesystem,program_options
./b2 -j2 --prefix=/usr/local install
cd ..
rm -rf boost_1_88_0*
export CMAKE_ARGS="${CMAKE_ARGS} -Dwith-hdf5=OFF"
elif command -v apt-get >/dev/null 2>&1; then
apt-get update
apt-get install -y git build-essential gsl-bin libgsl-dev wget bzip2 cmake libboost-all-dev libhdf5-dev
export CMAKE_ARGS="${CMAKE_ARGS} -Dwith-hdf5=ON"
else
echo "Unknown package manager, trying to continue..."
export CMAKE_ARGS="${CMAKE_ARGS} -Dwith-hdf5=OFF"
fi
echo "Final CMAKE_ARGS: $CMAKE_ARGS"
"""
# macOS deployment target configuration matching Homebrew libraries
[[tool.cibuildwheel.overrides]]
select = "*-macos*"
inherit.environment = "append"
environment = { MACOSX_DEPLOYMENT_TARGET = "15.0" } # Changed for modern compatibility
# Add scipy back for macOS builds where it works reliably
test-requires = [
"isort",
"junitparser",
"matplotlib",
"mypy",
"numpy",
"pandas",
"pytest",
"pytest-cov",
"pytest-xdist",
"scipy",
]
[tool.pytest.ini_options]
markers = [
"skipif_missing_gsl: skip test if NEST was built without GSL support",
"skipif_missing_hdf5: skip test if NEST was built without HDF5 support",
"skipif_missing_mpi: skip test if NEST was built without MPI support",
"skipif_missing_threads: skip test if NEST was built without multithreading support",
"skipif_incompatible_mpi: skip test if NEST was built with OpenMPI < 5.0.7",
"simulation: the simulation class to use. Always pass a 2nd dummy argument"
]
[tool.isort]
profile = "black"
known_third_party = "nest"
[tool.black]
line-length = 120