Skip to content

Commit f160402

Browse files
Lorak-mmkdkropachev
authored andcommitted
README-dev.rst: Recommend uv usage
1 parent 738ec29 commit f160402

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

README-dev.rst

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Releasing
1515
Building the Docs
1616
=================
1717

18-
To build and preview the documentation for the ScyllaDB Python driver locally, you must first manually install `python-driver`.
18+
To build and preview the documentation for the ScyllaDB Python driver locally, you must first manually install `python-driver`.
1919
This is necessary for autogenerating the reference documentation of the driver.
2020
You can find detailed instructions on how to install the driver in the `Installation guide <https://python-driver.docs.scylladb.com/stable/installation.html#manual-installation>`_.
2121

@@ -24,20 +24,28 @@ After installing the driver, you can build the documentation:
2424
- Install poetry: ``pip install poetry``
2525
- To preview docs in your browser: ``make -C docs preview``
2626

27+
Tooling
28+
=======
29+
30+
We recommend using `uv` tool for running tests, linters and basically everything else,
31+
since it makes Python tooling ecosystem mostly usable.
32+
To install it, see instructions at https://docs.astral.sh/uv/getting-started/installation/
33+
The rest of this document assumes you have `uv` installed.
34+
2735
Tests
2836
=====
2937

3038
Running Unit Tests
3139
------------------
3240
Unit tests can be run like so::
3341

34-
python -m pytest tests/unit
35-
EVENT_LOOP_MANAGER=gevent python -m pytest tests/unit/io/test_geventreactor.py
36-
EVENT_LOOP_MANAGER=eventlet python -m pytest tests/unit/io/test_eventletreactor.py
42+
uv run pytest tests/unit
43+
EVENT_LOOP_MANAGER=gevent uv run pytest tests/unit/io/test_geventreactor.py
44+
EVENT_LOOP_MANAGER=eventlet uv run pytest tests/unit/io/test_eventletreactor.py
3745

3846
You can run a specific test method like so::
3947

40-
python -m pytest tests/unit/test_connection.py::ConnectionTest::test_bad_protocol_version
48+
uv run pytest tests/unit/test_connection.py::ConnectionTest::test_bad_protocol_version
4149

4250
Running Integration Tests
4351
-------------------------
@@ -46,17 +54,17 @@ In order to run integration tests, you must specify a version to run using eithe
4654
* ``CASSANDRA_VERSION``
4755
environment variable::
4856

49-
SCYLLA_VERSION="release:5.1" python -m pytest tests/integration/standard tests/integration/cqlengine/
57+
SCYLLA_VERSION="release:5.1" uv run pytest tests/integration/standard tests/integration/cqlengine/
5058

5159
Or you can specify a scylla/cassandra directory (to test unreleased versions)::
5260

53-
SCYLLA_VERSION=/path/to/scylla pytest tests/integration/standard/
61+
SCYLLA_VERSION=/path/to/scylla uv run pytest tests/integration/standard/
5462

5563
Specifying the usage of an already running Scylla cluster
5664
------------------------------------------------------------
5765
The test will start the appropriate Scylla clusters when necessary but if you don't want this to happen because a Scylla cluster is already running the flag ``USE_CASS_EXTERNAL`` can be used, for example::
5866

59-
USE_CASS_EXTERNAL=1 SCYLLA_VERSION='release:5.1' pytest tests/integration/standard
67+
USE_CASS_EXTERNAL=1 SCYLLA_VERSION='release:5.1' uv run pytest tests/integration/standard
6068

6169
Specify a Protocol Version for Tests
6270
------------------------------------
@@ -66,30 +74,29 @@ The protocol version defaults to:
6674
- 5 for Cassandra >= 4.0, 4 for Cassandra >= 2.2, 3 for Cassandra >= 2.1, 2 for Cassandra >= 2.0
6775
You can overwrite it with the ``PROTOCOL_VERSION`` environment variable::
6876

69-
PROTOCOL_VERSION=3 SCYLLA_VERSION="release:5.1" python -m pytest tests/integration/standard tests/integration/cqlengine/
77+
PROTOCOL_VERSION=3 SCYLLA_VERSION="release:5.1" uv run pytest tests/integration/standard tests/integration/cqlengine/
7078

7179
Seeing Test Logs in Real Time
7280
-----------------------------
7381
Sometimes it's useful to output logs for the tests as they run::
7482

75-
python -m pytest -s tests/unit/
83+
uv run pytest -s tests/unit/
7684

7785
Use tee to capture logs and see them on your terminal::
7886

79-
python -m pytest -s tests/unit/ 2>&1 | tee test.log
87+
uv run pytest -s tests/unit/ 2>&1 | tee test.log
8088

8189

8290
Running the Benchmarks
8391
======================
8492
There needs to be a version of cassandra running locally so before running the benchmarks, if ccm is installed:
85-
86-
ccm create benchmark_cluster -v 3.0.1 -n 1 -s
93+
94+
uv run ccm create benchmark_cluster -v 3.0.1 -n 1 -s
8795

8896
To run the benchmarks, pick one of the files under the ``benchmarks/`` dir and run it::
8997

90-
python benchmarks/future_batches.py
98+
uv run benchmarks/future_batches.py
9199

92100
There are a few options. Use ``--help`` to see them all::
93101

94-
python benchmarks/future_batches.py --help
95-
102+
uv run benchmarks/future_batches.py --help

0 commit comments

Comments
 (0)