Skip to content

Commit 605e0bc

Browse files
committed
Replace setup.py instructions with uv in conftest.py and CONTRIBUTING.rst
Address review feedback: replace deprecated 'python setup.py build_ext --inplace' instructions with 'uv sync --reinstall-package scylla-driver' and note that 'uv run pytest' handles rebuilds automatically via cache-keys in pyproject.toml.
1 parent c1afe54 commit 605e0bc

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

CONTRIBUTING.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ down to about 2-3 seconds.
4242

4343
**Important:** After modifying any ``.py`` file under ``cassandra/`` that is
4444
Cython-compiled (such as ``query.py``, ``protocol.py``, ``cluster.py``, etc.),
45-
you **must** rebuild extensions before running tests::
45+
extensions must be rebuilt before running tests. If you always use ``uv run``
46+
(e.g. ``uv run pytest``), this is handled automatically via the ``cache-keys``
47+
configuration in ``pyproject.toml``. If you invoke ``pytest`` directly, you can
48+
rebuild with::
4649

47-
python setup.py build_ext --inplace
50+
uv sync --reinstall-package scylla-driver
4851

4952
Without rebuilding, Python will load the stale compiled extension (``.so`` / ``.pyd``)
5053
instead of your modified ``.py`` source, and your changes will not actually be tested.

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def pytest_configure(config):
2525
2626
Python's import system prefers compiled extensions (.so / .pyd) over pure
2727
Python (.py) files. If a developer edits a .py file without rebuilding
28-
the Cython extensions (``python setup.py build_ext --inplace``), the tests
28+
the Cython extensions, the tests
2929
will silently run the *old* compiled code, masking any regressions in the
3030
Python source.
3131
@@ -61,6 +61,7 @@ def pytest_configure(config):
6161
f"Stale Cython extension(s) detected: {names}. "
6262
f"The .py source is newer than the compiled extension — tests "
6363
f"will run the OLD compiled code, not your latest changes. "
64-
f"Rebuild with: python setup.py build_ext --inplace",
64+
f"Rebuild with: uv sync --reinstall-package scylla-driver\n"
65+
f"Or use 'uv run pytest' which handles rebuilds automatically.",
6566
stacklevel=1,
6667
)

0 commit comments

Comments
 (0)