forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.py
32 lines (29 loc) · 1.13 KB
/
options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import annotations
import sys
class CompilerOptions:
def __init__(
self,
strip_asserts: bool = False,
multi_file: bool = False,
verbose: bool = False,
separate: bool = False,
target_dir: str | None = None,
include_runtime_files: bool | None = None,
capi_version: tuple[int, int] | None = None,
python_version: tuple[int, int] | None = None,
) -> None:
self.strip_asserts = strip_asserts
self.multi_file = multi_file
self.verbose = verbose
self.separate = separate
self.global_opts = not separate
self.target_dir = target_dir or "build"
self.include_runtime_files = (
include_runtime_files if include_runtime_files is not None else not multi_file
)
# The target Python C API version. Overriding this is mostly
# useful in IR tests, since there's no guarantee that
# binaries are backward compatible even if no recent API
# features are used.
self.capi_version = capi_version or sys.version_info[:2]
self.python_version = python_version