Turn the fuzz-parser
script into a properly packaged Python project
#14606
+379
−83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR gets rid of the
requirements.in
andrequirements.txt
files in thescripts/fuzz-parser
directory, and replaces them withpyproject.toml
anduv.lock
files. The script is renamed fromfuzz-parser
topy-fuzzer
(since it can now also be used to fuzz red-knot as well as the parser, following #14566), and moved from thescripts/
directory to thepython/
directory, since it's now a (uv)-pip-installable project in its own right.I've been resisting this for a while, because conceptually this script just doesn't feel "complicated" enough to me for it to be a full-blown package. However, I think it's time to do this. Making it a proper package has several advantages:
uv run
without having to activate a virtual environment and ensure that all required dependencies are installed into that environmentpyproject.toml
file means that we can express that the project requires Python 3.12+ to run properly; this wasn't possible beforepyproject.toml
fileTest Plan
I manually tested that all the commands detailed in
python/py-fuzzer/README.md
work for me locally.