Python 的自定义构建后端
我想编写自己的 Python 构建后端,可以在 pyproject.toml 中使用,就像
[build-system]
requires = ["setuptools>=42", "wheel", "mybackend"]
build-backend = "mybackend.build_meta"
setuptools 一样,除了它预先将行添加
# nice code!
到每个 <代码>.py 文件。 mybackend
必须提供哪些入口点,是否可以以某种方式从 setuptools 中“继承”?
I would like to write my own Python build backend that can used in pyproject.toml
like
[build-system]
requires = ["setuptools>=42", "wheel", "mybackend"]
build-backend = "mybackend.build_meta"
and that does the same thing as setuptools, except that it preprends the line
# nice code!
to each .py
file. What entry points would mybackend
have to provide, and is it possible to somehow "inherit" from setuptools?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
扩展 setuptools 的一种方法是使用将它们包装在您自己的 build_wheel/build_sdist 中,例如
而不是立即返回 setuptools 函数的输出(例如,tar 文件),人们可以处理这些文件。
One way to extend
setuptools
is to use wrap those in your ownbuild_wheel
/build_sdist
likeInstead of immediately returning the output of the setuptools functions (e.g., the tar-file), one can work on those files.