forked from apache/cassandra-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (207 loc) · 9.72 KB
/
Copy pathpyproject.toml
File metadata and controls
228 lines (207 loc) · 9.72 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
[project]
name = "scylla-driver"
description = "Scylla Driver for Apache Cassandra"
authors = [{ name = "ScyllaDB" }]
keywords = ["cassandra", "cql", "orm", "dse", "graph"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'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 :: Free Threading :: 2 - Beta',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
]
dependencies = ['geomet>=1.1', 'pyyaml > 5.0']
dynamic = ["version", "readme"]
license = {text = "Apache-2.0"}
requires-python = ">=3.9"
[project.urls]
"Homepage" = "https://github.com/scylladb/python-driver"
"Documentation" = "https://scylladb.github.io/python-driver/"
"Source" = "https://github.com/scylladb/python-driver/"
"Issues" = "https://github.com/scylladb/python-driver/issues"
[project.optional-dependencies]
graph = ['gremlinpython>=3.7.4,<4']
cle = ['cryptography>=42.0']
compress-lz4 = ['lz4']
compress-snappy = ['python-snappy']
auth-kerberos = [
'kerberos; platform_system != "Windows"',
'winkerberos; platform_system == "Windows"',
]
[dependency-groups]
dev = [
"pytest~=8.0",
"PyYAML",
"pure-sasl",
"twisted[tls]",
"gevent",
"eventlet>=0.33.3",
"cython>=3.2",
"setuptools",
"packaging>=25.0",
"futurist",
"pyyaml",
"numpy",
"objgraph",
"ccm @ git+https://git@github.com/scylladb/scylla-ccm.git@master",
]
[tool.setuptools]
include-package-data = true
packages = [
'cassandra',
'cassandra.io',
'cassandra.cqlengine',
'cassandra.graph',
'cassandra.datastax',
'cassandra.datastax.insights',
'cassandra.datastax.graph',
'cassandra.datastax.graph.fluent',
'cassandra.datastax.cloud',
'cassandra.scylla',
'cassandra.column_encryption',
]
[tool.setuptools.dynamic]
version = { attr = "cassandra.__version__" } # any module attribute compatible with ast.literal_eval
readme = { file = "README.rst", content-type = "text/x-rst" }
[build-system]
requires = ["setuptools>=70", "Cython"]
build-backend = "setuptools.build_meta"
[tool.uv]
cache-keys = [
{ file = "pyproject.toml" },
{ file = "setup.py" },
# Cythonized modules
{ file = "cassandra/io/libevwrapper.c" },
{ file = "cassandra/cmurmur3.c" },
{ file = "cassandra/cluster.py" },
{ file = "cassandra/concurrent.py" },
{ file = "cassandra/connection.py" },
{ file = "cassandra/cqltypes.py" },
{ file = "cassandra/metadata.py" },
{ file = "cassandra/pool.py" },
{ file = "cassandra/protocol.py" },
{ file = "cassandra/query.py" },
{ file = "cassandra/util.py" },
{ file = "cassandra/shard_info.py" },
{ file = "cassandra/*.pyx" },
{ file = "cassandra/*.pxd" },
# Env variables used in setup.py
{ env = "CASS_DRIVER_LIBEV_INCLUDES" },
{ env = "CASS_DRIVER_LIBEV_LIBS" },
{ env = "CASS_DRIVER_NO_EXTENSIONS" },
{ env = "CASS_DRIVER_NO_LIBEV" },
{ env = "CASS_DRIVER_NO_CYTHON" },
{ env = "CASS_DRIVER_BUILD_CONCURRENCY" },
{ env = "CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST" },
# used by setuptools_scm
{ git = { commit = true, tags = true } },
]
[tool.pytest.ini_options]
log_format = "%(asctime)s.%(msecs)03d %(levelname)s [%(module)s:%(lineno)s]: %(message)s"
log_level = "DEBUG"
log_date_format = "%Y-%m-%d %H:%M:%S"
xfail_strict = true
addopts = "-rf"
markers = [
"last: mark test to run last within its module group",
]
[tool.setuptools_scm]
version_file = "cassandra/_version.py"
tag_regex = '(?P<version>\d*?\.\d*?\.\d*?)-scylla'
#### CI BUILDWHEEL CONFIG ####
[tool.cibuildwheel]
build-frontend = "build[uv]"
environment = { CASS_DRIVER_BUILD_CONCURRENCY = "2", CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = "yes", CFLAGS = "-g0 -O3" }
skip = [
"cp38*",
"pp38*",
"cp39*",
"pp39*",
"cp3*t-*",
"pp3*t-*",
"*i686",
"*win32",
"*musllinux*",
]
build = ["cp3*", "pp3*"]
test-groups = ["dev"]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-pypy_x86_64-image = "manylinux_2_28"
manylinux-pypy_aarch64-image = "manylinux_2_28"
enable = ["pypy"]
[tool.cibuildwheel.linux]
before-build = "rm -rf ~/.pyxbld && rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux && yum install -y libffi-devel libev libev-devel openssl openssl-devel"
# Install the optional lz4 compression dependency so the lz4 segment tests run
# (and fail loudly under CASS_DRIVER_NO_SKIP) instead of skipping silently.
test-extras = ["compress-lz4"]
# Extensions are mandatory on Linux (CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes),
# so skipping is disabled (CASS_DRIVER_NO_SKIP=1): a missing dependency such as
# libev fails loudly instead of being silently skipped. Tests that cannot run in
# the default configuration are listed explicitly:
# * event-loop reactor tests are run separately with the matching
# EVENT_LOOP_MANAGER (gevent/eventlet/asyncio);
# * asyncore is deprecated and unavailable on modern Python, so it is ignored;
# * column_encryption is disabled upstream (scylladb/python-driver#365);
# * test_deserialize_date_range_month is disabled upstream (PYTHON-912).
# PyPy uses the pp* override below. All Linux CPython reactor commands run with
# CASS_DRIVER_NO_SKIP=1 so unexpected skips fail loudly.
test-command = [
"CASS_DRIVER_NO_SKIP=1 pytest --import-mode=append {package}/tests/unit -v --ignore={package}/tests/unit/column_encryption --ignore={package}/tests/unit/io/test_geventreactor.py --ignore={package}/tests/unit/io/test_eventletreactor.py --ignore={package}/tests/unit/io/test_asyncioreactor.py --ignore={package}/tests/unit/io/test_asyncorereactor.py -k 'not test_deserialize_date_range_month'",
"EVENT_LOOP_MANAGER=gevent CASS_DRIVER_NO_SKIP=1 pytest --import-mode=append {package}/tests/unit/io/test_geventreactor.py -v",
"EVENT_LOOP_MANAGER=asyncio CASS_DRIVER_NO_SKIP=1 pytest --import-mode=append {package}/tests/unit/io/test_asyncioreactor.py -v",
"EVENT_LOOP_MANAGER=eventlet CASS_DRIVER_NO_SKIP=1 pytest --import-mode=append {package}/tests/unit/io/test_eventletreactor.py -v",
]
[tool.cibuildwheel.macos]
build-frontend = "build"
# Install lz4 so the lz4 segment tests run instead of skipping (see Linux note).
test-extras = ["compress-lz4"]
# Same policy as Linux (extensions are mandatory here too, libev comes from
# Homebrew). The extra -k exclusions are timing-sensitive tests that are flaky
# on macOS runners. The gevent/eventlet/asyncio reactor test files only contain
# those timing-sensitive timer tests, so they are not run separately here.
test-command = [
"CASS_DRIVER_NO_SKIP=1 pytest --import-mode=append {project}/tests/unit -v --ignore={project}/tests/unit/column_encryption --ignore={project}/tests/unit/io/test_geventreactor.py --ignore={project}/tests/unit/io/test_eventletreactor.py --ignore={project}/tests/unit/io/test_asyncioreactor.py --ignore={project}/tests/unit/io/test_asyncorereactor.py -k 'not (test_multi_timer_validation or test_empty_connections or test_timer_cancellation or test_deserialize_date_range_month)'",
]
[tool.cibuildwheel.windows]
build-frontend = "build"
# On Windows the C extensions are optional (CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST
# is overridden to "no" below), so extension-dependent tests (e.g. libev) are
# legitimately skipped here. CASS_DRIVER_NO_SKIP is therefore NOT enabled on
# Windows; we only add -v so skips are visible in the log.
test-command = [
"pytest --import-mode=append {project}/tests/unit -v -k \"not (test_deserialize_date_range_year or test_datetype or test_libevreactor)\"",
]
# TODO: set CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST to yes when https://github.com/scylladb/python-driver/issues/429 is fixed
environment = { CASS_DRIVER_BUILD_CONCURRENCY = "2", CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = "no" }
# PyPy never builds the libev/cmurmur3/Cython C extensions (setup.py forces
# is_pypy to skip them even when CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes), so
# the tests that depend on those extensions legitimately skip. Enforcing
# CASS_DRIVER_NO_SKIP would turn those expected skips into failures, so it is
# NOT enabled for PyPy (same reasoning as Windows). The reactor tests are not
# run separately here because eventlet is unsupported on PyPy (@notpypy) and the
# extension-backed reactors are unavailable; with no-skip off they simply skip.
# test-extras is cleared (no compress-lz4): PyPy has no prebuilt lz4 wheel, so
# pip would try to compile it from source and fail. The lz4 tests just skip here.
# test_deserialize_date_range_year and test_datetype are excluded because they
# fail on Windows (the C runtime's gmtime rejects the far-future timestamps they
# use); the CPython Windows command excludes them for the same reason. The
# timer tests (test_multi_timer_validation, test_empty_connections,
# test_timer_cancellation) are timing-sensitive and flaky on macOS, matching the
# CPython macOS exclusions. The override matches PyPy on all OSes, so these are
# deselected everywhere here (they are still covered by the CPython runs).
[[tool.cibuildwheel.overrides]]
select = "pp*"
test-extras = []
test-command = [
"pytest --import-mode=append {package}/tests/unit -v --ignore={package}/tests/unit/column_encryption -k \"not (test_deserialize_date_range_month or test_deserialize_date_range_year or test_datetype or test_multi_timer_validation or test_empty_connections or test_timer_cancellation)\"",
]