-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpyproject.toml
247 lines (219 loc) · 7.31 KB
/
pyproject.toml
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
[build-system]
requires = [
"setuptools>=64",
"setuptools_scm[toml]>=8",
"scikit-build-core[pyproject]",
"cython>=3.0,<3.1",
# Build Libraries
"numpy>=1.24,<2.2",
"pyarrow==18.1.0",
"mpi4py>=3.1,<3.2",
"pip"
]
build-backend = "scikit_build_core.build"
[project]
name = "bodo"
dynamic = ["version"]
description = "High-Performance Python Compute Engine for Data and AI"
readme = "README.md"
requires-python = ">=3.10,<3.13"
keywords = ["data", "analytics", "cluster"]
authors = [{ name = "Bodo.ai" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Compilers",
"Topic :: System :: Distributed Computing",
]
dependencies = [
"numba==0.61.0",
"pyarrow==18.1.0",
"pandas>=2.2,<2.3",
"numpy>=1.24,<2.2",
# fsspec >= 2021.09 because it includes Arrow filesystem wrappers (useful for fs.glob() for example)
"fsspec>=2021.09",
"requests",
"cloudpickle>=3.0,<4.0",
"psutil",
]
[project.urls]
Homepage = "https://bodo.ai"
Documentation = "https://docs.bodo.ai"
Repository = "https://github.com/bodo-ai/Bodo"
[project.optional-dependencies]
hdf5 = ["h5py"]
sklearn = ["scikit-learn==1.4.*"]
plot = ["matplotlib <=3.8.2"]
s3fs = ["s3fs >=2022.1.0"]
adlfs = ["adlfs >=2022.1.0"]
gcsfs = ["gcsfs >=2022.1.0"]
snowflake = ["snowflake-connector-python"]
mysql = ["sqlalchemy", "PyMySQL"]
postgres = ["sqlalchemy", "psycopg2"]
oracle = ["sqlalchemy", "cx-Oracle", "libaio"]
huggingface_hub = ["huggingface_hub"]
# -------------------------- CMake Config -------------------------- #
# Must Include to Enable
[tool.setuptools_scm]
[tool.scikit-build]
cmake.version = ">=3.23"
strict-config = true
experimental = false
ninja.make-fallback = false
cmake.build-type = "Release"
build.verbose = true
logging.level = "INFO"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
build-dir = "build/type_{build_type}"
wheel.exclude = [
"bodo/**/*.h",
"bodo/**/*.cpp",
"bodo/**/*.c",
"bodo/**/*.pxd",
"bodo/**/*.pyx",
"bodo/**/*.hpp",
"bodo/bench",
"bodo/transforms/**/*.pyc",
"bodo/tests/*",
]
[tool.scikit-build.cmake.define]
MPICH_VERSION = "4.1.3"
# When building for Conda, set different
# arguments for CMake
[[tool.scikit-build.overrides]]
if.state = "editable"
cmake.build-type = "RelWithDebInfo"
build.verbose = false
wheel.exclude = [
"bodo/**/*.h",
"bodo/**/*.cpp",
"bodo/**/*.c",
"bodo/**/*.pxd",
"bodo/**/*.pyx",
"bodo/tests/data/**/*.crc",
"bodo/bench",
]
# -------------------------------------- Dev Tools -------------------------------------- #
[tool.ruff]
unsafe-fixes = true
lint.extend-select = [
"I", # isort
"UP", # pyupgrade
"C4", # flake8-comprehensions
"TID", # flake8-tidy-imports
]
lint.ignore = [
# Permanently Disabled Rules
"E501", # Line too long. Black should manage this only
"E741", # Ambiguous variable name: {name}
# Use X | Y instead of (X, Y) in isinstance
# Disabled because:
# - X | Y is slower than (X, Y), could be problematic in hot code paths
# - (X, Y) is more readable and formattable
# - Numba doesn't support X | Y
"UP038",
# TODO: Gradually Enable in Next PR
# Flake8 Rules
"F405", # {name} may be undefined, or defined from star imports
"F811", # Redefinition of unused {name} from line
"E402", # Module level import not at top of file
"E711", # Comparison to `None` should be `cond is not None`
"E712", # Comparison to `...` should be `cond is False` or `if not cond:`
"E731", # Do not assign a `lambda` expression, use a `def`
]
exclude = [
".git/",
# TODO: Couple of ISort Problems with this folder
"bodo-platform-image/",
"demo/",
"examples/",
"BodoSQL/calcite_sql/bodosql-calcite-application/src/test/resources/com/bodosql/calcite/application/_generated_files/",
"bodo/numba_compat.py",
"bodo/mpi4py/",
# TODO: Skip specific rules for these files
"bodo/__init__.py",
"BodoSQL/bodosql/__init__.py",
"iceberg/bodo_iceberg_connector/__init__.py",
"bodo/pandas/__init__.py",
]
[tool.ruff.lint.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"mpi4py".msg = "Use `bodo.mpi4py` instead of `mpi4py`"
[tool.ruff.lint.isort]
known-first-party = ["bodo", "bodosql", "BodoSQL/bodosql", "e2e-tests"]
[tool.ruff.format]
exclude = [
"BodoSQL/calcite_sql/bodosql-calcite-application/src/test/resources/com/bodosql/calcite/application/_generated_files/",
]
# ------------------------------------ CIBuildWheel ------------------------------------ #
[tool.cibuildwheel]
# Disable building PyPy wheels on all platforms
# Disable building wheels for musllinux
skip = ["pp*", "*musllinux*", "*i686*"]
# Increase pip debugging output
build-verbosity = 1
build-frontend = { name = "pip" }
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:latest"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:latest"
test-command = """
set -exo pipefail
export BODO_NUM_WORKERS=2
python -c '\
import bodo
import pandas as pd
pd.DataFrame({"a": [1, 2, 3]}).to_parquet("test.parquet")
@bodo.jit
def f():
df = pd.read_parquet("test.parquet")
return df.a.sum()
assert f() == 6' && \
# Check that only expected libs are included in the wheel
LIB_WHITELIST="^(libcom_err|libcrypto|libcurl|libfftw3_mpi|libfftw3f_mpi|libfftw3|libfftw3f|libgssapi_krb5|libhdf5|libk5crypto|libkeyutils|libkrb5support|libkrb5|libnghttp2|libs2n|libssh2|libssl|libsz|libzstd|libboost_container|libboost_json|libbrotli.*|libcrypt|libidn2|liblber-2|libpcre2|libpsl|libsasl2|libselinux|libssh|libunistring|libldap-2)-.*\\.so(\\.[0-9]+)*"
LIBS_DIR="$(pip show bodo | grep Location | awk -F 'Location: ' '{print $2}')/bodo.libs" && \
for file in "$LIBS_DIR"/*; do
if [[ ! $(basename "$file") =~ $LIB_WHITELIST ]]; then
echo "Unexpected shared object found: $file"
exit 1
fi
done
"""
[tool.cibuildwheel.macos]
# Can't use pytest because we don't include tests in the wheel
test-command = """
BODO_NUM_WORKERS=2 python -c '\
import bodo
import pandas as pd
pd.DataFrame({"a": [1, 2, 3]}).to_parquet("test.parquet")
@bodo.jit
def f():
df = pd.read_parquet("test.parquet")
return df.a.sum()
assert f() == 6' && \
# Check that only expected libs are included in the wheel
LIB_WHITELIST="^(libc\\+\\+|libcom_err|libcrypto|libcurl|libfftw3_mpi|libfftw3f_mpi|libfftw3|libfftw3f|libgssapi_krb5|libhdf5|libk5crypto|libkrb5support|libkrb5|libnghttp2|libssh2|libssl|libsz|libzstd|libz|libaws-.*)(\\.[0-9]+)*\\.dylib$"
DYLIBS_DIR="$(pip show bodo | grep Location | awk -F 'Location: ' '{print $2}')/bodo/.dylibs" && \
for file in $DYLIBS_DIR/*; do
if [[ ! $(basename $file) =~ $LIB_WHITELIST ]]; then
echo "Unexpected dylib found: $file"
exit 1
fi
done
"""
# ---------------------------------------- PR CI ---------------------------------------- #
[tool.coverage.run]
source = ["bodo"]
branch = true
relative_files = true
omit = [
"bodo/mpi4py/*",
"bodo/runtests.py",
"bodo/tests/*",
".pixi",
]