Merge "Use tools_path/venv environment variables in install_venv"

This commit is contained in:
Jenkins 2016-02-29 20:00:41 +00:00 committed by Gerrit Code Review
commit 3b6832032a
2 changed files with 14 additions and 4 deletions

View File

@ -52,8 +52,15 @@ def print_help():
def main(argv):
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
venv = os.path.join(root, '.venv')
if 'tools_path' in os.environ:
root = os.environ['tools_path']
else:
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if 'venv' in os.environ:
venv = os.environ['venv']
else:
venv = os.path.join(root, '.venv')
pip_requires = os.path.join(root, 'requirements.txt')
test_requires = os.path.join(root, 'test-requirements.txt')
py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])

View File

@ -14,6 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.
TOOLS=`dirname $0`
VENV=$TOOLS/../.venv
tools_path=${tools_path:-$(dirname $0)}
venv_path=${venv_path:-${tools_path}}
venv_dir=${venv_name:-/../.venv}
TOOLS=${tools_path}
VENV=${venv:-${venv_path}/${venv_dir}}
source $VENV/bin/activate && "$@"