Skip to content

Commit f1b2e85

Browse files
authored
py-fuzzer: recommend using uvx rather than uv run to run the fuzzer (#14645)
1 parent 6d61c8a commit f1b2e85

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,9 @@ jobs:
330330
chmod +x ${{ steps.download-cached-binary.outputs.download-path }}/ruff
331331
332332
(
333-
uv run \
334-
--no-project \
333+
uvx \
335334
--python=${{ env.PYTHON_VERSION }} \
336-
--with=./python/py-fuzzer \
335+
--from=./python/py-fuzzer \
337336
fuzz \
338337
--test-executable=${{ steps.download-cached-binary.outputs.download-path }}/ruff \
339338
--bin=ruff \

.github/workflows/daily_fuzz.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ jobs:
4545
- name: Fuzz
4646
run: |
4747
(
48-
uv run \
49-
--no-project \
48+
uvx \
5049
--python=3.12 \
51-
--with=./python/py-fuzzer \
50+
--from=./python/py-fuzzer \
5251
fuzz \
5352
--test-executable=target/debug/ruff \
5453
--bin=ruff \

crates/ruff_python_parser/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ To run the fuzzer, execute the following command
6262
(requires [`uv`](https://github.com/astral-sh/uv) to be installed):
6363

6464
```sh
65-
uv run --no-project --with ./python/py-fuzzer fuzz
65+
uvx --from ./python/py-fuzzer fuzz
6666
```
6767

6868
Refer to the [py-fuzzer](https://github.com/astral-sh/ruff/blob/main/python/py-fuzzer/fuzz.py)

python/py-fuzzer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
A fuzzer script to run Ruff executables on randomly generated
44
(but syntactically valid) Python source-code files.
55

6-
Run `uv run --no-project --with ./python/py-fuzzer fuzz -h` from the repository root
6+
Run `uvx --from ./python/py-fuzzer fuzz -h` from the repository root
77
for more information and example invocations
88
(requires [`uv`](https://github.com/astral-sh/uv) to be installed).

python/py-fuzzer/fuzz.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
55
This script can be installed into a virtual environment using
66
`uv pip install -e ./python/py-fuzzer` from the Ruff repository root,
7-
or can be run using `uv run --no-project --with ./python/py-fuzzer`
7+
or can be run using `uvx --from ./python/py-fuzzer fuzz`
88
(in which case the virtual environment does not need to be activated).
99
1010
Example invocations of the script using `uv`:
1111
- Run the fuzzer on Ruff's parser using seeds 0, 1, 2, 78 and 93 to generate the code:
12-
`uv run --no-project --with ./python/py-fuzzer fuzz --bin ruff 0-2 78 93`
12+
`uvx --from ./python/py-fuzzer fuzz --bin ruff 0-2 78 93`
1313
- Run the fuzzer concurrently using seeds in range 0-10 inclusive,
1414
but only reporting bugs that are new on your branch:
15-
`uv run --no-project --with ./python/py-fuzzer fuzz --bin ruff 0-10 --new-bugs-only`
15+
`uvx --from ./python/py-fuzzer fuzz --bin ruff 0-10 --new-bugs-only`
1616
- Run the fuzzer concurrently on 10,000 different Python source-code files,
1717
using a random selection of seeds, and only print a summary at the end
1818
(the `shuf` command is Unix-specific):
19-
`uv run --no-project --with ./python/py-fuzzer fuzz --bin ruff $(shuf -i 0-1000000 -n 10000) --quiet
19+
`uvx --from ./python/py-fuzzer fuzz --bin ruff $(shuf -i 0-1000000 -n 10000) --quiet
2020
"""
2121

2222
from __future__ import annotations

0 commit comments

Comments
 (0)