当前位置: 首页>>代码示例>>Python>>正文


Python Options.semantic_analysis_only方法代码示例

本文整理汇总了Python中mypy.options.Options.semantic_analysis_only方法的典型用法代码示例。如果您正苦于以下问题:Python Options.semantic_analysis_only方法的具体用法?Python Options.semantic_analysis_only怎么用?Python Options.semantic_analysis_only使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mypy.options.Options的用法示例。


在下文中一共展示了Options.semantic_analysis_only方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_semanal_options

# 需要导入模块: from mypy.options import Options [as 别名]
# 或者: from mypy.options.Options import semantic_analysis_only [as 别名]
def get_semanal_options() -> Options:
    options = Options()
    options.use_builtins_fixtures = True
    options.semantic_analysis_only = True
    options.show_traceback = True
    options.python_version = PYTHON3_VERSION
    return options
开发者ID:sixolet,项目名称:mypy,代码行数:9,代码来源:testsemanal.py

示例2: mypy_options

# 需要导入模块: from mypy.options import Options [as 别名]
# 或者: from mypy.options.Options import semantic_analysis_only [as 别名]
def mypy_options(stubgen_options: Options) -> MypyOptions:
    """Generate mypy options using the flag passed by user."""
    options = MypyOptions()
    options.follow_imports = 'skip'
    options.incremental = False
    options.ignore_errors = True
    options.semantic_analysis_only = True
    options.python_version = stubgen_options.pyversion
    return options
开发者ID:python,项目名称:mypy,代码行数:11,代码来源:stubgen.py

示例3: test_transform

# 需要导入模块: from mypy.options import Options [as 别名]
# 或者: from mypy.options.Options import semantic_analysis_only [as 别名]
def test_transform(testcase: DataDrivenTestCase) -> None:
    """Perform an identity transform test case."""

    try:
        src = '\n'.join(testcase.input)
        options = Options()
        options.use_builtins_fixtures = True
        options.semantic_analysis_only = True
        options.show_traceback = True
        options.python_version = testfile_pyversion(testcase.file)
        result = build.build(sources=[BuildSource('main', None, src)],
                             options=options,
                             alt_lib_path=test_temp_dir)
        a = result.errors
        if a:
            raise CompileError(a)
        # Include string representations of the source files in the actual
        # output.
        for fnam in sorted(result.files.keys()):
            f = result.files[fnam]

            # Omit the builtins module and files with a special marker in the
            # path.
            # TODO the test is not reliable
            if (not f.path.endswith((os.sep + 'builtins.pyi',
                                     'typing.pyi',
                                     'abc.pyi'))
                    and not os.path.basename(f.path).startswith('_')
                    and not os.path.splitext(
                        os.path.basename(f.path))[0].endswith('_')):
                t = TypeAssertTransformVisitor()
                f = t.mypyfile(f)
                a += str(f).split('\n')
    except CompileError as e:
        a = e.messages
    if testcase.normalize_output:
        a = normalize_error_messages(a)
    assert_string_arrays_equal(
        testcase.output, a,
        'Invalid semantic analyzer output ({}, line {})'.format(testcase.file,
                                                                testcase.line))
开发者ID:chadrik,项目名称:mypy,代码行数:43,代码来源:testtransform.py

示例4: get_semanal_options

# 需要导入模块: from mypy.options import Options [as 别名]
# 或者: from mypy.options.Options import semantic_analysis_only [as 别名]
def get_semanal_options():
    options = Options()
    options.use_builtins_fixtures = True
    options.semantic_analysis_only = True
    return options
开发者ID:AXGKl,项目名称:Transcrypt,代码行数:7,代码来源:testsemanal.py

示例5: get_semanal_options

# 需要导入模块: from mypy.options import Options [as 别名]
# 或者: from mypy.options.Options import semantic_analysis_only [as 别名]
def get_semanal_options() -> Options:
    options = Options()
    options.use_builtins_fixtures = True
    options.semantic_analysis_only = True
    options.show_traceback = True
    return options
开发者ID:alexandrul,项目名称:mypy,代码行数:8,代码来源:testsemanal.py


注:本文中的mypy.options.Options.semantic_analysis_only方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。