forked from WebexCommunity/WebexPythonSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstalldeps
More file actions
executable file
·41 lines (31 loc) · 1.42 KB
/
Copy pathinstalldeps
File metadata and controls
executable file
·41 lines (31 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Install all the development dependencies for this project.
#
# Copyright (c) 2016-2020 Cisco and/or its affiliates.
# License: MIT
set -e
cd "$(dirname "$0")/.."
# Ensure that packages are only installed in an active virtual environment
export PIP_REQUIRE_VIRTUALENV=true
# Prefer use of a Pipfile and pipenv for dependency management
if [[ -f "Pipfile" ]] && [[ -n "$(pipenv --version 2>/dev/null)" ]]; then
echo "==> Installing Pipfile dependencies"
pipenv install --dev --skip-lock
elif [[ -f "requirements.txt" ]]; then
echo "==> Installing requirements.txt dependencies"
# Check for an active virtual environment, or look for one in the project directory
if [[ -n "$(python -c 'import sys; print (sys.real_prefix)' 2>/dev/null)" ]]; then
echo "Installing packages in the active virtual environment"
elif [[ -f "venv/bin/activate" ]]; then
echo "Installing packages in the project's venv virtual environment"
source venv/bin/activate
elif [[ -f ".venv/bin/activate" ]]; then
echo "Installing packages in the project's .venv virtual environment"
source .venv/bin/activate
else
echo >2& "VIRTUAL ENVIRONMENT ERROR: This project will only install packages into a Python virtual environment. Please activate your virtual environment and rerun the script."
exit 1
fi
pip install -r requirements.txt
pip install -e .
fi