从pip下载时排除manylinux轮

Ant*_*ile 8 python pip python-wheel

在$ company公司,我们运行一个内部pypi服务器,以保护自己免受公共pypi停机.我们还构建了轮子以避免二进制包的安装开销.一个常见的任务是从公共pypi导入包,其基本归结为:

pip install --download . --no-binary :all: $PACKAGE  # download a source distribution
Run Code Online (Sandbox Code Playgroud)

pip wheel $PACKAGE  # build a binary distribution (or use a cached version that's already on our internal pypi)
Run Code Online (Sandbox Code Playgroud)

根据最新的点,这可能会manylinuxpip wheel阶段下载/安装车轮.由于捆绑.so文件车轮内,这些与$ company的安全要求不兼容.我们如何在避开manylinux车轮的同时继续保持相同的工作流程?

目前我们正在降级pip<8,但这似乎并不理想

Phi*_*nne 0

使用轮子时,您似乎只想使用源发行版而不是轮子。为此,请将其添加--no-use-wheel到您的 pip 命令中。

这听起来有点违反直觉,在构建轮子时使用它,但这实际上意味着Do not Find and prefer wheel archives when searching indexes and find-links locations.这应该在轮子阶段为您依赖的任何依赖强制获取远程源dist,而不是轮子。