本文整理汇总了Python中pants.option.options_bootstrapper.OptionsBootstrapper.from_options_parse_request方法的典型用法代码示例。如果您正苦于以下问题:Python OptionsBootstrapper.from_options_parse_request方法的具体用法?Python OptionsBootstrapper.from_options_parse_request怎么用?Python OptionsBootstrapper.from_options_parse_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.option.options_bootstrapper.OptionsBootstrapper
的用法示例。
在下文中一共展示了OptionsBootstrapper.from_options_parse_request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_options_parsing_request
# 需要导入模块: from pants.option.options_bootstrapper import OptionsBootstrapper [as 别名]
# 或者: from pants.option.options_bootstrapper.OptionsBootstrapper import from_options_parse_request [as 别名]
def test_options_parsing_request(self):
parse_request = OptionsParseRequest.create(
['./pants', '-ldebug', '--python-setup-wheel-version=3.13.37', 'binary', 'src/python::'],
dict(PANTS_ENABLE_PANTSD='True', PANTS_BINARIES_BASEURLS='["https://bins.com"]')
)
# TODO: Once we have the ability to get FileContent for arbitrary
# paths outside of the buildroot, we can move the construction of
# OptionsBootstrapper into an @rule by cooperatively calling
# OptionsBootstrapper.produce_and_set_bootstrap_options() which
# will yield lists of file paths for use as subject values and permit
# us to avoid the direct file I/O that this currently requires.
options_bootstrapper = OptionsBootstrapper.from_options_parse_request(parse_request)
build_config = BuildConfigInitializer.get(options_bootstrapper)
options = run_rule(parse_options, options_bootstrapper, build_config)[0]
self.assertIn('binary', options.goals)
global_options = options.for_global_scope()
self.assertEquals(global_options.level, 'debug')
self.assertEquals(global_options.enable_pantsd, True)
self.assertEquals(global_options.binaries_baseurls, ['https://bins.com'])
python_setup_options = options.for_scope('python-setup')
self.assertEquals(python_setup_options.wheel_version, '3.13.37')