Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
141 lines (129 loc) · 5.95 KB
/
Copy pathpyproject.toml
File metadata and controls
141 lines (129 loc) · 5.95 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
[build-system]
# nanobind is pinned exactly: downstream modules that derive from pyalps
# types must share its internals ABI, which changes within 2.x minor
# releases (2.10 -> v17, 2.15 -> v21). An unpinned build would let every
# wheel pick up whatever is newest. Bump deliberately, with a full test run,
# and keep the test-requires pin below in step.
requires = ["scikit-build-core>=1.0", "nanobind==2.15.0", "patchelf>=0.14; sys_platform == 'linux'"]
build-backend = "scikit_build_core.build"
[project]
name = "pyalps"
# Inherited from cmake/ALPS_VERSION.txt, the same file
# cmake/ALPSVersion.cmake reads, so a release bump is one edit. A prerelease
# label comes from the ALPS_VERSION_PRERELEASE environment variable, matching
# how CMake takes it from the cache variable of that name. See
# _build_support/alps_version.py.
dynamic = ["version", "scripts"]
description = "Python Applications and Libraries for Physics Simulations"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
dependencies = ["numpy>=1.26", "scipy>=1.13", "matplotlib>=3.8", "lxml>=5"]
authors = [
{ name = "Sergei Iskakov", email = "siskakov@umich.edu" },
{ name = "Fei Lin", email = "feilin.physics@gmail.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"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 :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
]
[project.urls]
Homepage = "https://alps.comp-phys.org"
Repository = "https://github.com/ALPSim/ALPS"
Issues = "https://github.com/ALPSim/ALPS/issues"
[project.optional-dependencies]
plot = ["matplotlib>=3.8"]
test = ["pytest>=8"]
tests = ["pytest>=8", "coverage>=7", "pytest-benchmark>=5"]
mpi = ["mpi4py>=4"]
[[tool.dynamic-metadata]]
provider = { path = "_build_support", module = "alps_version" }
[tool.scikit-build]
cmake.source-dir = "."
wheel.packages = ["src/pyalps", "src/pyalps_cli"]
# Older interpreters retain their own ABI; Python 3.12+ shares one abi3 wheel.
wheel.py-api = "cp312"
wheel.force-include = { "LICENSE.txt" = "${SKBUILD_METADATA_DIR}/licenses/LICENSE.txt" }
build.verbose = true
[tool.scikit-build.cmake.define]
ALPS_DIR = { env = "ALPS_DIR" }
# The SDK owns native implementations; the Python sdist includes its wrappers.
[tool.scikit-build.sdist.force-include]
"../../LICENSE.txt" = "LICENSE.txt"
"../../cmake/ALPS_VERSION.txt" = "ALPS_VERSION.txt"
[tool.cibuildwheel]
# cibuildwheel reuses the abi3 wheel while testing each newer interpreter.
build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
manylinux-x86_64-image = "manylinux_2_28"
test-requires = ["pytest", "h5py", "ninja>=1.12", "nanobind==2.15.0", "scikit-build-core>=1.0"]
# An external watchdog can stop native code even while it holds Python's GIL.
test-command = 'python {project}/.github/scripts/run_with_timeout.py 900 python "{project}/.github/scripts/run_wheel_tests.py"'
# The ALPS C++ SDK is built once per platform in before-all via the distribution
# CMake preset; ALPS_DIR points every wheel build at that install. The ccache
# in _build/ccache spans the SDK and all wheel builds (cached across CI runs).
[tool.cibuildwheel.environment]
PIP_ONLY_BINARY = ":all:"
ALPS_DIR = "$(pwd)/_build/distribution/install/share/alps"
CMAKE_PREFIX_PATH = "$(pwd)/_build/boost-install"
CCACHE_DIR = "$(pwd)/_build/ccache"
CCACHE_NAMESPACE = "pyalps-wheel"
CCACHE_MAXSIZE = "256M"
CMAKE_C_COMPILER_LAUNCHER = "ccache"
CMAKE_CXX_COMPILER_LAUNCHER = "ccache"
PYALPS_TEST_DOWNSTREAM_EXPORT = "1"
# The bundled XDR implementation uses portable C11 on glibc and musl.
[tool.cibuildwheel.linux]
environment-pass = ["GITHUB_REF", "ALPS_VERSION_PRERELEASE", "CMAKE_BUILD_PARALLEL_LEVEL"]
before-all = [
"if command -v dnf >/dev/null 2>&1; then dnf install -y ccache eigen3-devel hdf5-devel lapack-devel; else apk add --no-cache boost-dev ccache eigen-dev hdf5-dev lapack-dev; fi",
"python -m pip install 'cmake>=3.27' 'ninja>=1.12'",
"cd {project}",
"ccache --zero-stats",
"if command -v dnf >/dev/null 2>&1; then ALPS_BOOST_MPI=OFF python .github/scripts/prepare_dependencies.py boost-1.91.0 _build/boost-install; fi",
"cmake --preset distribution",
"cmake --build --preset distribution -j4",
"ccache --show-stats || true",
]
repair-wheel-command = [
# patchelf 0.17 can corrupt non-PIE executables during auditwheel repair.
"python -m pip install --only-binary=:all: wheel patchelf==0.19.1.0",
"patchelf --version",
# Boost's transitive libraries need the same search path as its direct ones.
# Scope this to repair so installed-wheel tests cannot use the build prefix.
'LD_LIBRARY_PATH="$(pwd)/_build/boost-install/lib" auditwheel repair -w {dest_dir} {wheel}',
"python {project}/python/pyalps/_build_support/runtime_manifest.py --wheel {dest_dir}/*.whl",
"auditwheel show {dest_dir}/*.whl",
]
[tool.cibuildwheel.macos]
before-all = [
"brew install --force-bottle boost ccache cmake eigen hdf5 ninja",
"brew list --versions boost",
"cd {project}",
"ccache --zero-stats",
"cmake --preset distribution -DHDF5_ROOT=$(brew --prefix hdf5) -DBoost_ROOT=$(brew --prefix boost)",
"cmake --build --preset distribution -j2",
"ccache --show-stats || true",
]
repair-wheel-command = [
"python -m pip install wheel",
'python -m delocate.cmd.delocate_wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}',
"python {project}/python/pyalps/_build_support/runtime_manifest.py --wheel {dest_dir}/*.whl",
"delocate-listdeps --all {dest_dir}/*.whl",
]
[[tool.cibuildwheel.overrides]]
select = "*-macosx_*"
inherit.environment = "append"
environment = { CXXFLAGS = "-stdlib=libc++" }