Skip to content

Commit

Permalink
stubgen: Add flagfile support (#18061)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
KapJI authored Oct 28, 2024
1 parent 5313497 commit 06a566b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,9 @@ def generate_stubs(options: Options) -> None:


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

parser.add_argument(
"--ignore-errors",
Expand Down

0 comments on commit 06a566b

Please sign in to comment.