Skip to content

Fix failing stubgen tests #16779

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 2 commits into from
Jan 13, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/test_stubgenc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'misc/test-stubgenc.sh'
- 'mypy/stubgenc.py'
- 'mypy/stubdoc.py'
- 'mypy/stubutil.py'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is the cause the test didn't run on the PEP-604 PR

- 'test-data/stubgen/**'

permissions:
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
rev: 23.9.1 # must match test-requirements.txt
hooks:
- id: black
exclude: '^(test-data/)'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4 # must match test-requirements.txt
hooks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from . import demo as demo
from typing import List, Optional, Tuple, overload
from typing import List, Tuple, overload

class StaticMethods:
def __init__(self, *args, **kwargs) -> None: ...
Expand All @@ -21,7 +21,7 @@ class TestStruct:
def field_readonly(self) -> int: ...

def func_incomplete_signature(*args, **kwargs): ...
def func_returning_optional() -> Optional[int]: ...
def func_returning_optional() -> int | None: ...
def func_returning_pair() -> Tuple[int, float]: ...
def func_returning_path() -> os.PathLike: ...
def func_returning_vector() -> List[float]: ...
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from . import demo as demo
from typing import List, Optional, Tuple, overload
from typing import List, Tuple, overload

class StaticMethods:
def __init__(self, *args, **kwargs) -> None:
Expand Down Expand Up @@ -42,7 +42,7 @@ class TestStruct:

def func_incomplete_signature(*args, **kwargs):
"""func_incomplete_signature() -> dummy_sub_namespace::HasNoBinding"""
def func_returning_optional() -> Optional[int]:
def func_returning_optional() -> int | None:
"""func_returning_optional() -> Optional[int]"""
def func_returning_pair() -> Tuple[int, float]:
"""func_returning_pair() -> Tuple[int, float]"""
Expand Down