Remove venv_command Refer to https://goto.google.com/cros-infra-explicit-virtualenv for design. BUG=None TEST=None Change-Id: Ia20949203802e62454867e84a7e15a7a36a9da20 Reviewed-on: https://chromium-review.googlesource.com/446518 Commit-Ready: Allen Li <ayatane@chromium.org> Tested-by: Allen Li <ayatane@chromium.org> Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/venv_command b/venv_command deleted file mode 100755 index f95e2af..0000000 --- a/venv_command +++ /dev/null
@@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright 2016 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# Run a command in a virtualenv environment. -# -# $ venv_command path/to/venv command [args...] -# -# Note: This is deprecated in favor of running the virtualenv python directly: -# -# $ path/to/venv/bin/python -set -eu - -main() { - if [[ $# -lt 2 ]]; then - print_help >&2 - exit 1 - fi - - local venv_dir=$1 - shift 1 - - activate_venv "$venv_dir" - exec "$@" -} - -print_help() { - echo "Usage: $0 path/to/venv command [args...] - -Run a command in a Python virtualenv environment." -} - -activate_venv() { - local venv_dir=$1 - set +u # activate script relies on unset variables. - # shellcheck source=/dev/null - . "$venv_dir/bin/activate" - set -u -} - -main "$@"