使用时buildPythonPackage
由此产生的轮子最终为$dist/${pname}-${version}-py2.py3-none-any.whl
。py2.py3
是 Python 版本,none
是 ABI,any
是平台。在构建包时如何指定这些?我能找到的最接近参考文献nixpkgs/pkgs/development/interpreters/python
的是computeWheelUrl
,它采用python ? "py2.py3"
、abi ? "none"
和platform ? "any"
。
答案1
请参阅指定车轮格式的相关 PEP: https://peps.python.org/pep-0427/#file-name-convention
这些属性需要传递给获取器,fetchPypi
。以下表达式部分展示了如何使用预构建的轮子构建 numpy:
{ buildPythonPackage
, fetchPypi
, ...
}:
buildPythonPackage {
pname = "numpy";
version = "1.23.3";
format = "wheel";
src = fetchPypi {
inherit pname version format;
python = "cp310";
abi = "cp310";
platform = "manylinux_2_17_x86_64.manylinux2014_x86_64";
sha256 = "004f0efcb2fe1c0bd6ae1fcfc69cc8b6bf2407e0f18be308612007a0762b4089";
};
...
}