从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的更多相关文章

  1. Github上关于iOS的各种开源项目集合(强烈建议大家收藏,查看,总有一款你需要)

    下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITableVie ...

  2. 参与github上开源项目的大致流程和注意事项

    Foreword github是一个很火的代码托管服务网站,可能好多人都想参与一两个项目玩一玩学习一下,但由于是纯英文的网站,可能又会止步于想法上没有动手实践.接下来我就介绍一下参与github上开源 ...

  3. GitHub 上有哪些完整的 iOS-App 源码值得参考

    作者:wjh2005链接:https://www.zhihu.com/question/28518265/answer/88750562来源:知乎著作权归作者所有,转载请联系作者获得授权. 1. Co ...

  4. GitHub上不错的Android开源项目(三)

    收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) GitHub上不错的Android开源项目(一):http://ww ...

  5. GitHub上不错的Android开源项目(二)

    收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) 系列文章如下: GitHub上不错的Android开源项目(一):h ...

  6. GitHub上最火的74个Android开源项目

    GitHub上最火的74个Android开源项目 1.ActionBarSherlock ActionBarSherlock应该算得上是GitHub上最火的Android开源项目了,它是一个独立的库, ...

  7. GitHub上最火的40个Android开源项目(二)

    21.drag-sort-listview DragSortListView(DSLV)是Android ListView的一个扩展,支持拖拽排序和左右滑动删除功能.重写了TouchIntercept ...

  8. Android github上的好的开源项目汇总

    转自:http://blog.csdn.net/ithomer/article/details/8882236 GitHub 上的开源项目不胜枚举,越来越多的开源项目正在迁移到GitHub平台上.基于 ...

  9. github上关于iOS的各种开源项目集合(转)

    UI 下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITable ...

随机推荐

  1. 杭电1018-Big Number(大数)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total ...

  2. 【转】详述iOS国际化

    原文网址:http://www.cocoachina.com/ios/20151120/14258.html 在真正将国际化实践前,只知道通过NSLocalizedString方法将相应语言的字符串加 ...

  3. android 方案源码下载repo同步遇到的问题

    1. error: could not verify the tag 'v1.12.4'的解决 repo init -u git://github.com/CyanogenMod/android.gi ...

  4. Core篇——初探依赖注入

    目录 1.DI&&IOC简单介绍 2.UML类图中六种关联关系 3..net core 中DI的使用 4..net core DI初始化源码初窥 DI&&IOC简单介绍 ...

  5. Unity3D项目

    Input.mousePosition //鼠标点击的位置 0 左键  1右键  2滚轮 Input.GetMouseButton(0) //当鼠标左键处于按下状态的时候返回True Input.Ge ...

  6. vue中slot组件的使用

    插槽(Slot)是Vue提出来的一个概念,正如名字一样,插槽用于决定将所携带的内容,插入到指定的某个位置,从而使模板分块,具有模块化的特质和更大的重用性. Slot 是在组件模板中设置的用于在父组件中 ...

  7. Linux学习日记——源码编译Apache

    [本文为笔者在学习Linux 下的软件安装时,尝试使用源码安装Apache 的过程,事后进行一个小小的总结,发现错误望指正.] 一.典型的源码编译安装软件的过程包括以下3步: 1) 运行 config ...

  8. C#获取URL参数值

    原文:C#获取URL参数值 在写程序的时候,我们经常需要对页面进行传参数,比如page?id=1234,那么在page这个页面中就直接可以使用string id = Request.QueryStri ...

  9. C#数组大小分析(附测试过程中想起的debug和release区别)

    C#数组的理论最大长度到底是多少呢?曾经一度问过度娘,谷歌,貌似都没有得出一个比较准确的答案,无外乎是什么Int32的最大值啊什么的,今天终于决定写个软件来自己测试一下,在几台不同的电脑里面实际测试看 ...

  10. Type system

    Type system[edit] Main articles: Data type, Type system, and Type safety A type system defines how a ...