Speed up tox_install.sh
* When installing git repos into tox venv, there is no need to use full clone. Shallow clone like --depth 1 is sufficient. It speeds up tox venv creation. * Fix import check for networking-bagpipe and networking-odl. Python module names use underscores instead of hyphens, so the current iport check always returns false. As a result, installation of these projects are run multiple times. * Allow to specify GIT_BASE for local testing. Previously PIP_LOCATION exists, but the tox_install.sh installs four repositories so PIP_LOCATION actually cannot be used. In my local env, the time to prepare tox env was reduced from 4m52s to 2m39s for the first run and from 42s to 19s for the second run or later (after applying the first two points above). Change-Id: I8b4a7340c01182174f6a6af063174c57f28015cc
This commit is contained in:
1 changed files with 7 additions and 5 deletions
@@ -15,13 +15,15 @@
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=master
GIT_BASE=${GIT_BASE:-https://git.openstack.org/}
install_project() {
local project=1ドル
local branch=${2:-$BRANCH_NAME}
local module_name=${project//-/_}
set +e
project_installed=$(echo "import $project" | python 2>/dev/null ; echo $?)
project_installed=$(echo "import $module_name" | python 2>/dev/null ; echo $?)
set -e
if [ $project_installed -eq 0 ]; then
@@ -45,10 +47,10 @@ install_project() {
popd
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
if [ -z "$PIP_LOCATION" ]; then
PIP_LOCATION="git+https://git.openstack.org/openstack/$project@$branch#egg=$project"
fi
$install_cmd -U -e ${PIP_LOCATION}
local GIT_REPO="$GIT_BASE/openstack/$project"
SRC_DIR="$VIRTUAL_ENV/src/$project"
git clone --depth 1 --branch $branch $GIT_REPO $SRC_DIR
$install_cmd -U -e $SRC_DIR
fi
}
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.