我们有一个通过
$PYTHON -m grpc_tools.protoc -I="foo_proto" --python-out="$package/out" \
--grpc_python_out="$package/out" ./path/to/file.proto
通过以下方式将其集成(读取黑客攻击)到我们的setup.py
建筑中:
from distutils.command.build_py import build_py
class BuildPyCommand(build_py):
"""
Generate GRPC code before building the package.
"""
def run(self):
import subprocess
subprocess.call(["./bin/generate_grpc.sh", sys.executable], shell=True)
build_py.run(self)
setup(
....
cmdclass={
'build_py': BuildPyCommand
},
)
尽管如此,当使用遗留setup.py
构建包时,它似乎可以工作,但当使用wheel
构建包时,它根本不工作
在通过wheel
安装软件包时,如何实现这一点
您还可以覆盖控制盘构建过程:
相关问题 更多 >
编程相关推荐