Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn the fuzz-parser script into a properly packaged Python project #14606

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

AlexWaygood
Copy link
Member

Summary

This PR gets rid of the requirements.in and requirements.txt files in the scripts/fuzz-parser directory, and replaces them with pyproject.toml and uv.lock files. The script is renamed from fuzz-parser to py-fuzzer (since it can now also be used to fuzz red-knot as well as the parser, following #14566), and moved from the scripts/ directory to the python/ 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:

  • It means we can run it from the project root using uv run without having to activate a virtual environment and ensure that all required dependencies are installed into that environment
  • Using a pyproject.toml file means that we can express that the project requires Python 3.12+ to run properly; this wasn't possible before
  • I've been running mypy on the project locally when I've been working on it or reviewing other people's PRs; now I can put the mypy config for the project in the pyproject.toml file

Test Plan

I manually tested that all the commands detailed in python/py-fuzzer/README.md work for me locally.

@AlexWaygood AlexWaygood added the testing Related to testing Ruff itself label Nov 26, 2024
Copy link
Contributor

github-actions bot commented Nov 26, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Co-authored-by: David Peter <[email protected]>
Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it :)

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Nov 27, 2024
@AlexWaygood AlexWaygood merged commit e0f3eaf into main Nov 27, 2024
22 checks passed
@AlexWaygood AlexWaygood deleted the alex/fuzzer-package branch November 27, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement testing Related to testing Ruff itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants