github上Devstack的一些变动,截至8.20
从github下直接clone下来的代码在执行之前须要对一些文件进行改动,否则会出现关于REQUIREMENTS的错误
说明:代码前边是"-"号的,须要删除,代码前边是“+”号的,是须要加入上去的。注意区分哪些是凝视,哪些是代码,只是多解释了。
1./inc/python
66行,function pip_install_gr { #这个函数内
# Wrapper for ``pip install`` to set cache and proxy environment variables
# Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``,
-# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``
+# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``,
+# ``REQUIREMENTS_MODE``
# pip_install package [package ...]
function pip_install {
local xtrace=$(set +o | grep xtrace)
103行。function pip_install { #这个函数内
fi
fi + cmd_pip="$cmd_pip install"
+
+ # Handle a constraints file, if needed.
+ if [ "$REQUIREMENTS_MODE" == "constraints" -a -n "$REQUIREMENTS_DIR" ]; then
+ cmd_pip="$cmd_pip -c $REQUIREMENTS_DIR/upper-constraints.txt"
+ fi
+
local pip_version=$(python -c "import pip; \
print(pip.__version__.strip('.')[0])")
if (( pip_version<6 )); then
116行。function pip_install { #这个函数内
https_proxy="${https_proxy:-}" \
no_proxy="${no_proxy:-}" \
PIP_FIND_LINKS=$PIP_FIND_LINKS \
- $cmd_pip install $upgrade \
+ $cmd_pip $upgrade \
$@
# Also install test requirements
128行,function pip_install { #这个函数内
https_proxy=${https_proxy:-} \
no_proxy=${no_proxy:-} \
PIP_FIND_LINKS=$PIP_FIND_LINKS \
- $cmd_pip install $upgrade \</span>
+ $cmd_pip $upgrade \</span>
-r $test_req
fi<span style="color:#aa22aa;">
215行,说明:这个函数我并没有在源文件里找到。不知道是不是须要自己手动加入,假设有知道结果的希望能够告诉我。
function setup_package_with_req_sync { #这个函数内
# ``errexit`` requires us to trap the exit code when the repo is changed
local update_requirements=$(cd $project_dir && git diff --exit-code >/dev/null || echo "changed") - if [[ $update_requirements != "changed" ]]; then</span>
+ if [[ $update_requirements != "changed" && "$REQUIREMENTS_MODE" != "constraints" ]]; then
if is_in_projects_txt $project_dir; then
(cd $REQUIREMENTS_DIR; \
./.venv/bin/python update.py $project_dir)
2. /lib/infra
33行。
<div class="diff ctx"># bring down global requirements</div><div class="diff ctx"> git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH</div><div class="diff ctx"> [ ! -d $PIP_VIRTUAL_ENV ] && virtualenv $PIP_VIRTUAL_ENV</div><div class="diff add">+ # XXX: Remove when 7.1 is released.</div><div class="diff add">+ $REQUIREMENTS_DIR/.venv/bin/pip install -U git+https://github.com/pypa/pip@develop#egg=pip</div><div class="diff ctx"> # We don't care about testing git pbr in the requirements venv.</div><div class="diff ctx"> PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr</div><div class="diff ctx"> PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install $REQUIREMENTS_DIR</div>
3../stack.sh
685行,
# Configure an appropriate Python environment
if [[ "$OFFLINE" != "True" ]]; then
+ REQUIREMENTS_MODE=${REQUIREMENTS_MODE:-} \
PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
fi
699行。
virtualenv --system-site-packages $DEST/.venv
source $DEST/.venv/bin/activate
$DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip
+ # XXX: Remove when 7.1 is released.
+ $DEST/.venv/bin/pip install -U git+https://github.com/pypa/pip@develop#egg=pip
fi # Do the ugly hacks for broken packages and distros
4. ./stackrc
149行,
# Zero disables timeouts
GIT_TIMEOUT=${GIT_TIMEOUT:-0} +# Requirements enforcing mode
+#
+# - strict (default) : ensure projects.txt requirements files match
+# what's in global requirements.
+#
+# - constraints : do not modify project requirements at all. Instead
+# use upper-constraints.txt to constraint the versions of things installed
+# via pip for all pip invocations made during stack.sh.
+REQUIREMENTS_MODE=${REQUIREMENTS_MODE:-strict} # Repositories
# ------------
5. /tools/build_wheel.sh
56行。
# Prepare the workspace
TMP_VENV_PATH=$(mktemp -d tmp-venv-XXXX)
virtualenv $TMP_VENV_PATH
+# Back this out when 7.1 is released.
+$TMP_VENV_PATH/bin/pip install -U git+https://github.com/pypa/pip@develop#egg=pip # Install modern pip and wheel
-PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install -U pip wheel
+PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install -U wheel # BUG: cffi has a lot of issues. It has no stable ABI, if installed
# code is built with a different ABI than the one that's detected at
6. /tools/install_pip.sh
62行。
function install_get_pip {
}
+function install_constraints_pip {
+ # Constraints requires pip 7.1.0 or newer. For now, when constraints are
+ # used, if -c isn't in the help, install develop.
+ if !(pip install -h | grep -- --constraint); then
+ sudo -H -E python -m pip install -U git+https://github.com/pypa/pip@develop#egg=pip
+ fi
+}
+
+
function configure_pypi_alternative_url {
PIP_ROOT_FOLDER="$HOME/.pip"
PIP_CONFIG_FILE="$PIP_ROOT_FOLDER/pip.conf"
97行,
get_versions
uninstall_package python-pip install_get_pip
+if [[ "$REQUIREMENTS_MODE" == "constraints" ]]; then
+ install_constraints_pip
+fi if [[ -n $PYPI_ALTERNATIVE_URL ]]; then
configure_pypi_alternative_url
再说一下,改动代码的时候,加号和减号记得自己删除掉,别直接都粘贴上去了。
github上Devstack的一些变动,截至8.20的更多相关文章
- Github上关于iOS的各种开源项目集合(强烈建议大家收藏,查看,总有一款你需要)
下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITableVie ...
- 参与github上开源项目的大致流程和注意事项
Foreword github是一个很火的代码托管服务网站,可能好多人都想参与一两个项目玩一玩学习一下,但由于是纯英文的网站,可能又会止步于想法上没有动手实践.接下来我就介绍一下参与github上开源 ...
- GitHub 上有哪些完整的 iOS-App 源码值得参考
作者:wjh2005链接:https://www.zhihu.com/question/28518265/answer/88750562来源:知乎著作权归作者所有,转载请联系作者获得授权. 1. Co ...
- GitHub上不错的Android开源项目(三)
收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) GitHub上不错的Android开源项目(一):http://ww ...
- GitHub上不错的Android开源项目(二)
收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) 系列文章如下: GitHub上不错的Android开源项目(一):h ...
- GitHub上最火的74个Android开源项目
GitHub上最火的74个Android开源项目 1.ActionBarSherlock ActionBarSherlock应该算得上是GitHub上最火的Android开源项目了,它是一个独立的库, ...
- GitHub上最火的40个Android开源项目(二)
21.drag-sort-listview DragSortListView(DSLV)是Android ListView的一个扩展,支持拖拽排序和左右滑动删除功能.重写了TouchIntercept ...
- Android github上的好的开源项目汇总
转自:http://blog.csdn.net/ithomer/article/details/8882236 GitHub 上的开源项目不胜枚举,越来越多的开源项目正在迁移到GitHub平台上.基于 ...
- github上关于iOS的各种开源项目集合(转)
UI 下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITable ...
随机推荐
- 组件的使用(三)AutoCompleteTextView的使用
AutoCompleteTextView经常使用的属性: android:completionHint 下拉列表以下的说明性文字 android:completionThreshold 弹出下来列表的 ...
- QT 随笔
1. 设置窗体属性,无边框 | 置顶 setWindowFlags(Qt::FramelessWindowHint); setWindowFlags(Qt::FramelessWindowHin ...
- BZOJ 2124: 等差子序列 线段树维护hash
2124: 等差子序列 Description 给一个1到N的排列{Ai},询问是否存在1<=p1=3),使得Ap1,Ap2,Ap3,…ApLen是一个等差序列. Input 输入的第一行包含一 ...
- ROS-OPENCV
前言:opencv是一个开源的跨平台计算机视觉库. 前提:1.已下载并编译了相关功能包集,如还未下载,可通过git下载:https://github.com/huchunxu/ros_explorin ...
- spring《四》自动装配
byName模式<bean autowire="byName"> Spring会查找一个叫做date的bean定义. byType模式<bean autowire ...
- Java操作Kafka执行不成功
使用kafka-clients操作kafka始终不成功,原因不清楚,下面贴出相关代码及配置,请懂得指点一下,谢谢! 环境及依赖 <dependency> <groupId>or ...
- c# ExecuteScalar()
ExecuteScalar这个方法是从数据库中检索单个值返回值是object类型,必须用与它在数据库里存放的类型相同类型或者可以转换成的类型,比如数据是nchar类型值为 "123" ...
- js禁止
很多时候需要用到js禁止相关的代码: function prohibit() { // 禁止右键 $(document).ready(function() { $(document).bind(&qu ...
- Grand Central Dispatch-thread pool pattern
Grand Central Dispatch (GCD) is a technology developed by Apple Inc. to optimize application support ...
- day19-1 迭代器,三元表达式,列表推导式,字典生成式,
目录 迭代器 可迭代对象 迭代器对象 总结 三元表达式(三目表达式) 列表推导式 字典生成式 迭代器 可迭代对象 拥有iter方法的对象就是可迭代对象 # 以下都是可迭代的对象 st = '123'. ...