为纯 Python 软件包构建发行版有什么意义?

What is the point of built distributions for pure Python packages?

可以将 Python 作为 源分发 .tar.gz 格式)或作为 构建分发 共享(车轮格式)。

据我了解,构建发行版的要点是:

然而,bdist 文件的这两个参数似乎不适用于纯 python 包。尽管如此,我还是看到 natsort 出现在 sdist 和 bdist 中。以 bdist 格式共享纯 python 包有什么好处吗?

来自pythonwheels.com

Advantages of wheels

  1. Faster installation for pure Python and native C extension packages.
  2. Avoids arbitrary code execution for installation. (Avoids setup.py)
  3. Installation of a C extension does not require a compiler on Linux, Windows or macOS.
  4. Allows better caching for testing and continuous integration.
  5. Creates .pyc files as part of installation to ensure they match the Python interpreter used.
  6. More consistent installs across platforms and machines.

所以对我来说,我认为第一点和第二点对于一个纯粹的Python包来说是最有意义的。它更小、更快,也更安全。