summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2017-01-30 18:46:17 +0000
committerJavier Jardón <jjardon@gnome.org>2017-03-01 13:05:46 +0000
commit6e9655ab260fafdef174c8e75cf11243dd4b9e05 (patch)
tree3cd5cff5af0b814acdd93b647b1b0905ab41b7ea
parente4be6b57baa671915c0eca6a8407d24c6bb987b7 (diff)
downloadybd-jjardon/virtualenv2.tar.gz
install_dependencies.sh: Use virtualenvjjardon/virtualenv2
This will allow us to not depend at all on already installed python packages in the host machine Fixes #253
-rw-r--r--.gitlab-ci.yml5
-rwxr-xr-xinstall_dependencies.sh33
2 files changed, 20 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 099668c..0510efe 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,8 @@ image: debian:jessie
before_script:
- sh ./install_dependencies.sh
- git clone git://git.baserock.org/baserock/baserock/definitions ../definitions
+- virtualenv YBD_ENV && source YBD_ENV/bin/activate
+- YBD_ENV/bin/pip install -r requirements.freeze.txt
cache:
paths:
@@ -17,7 +19,8 @@ stages:
check_pep8:
stage: pep8
- script: "pycodestyle --show-source --show-pep8"
+ script:
+ - pycodestyle --show-source --show-pep8 --exclude=YBD_ENV
cache_keys_v1:
stage: cache_keys
diff --git a/install_dependencies.sh b/install_dependencies.sh
index 9e856e9..9dd4740 100755
--- a/install_dependencies.sh
+++ b/install_dependencies.sh
@@ -33,8 +33,7 @@ installed=false
command -v apt-get >/dev/null 2>&1
if [ $? -eq 0 ]; then
$SUDO apt-get -qq update
- $SUDO apt-get -qq remove python-pip
- $SUDO apt-get -qq install build-essential gawk git m4 wget python python-dev git
+ $SUDO apt-get -qq install build-essential gawk git m4 wget python python-dev git python-pip
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
@@ -45,8 +44,7 @@ fi
# install for fedora
command -v dnf >/dev/null 2>&1
if [ $? -eq 0 ] && [ $installed = false ]; then
- $SUDO dnf remove -y python-pip
- $SUDO dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python python-devel git redhat-rpm-config
+ $SUDO dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python python-devel git redhat-rpm-config python-pip
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
@@ -57,8 +55,7 @@ fi
# install for aws
command -v yum >/dev/null 2>&1
if [ $? -eq 0 ] && [ $installed = false ]; then
- $SUDO yum remove -y python-pip
- $SUDO yum install -y which make automake gcc gcc-c++ gawk git m4 wget python python-devel git
+ $SUDO yum install -y which make automake gcc gcc-c++ gawk git m4 wget python python-devel git python-pip
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
@@ -69,7 +66,7 @@ fi
# install for Arch
command -v pacman >/dev/null 2>&1
if [ $? -eq 0 ] && [ $installed = false ]; then
- $SUDO pacman -S --noconfirm which make automake gcc gawk git m4 wget python2 git
+ $SUDO pacman -S --noconfirm which make automake gcc gawk git m4 wget python2 git python2-pip
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
@@ -82,14 +79,16 @@ if [ $installed = false ]; then
exit 1
fi
-pip --version 2>&1 > /dev/null
-if [ $? -ne 0 ]; then
- wget https://bootstrap.pypa.io/get-pip.py
- chmod +x get-pip.py
- $SUDO ./get-pip.py
- $SUDO rm get-pip.py
-fi
-
-$SUDO pip install -U pip
+$SUDO pip install virtualenv
-$SUDO pip install -U -r requirements.freeze.txt
+echo "You know should use virtualenv to setup you YBD environmet:"
+echo ""
+echo "> virtualenv YBD_ENV"
+echo ""
+echo "> YBD_ENV/bin/pip install -r requirements.freeze.txt"
+echo ""
+echo "A virtual environment will be created in 'YBD_ENV':"
+echo "Type 'source YBD_ENV/bin/activate' to begin use it"
+echo "When you are done, type 'deactivate' to deactivate it"
+echo "See https://virtualenv.pypa.io for more details"
+echo ""