检查构建配置中的egg更新。
buildout-versions-checker的Python项目详细描述
分析一个zc.buildout文件,该文件包含 别针版本的鸡蛋,并检查是否有任何更新可用。
用法
如果你用实际惯例来确定所有鸡蛋的版本 在构建文件时,您会发现这个包对于 检查Pypi上是否有最新版本的鸡蛋
下面是版本文件的示例:
$ cat versions.cfg [versions] Pillow = 2.0.0 pytz = 2012j South = 0.8.1 django = 1.5 django-tagging = 0.3.1
现在让我们执行check-buildout-updates脚本:
$ ./check-buildout-updates [versions] Pillow = 2.1.0 pytz = 2013b South = 0.8.2 django = 1.5.2
现在可以根据需要更新versions.cfg文件
选项
usage: check-buildout-updates [-h] [--pre] [-s SPECIFIERS] [-i INCLUDES] [-e EXCLUDES] [-w] [--indent INDENTATION] [--sorting {alpha,ascii,length}] [--service-url SERVICE_URL] [--timeout TIMEOUT] [-t THREADS] [-v] [-q] [source] Check availables updates from a version section of a buildout script positional arguments: source The file where versions are pinned (default: versions.cfg) optional arguments: -h, --help show this help message and exit Allowed versions: --pre Allow pre-releases and development versions (by default only stable versions are found) -s SPECIFIERS, --specifier SPECIFIERS Describe what versions of a package are acceptable. Example "package:>=1.0,!=1.3.4.*,< 2.0" (can be used multiple times) Filtering: -i INCLUDES, --include INCLUDES Include package when checking updates (can be used multiple times) -e EXCLUDES, --exclude EXCLUDES Exclude package when checking updates (can be used multiple times) File: -w, --write Write the updates in the source file --indent INDENTATION Spaces used when indenting "key = value" (default: auto) --sorting {alpha,ascii,length} Sorting algorithm used on the keys when writing source file (default: None) Network: --service-url SERVICE_URL The service to use for checking the packages (default: https://pypi.python.org/pypi) --timeout TIMEOUT Timeout for each request (default: 10s) -t THREADS, --threads THREADS Threads used for checking the versions in parallel Verbosity: -v Increase verbosity (specify multiple times for more) -q Decrease verbosity (specify multiple times for more)
构建集成
您可以很容易地将此脚本集成到构建脚本中 自动查找和写入更新。
[buildout] parts = evolution [evolution] recipe = zc.recipe.egg eggs = buildout-versions-checker scripts = check-buildout-updates=evolve arguments = '-w --indent 24 -s django:<1.8 buildout.cfg'
有了这个部分,名为./bin/evolve的新脚本将 被创造。它将检查 versions.cfg文件的{tt1}$部分,然后写入找到的更新。
python兼容性
构建版本检查器最初是为Python2.7开发的,但是 已经为Python3.4及更高版本进行了移植和测试。
要求
- 六>;=1.4.1
- 期货>;=3.0.2
- 包装>;=16
额外费用
构建版本检查器还提供了额外的脚本来简化 维护你的版本文件。
indent-buildout
indent-buildout设计用于仅(重新)缩进构建文件。 因为构建文件有时混合了空格和表格 可能会影响查看和编辑。
$ ./indent-buildout buildout.cfg versions.cfg
find-unused-versions
find-unused-versions只要检查你的蛋是否没有被钉住 安装中未使用。为了获得更好的结果,请在 全新安装。
$ ./find-unused-versions