|
4 | 4 |
|
5 | 5 | This script can be installed into a virtual environment using |
6 | 6 | `uv pip install -e ./python/py-fuzzer` from the Ruff repository root, |
7 | | -or can be run using `uvx --from ./python/py-fuzzer fuzz` |
| 7 | +or can be run using `uv run --project=./python/py-fuzzer fuzz` |
8 | 8 | (in which case the virtual environment does not need to be activated). |
| 9 | +Note that using `uv run --project` rather than `uvx --from` means that |
| 10 | +uv will respect the script's lockfile. |
9 | 11 |
|
10 | 12 | Example invocations of the script using `uv`: |
11 | 13 | - Run the fuzzer on Ruff's parser using seeds 0, 1, 2, 78 and 93 to generate the code: |
12 | | - `uvx --from ./python/py-fuzzer fuzz --bin ruff 0-2 78 93` |
| 14 | + `uv run --project=./python/py-fuzzer fuzz --bin ruff 0-2 78 93` |
13 | 15 | - Run the fuzzer concurrently using seeds in range 0-10 inclusive, |
14 | 16 | but only reporting bugs that are new on your branch: |
15 | | - `uvx --from ./python/py-fuzzer fuzz --bin ruff 0-10 --only-new-bugs` |
| 17 | + `uv run --project=./python/py-fuzzer fuzz --bin ruff 0-10 --only-new-bugs` |
16 | 18 | - Run the fuzzer concurrently on 10,000 different Python source-code files, |
17 | 19 | using a random selection of seeds, and only print a summary at the end |
18 | 20 | (the `shuf` command is Unix-specific): |
19 | | - `uvx --from ./python/py-fuzzer fuzz --bin ruff $(shuf -i 0-1000000 -n 10000) --quiet |
20 | | -
|
21 | | -If you make local modifications to this script, you'll need to run the above |
22 | | -with `--reinstall` to get your changes reflected in the uv-cached installed |
23 | | -package. Alternatively, if iterating quickly on changes, you can add |
24 | | -`--with-editable ./python/py-fuzzer`. |
| 21 | + `uv run --project=./python/py-fuzzer fuzz --bin ruff $(shuf -i 0-1000000 -n 10000) --quiet |
25 | 22 | """ |
26 | 23 |
|
27 | 24 | from __future__ import annotations |
|
0 commit comments