本文整理汇总了Python中pants.contrib.node.tasks.node_resolve.NodeResolve类的典型用法代码示例。如果您正苦于以下问题:Python NodeResolve类的具体用法?Python NodeResolve怎么用?Python NodeResolve使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NodeResolve类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register_goals
def register_goals():
NodeResolve.register_resolver_for_type(ScalaJSBinary, ScalaJSPlatform)
# NB: These task/goal assignments are pretty nuts, but are necessary in order to
# prevent product-graph cycles between the JVM and node.js.
# see https://github.com/pantsbuild/pants/labels/engine
task(name='scala-js-compile', action=ScalaJSZincCompile).install('resolve')
task(name='scala-js-link', action=ScalaJSLink).install('resolve')
示例2: test_register_resolver_for_type
def test_register_resolver_for_type(self):
NodeResolve._clear_resolvers()
self.assertIsNone(NodeResolve._resolver_for_target(NodePreinstalledModule))
self.assertIsNone(NodeResolve._resolver_for_target(NodeModule))
node_preinstalled__module_target = self.make_target(
spec=":empty_fake_node_preinstalled_module_target", target_type=NodePreinstalledModule
)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver)
self.assertEqual(
NodePreinstalledModuleResolver, NodeResolve._resolver_for_target(node_preinstalled__module_target)
)
node_module_target = self.make_target(spec=":empty_fake_node_module_target", target_type=NodeModule)
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
self.assertEqual(NpmResolver, NodeResolve._resolver_for_target(node_module_target))
示例3: register_options
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
register(
'--install-optional', type=bool, default=False, fingerprint=True,
help='If enabled, install optional dependencies.')
register(
'--install-production', type=bool, default=False, fingerprint=True,
help='If enabled, do not install devDependencies.')
register(
'--force', type=bool, default=False, fingerprint=True,
help='If enabled, refetch and resolve dependencies even if they are already built.')
register(
'--frozen-lockfile', type=bool, default=True, fingerprint=True,
help='If enabled, disallow automatic update of lock files.')
# There are cases where passed through options does not override hard-coded options.
# One example is for node-install, --frozen-lockfile=False is the dominate configuration
# as it allows the user to modify dependencies and generate a new lockfile.
# By turning on --force-option-override, the user accepts full responsibilities.
register(
'--force-option-override', type=bool, default=False, fingerprint=True, advanced=True,
help='If enabled, options will override hard-coded values. Be aware of default values.')
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例4: tearDown
def tearDown(self):
super(NodeTestTest, self).tearDown()
NodeResolve._clear_resolvers()
示例5: setUp
def setUp(self):
super(NodeTestTest, self).setUp()
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
示例6: register_options
def register_options(cls, register):
super(NodePreinstalledModuleResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
示例7: tearDown
def tearDown(self):
super(NodeResolveSourceDepsTest, self).tearDown()
NodeResolve._clear_resolvers()
示例8: setUp
def setUp(self):
super(NodeResolveSourceDepsTest, self).setUp()
NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver)
NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
示例9: register_options
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
register(
'--install-optional', type=bool, default=False, fingerprint=True,
help='If enabled, install optional dependencies.')
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例10: register_options
def register_options(cls, register):
register('--fetch-timeout-secs', type=int, advanced=True, default=10,
help='Timeout the fetch if the connection is idle for longer than this value.')
super(NodePreinstalledModuleResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
示例11: register_options
def register_options(cls, register):
super(NpmResolver, cls).register_options(register)
NodeResolve.register_resolver_for_type(NodeModule, cls)
示例12: test_product_types
def test_product_types(self):
self.assertEqual([NodePaths], NodeResolve.product_types())
示例13: register_options
def register_options(cls, register):
NodeResolve.register_resolver_for_type(WebPackModule, cls)
NodeResolve.register_resolver_for_type(NpmResource, cls)
super(WebPackResolver, cls).register_options(register)