-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pre-commit.ci] pre-commit autoupdate #4547
Conversation
updates: - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](pre-commit/mirrors-mypy@v1.13.0...v1.14.1)
I did a bit of digging, and the mypy failure is ultimately from this typeshed pr: python/typeshed#12884. At that time pytest was the only one to get noticed by mypy-primer, with the same issue black is having now. Going off the fix in pytest, the mypy failure can be fixed by PS C:\...\black> git diff --cached
diff --git a/tests/test_black.py b/tests/test_black.py
index 84061f1..e737f28 100644
--- a/tests/test_black.py
+++ b/tests/test_black.py
@@ -1355,8 +1355,10 @@ def test_reformat_one_with_stdin_empty(self) -> None:
def _new_wrapper(
output: io.StringIO, io_TextIOWrapper: type[io.TextIOWrapper]
- ) -> Callable[[Any, Any], io.TextIOWrapper]:
- def get_output(*args: Any, **kwargs: Any) -> io.TextIOWrapper:
+ ) -> Callable[[Any, Any], Union[io.TextIOWrapper, io.StringIO]]:
+ def get_output(
+ *args: Any, **kwargs: Any
+ ) -> Union[io.TextIOWrapper, io.StringIO]:
if args == (sys.stdout.buffer,):
# It's `format_stdin_to_stdout()` def _new_wrapper(
output: io.StringIO, io_TextIOWrapper: type[io.TextIOWrapper]
) -> Callable[[Any, Any], Union[io.TextIOWrapper, io.StringIO]]:
def get_output(
*args: Any, **kwargs: Any
) -> Union[io.TextIOWrapper, io.StringIO]: But because github I can't find a good way to get these changes into this PR. As far as I can tell the only options are leaving a comment, or opening a PR against |
Ahhh - I tried locally but didn't |
Wat have I screwed up?
|
The formatting got messed up ) -> Callable[[Any, Any], Union[io.StringIO, io.TextIOWrapper]]:
def get_output(
*args: Any,
**kwargs: Any
) -> Union[io.StringIO, io.TextIOWrapper]: vs ) -> Callable[[Any, Any], Union[io.TextIOWrapper, io.StringIO]]:
def get_output(
*args: Any, **kwargs: Any
) -> Union[io.TextIOWrapper, io.StringIO]: |
I'm still not sure how exactly the auto-format fix might work, I'm not good enough with CI, so I always manually run black on the segment of the file in question to make sure it formats correctly :) |
I did run black and it didn't change the formatting, there must be options or config somewhere in CI is all I can think of ... |
updates: