-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Restore atheris stubs #15140
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
Restore atheris stubs #15140
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| version = "2.3.*" | ||
| upstream_repository = "https://github.com/google/atheris" | ||
| partial_stub = true | ||
|
|
||
| [tool.stubtest] | ||
| ignore_missing_stub = true | ||
| # TODO (2025-03-05): unskip once `atheris` can be installed on `ubuntu-24.04`, | ||
| # see https://github.com/python/typeshed/pull/13582 and | ||
| # https://github.com/google/atheris/issues/82 | ||
| skip = true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from collections.abc import Callable | ||
|
|
||
| def Setup( | ||
| args: list[str], | ||
| test_one_input: Callable[[bytes], None], | ||
| **kwargs: bool | Callable[[bytes, int, int], str | bytes] | Callable[[bytes, bytes, int, int], str | bytes] | None, | ||
| ) -> list[str]: ... | ||
| def Fuzz() -> None: ... | ||
| def Mutate(data: bytes, max_size: int) -> bytes: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from typing import Any | ||
|
|
||
| def hook_re_module() -> None: ... | ||
|
|
||
| class EnabledHooks: | ||
| def __init__(self) -> None: ... | ||
| def add(self, hook: str) -> None: ... | ||
| def __contains__(self, hook: str) -> bool: ... | ||
|
|
||
| enabled_hooks: EnabledHooks | ||
|
|
||
| # args[1] is an arbitrary string method that is called | ||
| # with the subsequent arguments, so they will vary | ||
| def _hook_str(*args: Any, **kwargs: Any) -> bool: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import types | ||
| from collections.abc import Sequence | ||
| from importlib import abc, machinery | ||
| from typing_extensions import Self | ||
|
|
||
| def _should_skip(loader: abc.Loader) -> bool: ... | ||
|
|
||
| class AtherisMetaPathFinder(abc.MetaPathFinder): | ||
| def __init__( | ||
| self, include_packages: set[str], exclude_modules: set[str], enable_loader_override: bool, trace_dataflow: bool | ||
| ) -> None: ... | ||
| def find_spec( | ||
| self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = None | ||
| ) -> machinery.ModuleSpec | None: ... | ||
| def invalidate_caches(self) -> None: ... | ||
|
|
||
| class AtherisSourceFileLoader: | ||
| def __init__(self, name: str, path: str, trace_dataflow: bool) -> None: ... | ||
| def get_code(self, fullname: str) -> types.CodeType | None: ... | ||
|
|
||
| class AtherisSourcelessFileLoader: | ||
| def __init__(self, name: str, path: str, trace_dataflow: bool) -> None: ... | ||
| def get_code(self, fullname: str) -> types.CodeType | None: ... | ||
|
|
||
| def make_dynamic_atheris_loader(loader: abc.Loader | type[abc.Loader], trace_dataflow: bool) -> abc.Loader: ... | ||
|
|
||
| class HookManager: | ||
| def __init__( | ||
| self, include_packages: set[str], exclude_modules: set[str], enable_loader_override: bool, trace_dataflow: bool | ||
| ) -> None: ... | ||
| def __enter__(self) -> Self: ... | ||
| def __exit__(self, *args: object) -> None: ... | ||
|
|
||
| def instrument_imports( | ||
| include: Sequence[str] | None = None, exclude: Sequence[str] | None = None, enable_loader_override: bool = True | ||
| ) -> HookManager: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from collections.abc import Callable | ||
| from typing import TypeVar | ||
|
|
||
| _T = TypeVar("_T") | ||
|
|
||
| def instrument_func(func: Callable[..., _T]) -> Callable[..., _T]: ... | ||
| def instrument_all() -> None: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from typing import Protocol, type_check_only | ||
|
|
||
| def path() -> str: ... | ||
| @type_check_only | ||
| class _Writer(Protocol): | ||
| def isatty(self) -> bool: ... | ||
| def write(self, content: str, /) -> object: ... | ||
| def flush(self) -> object: ... | ||
|
|
||
| class ProgressRenderer: | ||
| def __init__(self, stream: _Writer, total_count: int) -> None: ... | ||
| def render(self) -> None: ... | ||
| def erase(self) -> None: ... | ||
| def drop(self) -> None: ... | ||
| @property | ||
| def count(self) -> int: ... | ||
| @count.setter | ||
| def count(self, new_count: int) -> None: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import types | ||
| from typing import Final | ||
|
|
||
| PYTHON_VERSION: Final[tuple[int, int]] | ||
| CONDITIONAL_JUMPS: Final[list[str]] | ||
| UNCONDITIONAL_JUMPS: Final[list[str]] | ||
| ENDS_FUNCTION: Final[list[str]] | ||
| HAVE_REL_REFERENCE: Final[list[str]] | ||
| HAVE_ABS_REFERENCE: Final[list[str]] | ||
| REL_REFERENCE_IS_INVERTED: Final[list[str]] | ||
|
|
||
| def rel_reference_scale(opname: str) -> int: ... | ||
|
|
||
| REVERSE_CMP_OP: Final[list[int]] | ||
|
|
||
| def jump_arg_bytes(arg: int) -> int: ... | ||
| def add_bytes_to_jump_arg(arg: int, size: int) -> int: ... | ||
|
|
||
| class ExceptionTableEntry: | ||
| def __init__(self, start_offset: int, end_offset: int, target: int, depth: int, lasti: bool) -> None: ... | ||
| def __eq__(self, other: object) -> bool: ... | ||
|
|
||
| class ExceptionTable: | ||
| def __init__(self, entries: list[ExceptionTableEntry]) -> None: ... | ||
| def __eq__(self, other: object) -> bool: ... | ||
|
|
||
| def generate_exceptiontable(original_code: types.CodeType, exception_table_entries: list[ExceptionTableEntry]) -> bytes: ... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we try unskipping this and see what CI says?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that stubtest in CI uses 3.13 and this version of atheris only supports 3.12, I'd wait for us to update the stubs to 3.0.0 before doing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good