鸡蛋指数代理
collective.eggprox的Python项目详细描述
collective.eggproxy包
内容
-
collective.eggproxy包
- 什么是collective.eggproxy?什么是collective.eggproxy?
- 如何使用collective.eggproxy?
- 高级配置
- 使用粘贴运行代理
- 在构建中安装collective.eggproxy
- 使用apache背后的代理
- mod豸python update on debian etch
- 开发
- 0.5.1(2009-10-19)
- 0.5(2009-10-19)
- 0.4(2009-10-19)
- 0.3.1(2009-04-28)
- 0.3(2009-03-16)
- 0.2.0(2008-09-22)
- 0.1.0(2008-06-06)
什么是collective.eggproxy?
collective.eggproxy是pypi的智能镜像。
只有当像easy_安装这样的程序时,它才会在pypi上收集包 或者是ZC.Buildout要求的。换句话说,不像一些镜子 就像rsync一样,得到整个pypi基(超过5gigas) collective.eggproxy只能得到您需要的内容。
首先运行collective.eggproxy下载pypi索引并构建一个链接页面。 当软件要求特定的包、版本等时。 collective.eggproxy可根据需要下载并本地存储。
如何使用collective.eggproxy?
安装后,您可以将其作为独立服务器启动 像这样:
$ mkdir /tmp/eggs $ eggproxy_run
代理将在8888端口的本地主机上可用。 默认情况下,所有软件包都将下载到/var/www。如果此目录 不存在(或者如果您在Windows下),则需要对其进行配置, 如下一节所述。
从这里开始,您可以像这样在轻松安装中使用它:
easy_install -i http://localhost:8888/ -H "*localhost*" iw.fss
iw.fss包将被下载、本地存储并提供给轻松安装。
在zc.buildout中,只需在buildout部分定义索引值:
[buildout] index = http://localhost:8888/ allow-hosts = *localhost*
就这样!
高级配置
collective.eggproxy可以使用如下配置文件:
[eggproxy] eggs_directory = /path/to/our/cache index = http://pypi.python.org/simple # Update information for files older than 24h update_interval = 24 # Port number where proxy will run port = 8888 # always_refresh is off by default. Setting it to 1 forces eggproxy to # always attempt a pypi connection. Slower but fresher. always_refresh = 0 # timeout is only needed for always_refresh: it sets a socket timeout. timeout = 3
除鸡蛋目录外的所有选项都是可选的。
collective.eggproxy可在三个位置查看:
-
homedir中的eggproxy.conf。这在Windows上也很方便
其中不存在
/etc/。 - ../etc/eggproxy.conf 从二进制文件中可以看到,可以用于 构建设置(请参阅下面的构建文档)。
- /etc/eggproxy.conf
使用粘贴运行代理
需要粘贴配置文件:
$ paster make-config collective.eggproxy myconfig.ini
可以随意编辑默认配置。 此配置将覆盖eggproxy.conf文件。
然后使用粘贴器为应用程序提供服务:
$ paster serve configfile.ini
并进行测试:
$ easy_install -i http://localhost:8888/ -H "*localhost*" iw.fss
在构建中安装collective.eggproxy
一种快速设置collective.eggproxy的方法是将其安装在 建造。它的优点是它被很好地包含在一个 目录。您可以使用以下构建配置作为示例:
[buildout] parts = console_scripts configuration [console_scripts] recipe = zc.recipe.egg eggs = collective.eggproxy [configuration] recipe = collective.recipe.template input = etc/eggproxy.conf.in output = etc/eggproxy.conf
这将把eggproxy_run和eggproxy_update脚本放在 bin/ 目录中。 用eggproxy.conf在buildout中添加一个子目录 文件:
[eggproxy] eggs_directory = ${buildout:directory}/var/cache #update_interval = 24 #index = http://pypi.python.org/simple #port = 8888
collective.recipe.template 会将其转换为 具有正确设置的etc/eggproxy.conf
使用apache背后的代理
您还可以将collective.eggproxy与apache一起使用。你会需要的 apache的mod_python 3.3。它不能与以前的版本一起使用。
Debian Etch用户:Etch提供3.2,因此Etch用户必须获得源代码 从"lenny"(测试)打包并用dpkg buildpackage重新构建。请 查看本文档中的相关部分以获取帮助。
http://servername/pypi的apache设置可以是:
$ mkdir /tmp/eggs $ eggproxy_run0
apache必须能够写入"/path/to/pypi"!(通常apache用户是 www数据。要更新代理的egg信息,必须添加脚本 eggproxy_update 进入此用户的crontab。
在Debian Etch上更新mod python
来自Debian"Lenny"来源的快速构建说明:
$ mkdir /tmp/eggs $ eggproxy_run1
访问http://packages.debian.org/sources/lenny/libapache2-mod-python" rel="nofollow">http://packages.debian.org/sources/lenny/libapache2 mod python并获取 具有以下扩展名的文件:
- .dsc
- .orig.tar.gz
- .diff.gz
$ mkdir /tmp/eggs $ eggproxy_run2
您应该有以下文件:
- libapache2-mod-python_3.3.1-3_i386.deb
- libapache2-mod-python-doc_3.3.1-3_all.deb
最后一步是调用dpkg
$ mkdir /tmp/eggs $ eggproxy_run3
开发
SVN存储库是PLONE集合: https://svn.plone.org/svn/collective/collective.eggproxy/trunk