MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / CargoExtension

Class CargoExtension

flow-python/setup.py:48–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48class CargoExtension(Extension):
49 def __init__(self,
50 target,
51 src,
52 dst,
53 features=[]):
54 Extension.__init__(self, target, sources=[])
55 self.target = target
56 self.src = src
57 self.dst = dst
58 self.features = features
59
60 def build(self):
61 command = ['cargo', 'build', '-p', self.target]
62 if len(self.features) != 0:
63 command.append('--features')
64 command.append(' '.join(self.features))
65 if not debug:
66 command.append('--release')
67 sp.check_call(command)
68
69 def install(self, prefix):
70 copy_file('{}/{}'.format(prefix, self.src), 'megflow/{}'.format(self.dst))
71
72
73class CopyExtension(Extension):

Callers 1

setup.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected