diff --git a/crates/ruff_benchmark/README.md b/crates/ruff_benchmark/README.md index 292d0dac3b..3e85474385 100644 --- a/crates/ruff_benchmark/README.md +++ b/crates/ruff_benchmark/README.md @@ -1,8 +1,8 @@ -## Ruff Micro-benchmarks +# Ruff Micro-benchmarks Benchmarks for the different Ruff-tools. -### Run Benchmark +## Run Benchmark You can run the benchmarks with @@ -10,7 +10,7 @@ You can run the benchmarks with cargo benchmark ``` -### Benchmark driven Development +## Benchmark driven Development You can use `--save-baseline=` to store an initial baseline benchmark (e.g. on `main`) and then use `--benchmark=` to compare against that benchmark. Criterion will print a message telling you if the benchmark improved/regressed compared to that baseline. @@ -23,7 +23,8 @@ cargo benchmark --save-baseline=main cargo benchmark --baseline=main ``` -### PR Summary +## PR Summary + You can use `--save-baseline` and `critcmp` to get a pretty comparison between two recordings. This is useful to illustrate the improvements of a PR. @@ -43,11 +44,11 @@ You must install [`critcmp`](https://github.com/BurntSushi/critcmp) for the comp cargo install critcmp ``` -### Tips +## Tips -* Use `cargo benchmark ` to only run specific benchmarks. For example: `cargo benchmark linter/pydantic` to only run the pydantic tests. -* Use `cargo benchmark --quiet` for a more cleaned up output (without statistical relevance) -* Use `cargo benchmark --quick` to get faster results (more prone to noise) +- Use `cargo benchmark ` to only run specific benchmarks. For example: `cargo benchmark linter/pydantic` to only run the pydantic tests. +- Use `cargo benchmark --quiet` for a more cleaned up output (without statistical relevance) +- Use `cargo benchmark --quick` to get faster results (more prone to noise) ## Profiling @@ -83,5 +84,5 @@ Then run the profiler with cargo instruments -t time --bench linter --profile release-debug -p ruff_benchmark -- --profile-time=1 ``` -* `-t`: Specifies what to profile. Useful options are `time` to profile the wall time and `alloc` for profiling the allocations. -* You may want to pass an additional filter to run a single test file +- `-t`: Specifies what to profile. Useful options are `time` to profile the wall time and `alloc` for profiling the allocations. +- You may want to pass an additional filter to run a single test file diff --git a/scripts/generate_mkdocs.py b/scripts/generate_mkdocs.py index c857ca4a2b..5793858e91 100644 --- a/scripts/generate_mkdocs.py +++ b/scripts/generate_mkdocs.py @@ -3,15 +3,11 @@ import argparse import re import shutil import subprocess -import sys from pathlib import Path from typing import NamedTuple import yaml -if sys.version_info < (3, 9): - raise RuntimeError("You need at least python 3.9 to run this script") - class Section(NamedTuple): """A section to include in the MkDocs documentation.""" diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 9b408fcc87..ee780c6e0e 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -2,6 +2,7 @@ name = "scripts" version = "0.0.1" dependencies = ["sphinx"] +requires-python = ">=3.9" [tool.black] line-length = 88 @@ -11,7 +12,7 @@ line-length = 88 select = ["ALL"] ignore = [ "PL", # pylint - "S", # bandit + "S", # bandit ] [tool.ruff.pydocstyle]