Skip to content

Commit 76873fa

Browse files
committed
uv: Rebuild lib when cython stuff changes
When a file or variable used by setup.py changes, we should rebuild the driver. If we don't we risk very unpleasant errors caused by source files and binary files differing.
1 parent 47eb5c4 commit 76873fa

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

pyproject.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,40 @@ requires = ["setuptools>=42", "Cython"]
7777

7878
build-backend = "setuptools.build_meta"
7979

80+
[tool.uv]
81+
cache-keys = [
82+
{ file = "pyproject.toml" },
83+
{ file = "setup.py" },
84+
# Cythonized modules
85+
{ file = "cassandra/io/libevwrapper.c" },
86+
{ file = "cassandra/cmurmur3.c" },
87+
{ file = "cassandra/cluster.py" },
88+
{ file = "cassandra/concurrent.py" },
89+
{ file = "cassandra/connection.py" },
90+
{ file = "cassandra/cqltypes.py" },
91+
{ file = "cassandra/metadata.py" },
92+
{ file = "cassandra/pool.py" },
93+
{ file = "cassandra/protocol.py" },
94+
{ file = "cassandra/query.py" },
95+
{ file = "cassandra/util.py" },
96+
{ file = "cassandra/shard_info.py" },
97+
{ file = "cassandra/*.pyx" },
98+
{ file = "cassandra/*.pxd" },
99+
100+
# Env variables used in setup.py
101+
{ env = "CASS_DRIVER_LIBEV_INCLUDES" },
102+
{ env = "CASS_DRIVER_LIBEV_LIBS" },
103+
{ env = "CASS_DRIVER_NO_EXTENSIONS" },
104+
{ env = "CASS_DRIVER_NO_LIBEV" },
105+
{ env = "CASS_DRIVER_NO_CYTHON" },
106+
{ env = "CASS_DRIVER_BUILD_CONCURRENCY" },
107+
{ env = "CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST" },
108+
{ env = "CASS_DRIVER_ALLOWED_CYTHON_VERSION" },
109+
110+
# used by setuptools_scm
111+
{ git = { commit = true, tags = true } },
112+
]
113+
80114
[tool.pytest.ini_options]
81115
log_format = "%(asctime)s.%(msecs)03d %(levelname)s [%(module)s:%(lineno)s]: %(message)s"
82116
log_level = "DEBUG"

0 commit comments

Comments
 (0)