Skip to content

[Bug]: pre-commit run --all-files fails on Windows #2839

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

Closed
neoncube2 opened this issue May 2, 2025 · 3 comments · Fixed by #2840
Closed

[Bug]: pre-commit run --all-files fails on Windows #2839

neoncube2 opened this issue May 2, 2025 · 3 comments · Fixed by #2840

Comments

@neoncube2
Copy link
Contributor

Version

local

Steps to reproduce

  1. Clone this repo
  2. On Windows, run the following commands:
python -m venv env
env\Scripts\activate
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
python -m build --wheel
playwright install
pre-commit install
pre-commit run --all-files

pre-commit run --all-files fails with these errors:

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

playwright\_impl\_browser_type.py:174: error: Incompatible return value type (got "Path", expected "str")  [return-value]
tests\common\test_signals.py:30: error: Module has no attribute "setpgrp"  [attr-defined]
tests\common\test_signals.py:70: error: Module has no attribute "setpgrp"  [attr-defined]
tests\common\test_signals.py:113: error: Module has no attribute "killpg"  [attr-defined]
tests\common\test_signals.py:113: error: Module has no attribute "getpgid"; maybe "getpid" or "getppid"?  [attr-defined]
Found 5 errors in 2 files (checked 234 source files)

flake8...................................................................Passed
isort....................................................................Passed
pyright..................................................................Failed
- hook id: pyright
- exit code: 1

c:\Users\elibl\Desktop\  playwright-python\playwright\_impl\_browser_type.py
  c:\Users\elibl\Desktop\  playwright-python\playwright\_impl\_browser_type.py:174:24 - error: Type "Path" is not assignable to return type "str"
    "Path" is not assignable to "str" (reportReturnType)
c:\Users\elibl\Desktop\  playwright-python\tests\common\test_signals.py
  c:\Users\elibl\Desktop\  playwright-python\tests\common\test_signals.py:30:8 - error: "setpgrp" is not a known attribute of module "os" (reportAttributeAccessIssue)
  c:\Users\elibl\Desktop\  playwright-python\tests\common\test_signals.py:70:8 - error: "setpgrp" is not a known attribute of module "os" (reportAttributeAccessIssue)
  c:\Users\elibl\Desktop\  playwright-python\tests\common\test_signals.py:113:8 - error: "killpg" is not a known attribute of module "os" (reportAttributeAccessIssue)
  c:\Users\elibl\Desktop\  playwright-python\tests\common\test_signals.py:113:18 - error: "getpgid" is not a known attribute of module "os" (reportAttributeAccessIssue)
5 errors, 0 warnings, 0 informations

Running python scripts/generate_async_api.py fails with similar errors, which makes developing with Windows difficult.

Expected behavior

No errors in pre-commit hook on Windows

Actual behavior

Errors

Additional context

No response

Environment

- Operating System: Windows 11
- CPU: x64
- Browser: N/A
- Python Version: 3.13.2
- Other info: N/A
@mxschmitt
Copy link
Member

Are you interested in fixing these linting error?

@neoncube2
Copy link
Contributor Author

Sure! :)

I've opened a PR: #2840

@neoncube2
Copy link
Contributor Author

@mxschmitt Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants