用于Jenkins/本地构建的PyPI本地缓存 [英] PyPI local cache for Jenkins/local builds

查看:161
本文介绍了用于Jenkins/本地构建的PyPI本地缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkins实例,它使用其 PyPI 包中的服务人员来构建我的项目http://www.pip-installer.org/en/latest/requirements.html"rel =" nofollow> requirements.txt .但是,就像使用 TravisCI 构建一样,每次从头开始构建都是非常耗时的,这意味着构建需要> 4- 5分钟,比理想情况慢得多.

I have a Jenkins instance which builds my project with its attendant PyPI packages from requirements.txt. However, like with TravisCI builds, building from scratch each time is very time intensive, and means builds take >4-5mins which is much slower than would be ideal.

我正在寻找的是一种在本地缓存下载的软件包的方法,因此,当启动具有相同依赖项的构建时,不必从PyPI获取它就可以在本地获取,当版本发生更改时,它就可以在本地获取它.可以像现在一样获取上游软件包.

What I'm looking for is a way to cache downloaded packages locally, so when a build with the same dependencies is started, rather than having to get from PyPI it can just fetch locally, when a change in version occurs, it can fetch the upstream package as it does now.

那里有这样的项目吗,因为今天晚上谷歌搜索并没有显示太多.

Is there such a project out there, as Googling this evening hasn't revealed much.

推荐答案

pip开箱即用支持

pip install --download-cache=DIR

如果请求现有文件,则从高速缓存中读取该文件.这也可以通过环境变量PIP_DOWNLOAD_CACHE来完成.

if an existing file is requested, it's read from the cache. This can also be done with an environment variable PIP_DOWNLOAD_CACHE;

这篇关于用于Jenkins/本地构建的PyPI本地缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆