Skip to content

chore: update pre-commit / linters #2925

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

Merged
merged 1 commit into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.17.0
hooks:
- id: mypy
additional_dependencies: [types-pyOpenSSL==24.1.0.20240722, types-requests==2.32.0.20240914]
additional_dependencies: [types-pyOpenSSL==24.1.0.20240722, types-requests==2.32.4.20250611]
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
- repo: local
Expand All @@ -39,7 +39,7 @@ repos:
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright@1.1.384"]
additional_dependencies: ["pyright@1.1.403"]
- repo: local
hooks:
- id: check-license-header
Expand Down
2 changes: 1 addition & 1 deletion local-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ autobahn==23.1.2
black==25.1.0
build==1.2.2.post1
flake8==7.2.0
mypy==1.16.0
mypy==1.17.0
objgraph==3.6.2
Pillow==11.2.1
pixelmatch==0.3.0
Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def set_system_time(


def parse_time(
time: Union[float, str, datetime.datetime]
time: Union[float, str, datetime.datetime],
) -> Dict[str, Union[int, str]]:
if isinstance(time, (float, int)):
return {"timeNumber": int(time * 1_000)}
Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_set_input_files_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async def convert_input_files(


def resolve_paths_and_directory_for_input_files(
items: Sequence[Union[str, Path]]
items: Sequence[Union[str, Path]],
) -> Tuple[Optional[List[str]], Optional[str]]:
local_paths: Optional[List[str]] = None
local_directory: Optional[str] = None
Expand Down
3 changes: 1 addition & 2 deletions tests/async/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ async def load() -> None:


async def test_set_content_should_work_with_tricky_content(page: Page) -> None:
await page.set_content("<div>hello world</div>" + "\x7F")
await page.set_content("<div>hello world</div>" + "\x7f")
assert await page.eval_on_selector("div", "div => div.textContent") == "hello world"


Expand Down Expand Up @@ -1403,7 +1403,6 @@ async def test_should_not_throw_when_continuing_after_page_is_closed(
async def handle_route(route: Route) -> None:
await page.close()
await route.continue_()
nonlocal done
done.set_result(True)

await page.route("**/*", handle_route)
Expand Down
1 change: 0 additions & 1 deletion tests/async/test_page_add_locator_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async def test_should_work(page: Page, server: Server) -> None:
original_locator = page.get_by_text("This interstitial covers the button")

async def handler(locator: Locator) -> None:
nonlocal original_locator
assert locator == original_locator
nonlocal before_count
nonlocal after_count
Expand Down
2 changes: 1 addition & 1 deletion tests/async/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ async def test_workers_should_format_number_using_context_locale(
"() => new Worker(URL.createObjectURL(new Blob(['console.log(1)'], {type: 'application/javascript'})))"
)
worker = await worker_info.value
assert await worker.evaluate("() => (10000.20).toLocaleString()") == "10\u00A0000,2"
assert await worker.evaluate("() => (10000.20).toLocaleString()") == "10\u00a0000,2"
await context.close()
1 change: 0 additions & 1 deletion tests/common/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ async def main() -> None:
page = await context.new_page()
notified = False
try:
nonlocal sigint_received
while not sigint_received:
if not notified:
wait_queue.put("ready")
Expand Down
1 change: 0 additions & 1 deletion tests/sync/test_page_add_locator_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def test_should_work(page: Page, server: Server) -> None:
original_locator = page.get_by_text("This interstitial covers the button")

def handler(locator: Locator) -> None:
nonlocal original_locator
assert locator == original_locator
nonlocal before_count
nonlocal after_count
Expand Down
Loading