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

Make mypy pass on black in knot_benchmark #13235

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Conversation

AlexWaygood
Copy link
Member

Summary

This fixes one of the problems highlighted in #13229 in the knot_benchmark script. The issue was that recent versions of aiohttp led to typing errors in black. These were fixed in psf/black@699b45a, but we pinned a commit of black prior to that in knot_benchmark; meanwhile, we were installing the latest version of aiohttp, because our dependencies for the projects being benchmarked were not pinned.

This PR bumps the pinned commit of black to a newer version, and adds a --exclude-newer flag (set to today's date) to the installation command so that we won't be impacted by issues like this in the future.

Test Plan

~/dev/ruff/scripts/knot_benchmark (alex/black-bench)⚡ % uv run benchmark --project=black -vv --mypy --min-runs=1 --benchmark cold
2024-09-03 21:02:05 INFO Cloned black to /var/folders/gd/1czdxc454j15y8gns2krv8vc0000gn/T/tmp35jq5s6j.
black (cold)
2024-09-03 21:02:05 INFO Running ['hyperfine', '-i', '--show-output', '--warmup', '3', '--min-runs', '1', '--command-name', 'mypy', '--prepare', '', '/Users/alexw/dev/ruff/scripts/knot_benchmark/.venv/bin/mypy --python-executable /var/folders/gd/1czdxc454j15y8gns2krv8vc0000gn/T/tmp35jq5s6j/venv/bin/python src --no-incremental --cache-dir /dev/null']
Benchmark 1: mypy
Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
Success: no issues found in 40 source files
Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
Success: no issues found in 40 source files
Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
Success: no issues found in 40 source files
Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
Success: no issues found in 40 source files
Warning: unused section(s) in pyproject.toml: module = ['tests.data.*']
Success: no issues found in 40 source files
  Time (mean ± σ):      1.485 s ±  0.012 s    [User: 1.398 s, System: 0.084 s]
  Range (min … max):    1.476 s …  1.493 s    2 runs

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

@AlexWaygood AlexWaygood enabled auto-merge (squash) September 4, 2024 09:31
@AlexWaygood AlexWaygood merged commit 5728909 into main Sep 4, 2024
17 checks passed
@AlexWaygood AlexWaygood deleted the alex/black-bench branch September 4, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants