可以将 Python 共享为 源码分发 ( .tar.gz
格式)或作为 内置分发 (轮子格式)。
据我了解,构建发行版的要点是:
但是, bdist 文件的这两个参数似乎不适用于纯 python 包。尽管如此,我还是看到了 natsort有 sdist 和 bdist。以 bdist 格式共享纯 python 包有什么好处吗?
最佳答案
来自 pythonwheels.com :
Advantages of wheels
- Faster installation for pure Python and native C extension packages.
- Avoids arbitrary code execution for installation. (Avoids setup.py)
- Installation of a C extension does not require a compiler on Linux, Windows or macOS.
- Allows better caching for testing and continuous integration.
- Creates .pyc files as part of installation to ensure they match the Python interpreter used.
- More consistent installs across platforms and machines.
所以对我来说,我认为第一点和第二点对于纯 Python 包最有意义。它更小、更快、也更安全。
关于python - 为纯 Python 包构建发行版的意义何在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59619940/