Skip to content

Commit 06a566b

Browse files
authored
stubgen: Add flagfile support (#18061)
## Description This is already supported by main `mypy` binary and `dmypy` but not by `stubgen`. ## Context I maintain https://github.com/KapJI/homeassistant-stubs which automatically generates typing stubs. Currently list of arguments there is 50 KB long and this can be longer that supported by OS (depending on configuration). It'd help to write these args to flagfile.
1 parent 5313497 commit 06a566b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/stubgen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,9 @@ def generate_stubs(options: Options) -> None:
17931793

17941794

17951795
def parse_options(args: list[str]) -> Options:
1796-
parser = argparse.ArgumentParser(prog="stubgen", usage=HEADER, description=DESCRIPTION)
1796+
parser = argparse.ArgumentParser(
1797+
prog="stubgen", usage=HEADER, description=DESCRIPTION, fromfile_prefix_chars="@"
1798+
)
17971799

17981800
parser.add_argument(
17991801
"--ignore-errors",

0 commit comments

Comments
 (0)