Merge lp:~benji/charms/precise/juju-gui/use-known-pip into lp:~juju-gui/charms/precise/juju-gui/trunk

Proposed by Benji York
Status: Merged
Merged at revision: 135
Proposed branch: lp:~benji/charms/precise/juju-gui/use-known-pip
Merge into: lp:~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 67 lines (+11/-9)
2 files modified
Makefile (+10/-8)
tests/00-setup (+1/-1)
To merge this branch: bzr merge lp:~benji/charms/precise/juju-gui/use-known-pip
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+196328@code.launchpad.net

Description of the change

Include pip dependency instead of using system's

I also killed an entire village of ./

https://codereview.appspot.com/31000043/

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

Reviewers: mp+196328_code.launchpad.net,

Message:
Please take a look.

Description:
Include pip dependency instead of using system's

I also killed an entire village of ./

https://code.launchpad.net/~benji/charms/precise/juju-gui/use-known-pip/+merge/196328

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/31000043/

Affected files (+13, -9 lines):
   M Makefile
   A [revision details]
   M tests/00-setup

Index: Makefile
=== modified file 'Makefile'
--- Makefile 2013-11-19 02:50:54 +0000
+++ Makefile 2013-11-22 16:01:36 +0000
@@ -15,9 +15,9 @@
  # along with this program. If not, see <http://www.gnu.org/licenses/>.

  JUJUTEST = juju-test --timeout=120m -v -e "$(JUJU_ENV)"
-VENV = ./tests/.venv
-SYSDEPS = build-essential bzr libapt-pkg-dev libpython-dev python-pip \
- python-virtualenv rsync xvfb
+VENV = tests/.venv
+SYSDEPS = build-essential bzr libapt-pkg-dev libpython-dev
python-virtualenv \
+ rsync xvfb

  all: setup
@@ -26,14 +26,16 @@
  # support the juju-test plugin, which calls the executable files in
  # alphabetical order.
  setup:
- @./tests/00-setup
+ tests/00-setup
+ # Ensure the correct version of pip has been installed
+ tests/.venv/bin/pip --version | grep "pip 1.4" || exit 1

  sysdeps:
   sudo apt-get install --yes $(SYSDEPS)

  unittest: setup
- ./tests/10-unit.test
- ./tests/11-server.test
+ tests/10-unit.test
+ tests/11-server.test

  ensure-juju-env:
  ifndef JUJU_ENV
@@ -57,7 +59,7 @@

  lint: setup
   @$(VENV)/bin/flake8 --show-source --exclude=.venv \
- ./hooks/ ./tests/ ./server/
+ hooks/ tests/ server/

  clean:
   find . -name '*.pyc' -delete
@@ -65,7 +67,7 @@
   rm -rf tests/download-cache

  deploy: setup
- $(VENV)/bin/python ./tests/deploy.py
+ $(VENV)/bin/python tests/deploy.py

  help:
   @echo -e 'Juju GUI charm - list of make targets:\n'

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision: <email address hidden>

Index: tests/00-setup
=== modified file 'tests/00-setup'
--- tests/00-setup 2013-11-19 14:25:24 +0000
+++ tests/00-setup 2013-11-22 15:16:01 +0000
@@ -34,7 +34,7 @@
      fi
      if [ ! -f "$ACTIVATE" -o "$TEST_REQUIREMENTS" -nt "$ACTIVATE"
-o "$SERVER_REQUIREMENTS" -nt "$ACTIVATE" ]; then
          [ $updated_downloadcache -eq 0 ] && bzr up $DOWNLOADCACHE
- virtualenv --distribute $VENV
+ virtualenv --distribute --extra-search-dir=$DOWNLOADCACHE $VENV
          . $ACTIVATE && \
              yes w | env BZR_PLUGIN_PATH='-user' \
              pip install -r $TEST_REQUIREMENTS --find-links deps
--find-links $DOWNLOADCACHE --no-allow-external --no-index

Revision history for this message
Benji York (benji) wrote :

Here are some pre-review comments.

https://codereview.appspot.com/31000043/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/31000043/diff/1/Makefile#newcode20
Makefile:20: rsync xvfb
We're using pip from the download cache now.

https://codereview.appspot.com/31000043/diff/1/Makefile#newcode31
Makefile:31: tests/.venv/bin/pip --version | grep "pip 1.4" || exit 1
It would be easy to accidentally start using the wrong version
(unupdated download cache for example), so I added an assert of sorts.

https://codereview.appspot.com/31000043/diff/1/Makefile#newcode38
Makefile:38: tests/11-server.test
Death to the dot-slash.

https://codereview.appspot.com/31000043/diff/1/tests/00-setup
File tests/00-setup (right):

https://codereview.appspot.com/31000043/diff/1/tests/00-setup#newcode37
tests/00-setup:37: virtualenv --distribute
--extra-search-dir=$DOWNLOADCACHE $VENV
This makes virtualenv install pip from the download cache.

https://codereview.appspot.com/31000043/

Revision history for this message
Francesco Banconi (frankban) wrote :

I successfully created the testing environment with this branch. LGTM
thank you!

https://codereview.appspot.com/31000043/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/31000043/diff/1/Makefile#newcode38
Makefile:38: tests/11-server.test
On 2013/11/22 17:33:22, benji wrote:
> Death to the dot-slash.

Thanks for killing them.

https://codereview.appspot.com/31000043/diff/1/tests/00-setup
File tests/00-setup (right):

https://codereview.appspot.com/31000043/diff/1/tests/00-setup#newcode37
tests/00-setup:37: virtualenv --distribute
--extra-search-dir=$DOWNLOADCACHE $VENV
On 2013/11/22 17:33:22, benji wrote:
> This makes virtualenv install pip from the download cache.

Very nice!

https://codereview.appspot.com/31000043/

Revision history for this message
Benji York (benji) wrote :

*** Submitted:

Include pip dependency instead of using system's

I also killed an entire village of ./

R=frankban
CC=
https://codereview.appspot.com/31000043

https://codereview.appspot.com/31000043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2013-11-19 02:50:54 +0000
3+++ Makefile 2013-11-22 17:20:57 +0000
4@@ -15,9 +15,9 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6
7 JUJUTEST = juju-test --timeout=120m -v -e "$(JUJU_ENV)"
8-VENV = ./tests/.venv
9-SYSDEPS = build-essential bzr libapt-pkg-dev libpython-dev python-pip \
10- python-virtualenv rsync xvfb
11+VENV = tests/.venv
12+SYSDEPS = build-essential bzr libapt-pkg-dev libpython-dev python-virtualenv \
13+ rsync xvfb
14
15
16 all: setup
17@@ -26,14 +26,16 @@
18 # support the juju-test plugin, which calls the executable files in
19 # alphabetical order.
20 setup:
21- @./tests/00-setup
22+ tests/00-setup
23+ # Ensure the correct version of pip has been installed
24+ tests/.venv/bin/pip --version | grep "pip 1.4" || exit 1
25
26 sysdeps:
27 sudo apt-get install --yes $(SYSDEPS)
28
29 unittest: setup
30- ./tests/10-unit.test
31- ./tests/11-server.test
32+ tests/10-unit.test
33+ tests/11-server.test
34
35 ensure-juju-env:
36 ifndef JUJU_ENV
37@@ -57,7 +59,7 @@
38
39 lint: setup
40 @$(VENV)/bin/flake8 --show-source --exclude=.venv \
41- ./hooks/ ./tests/ ./server/
42+ hooks/ tests/ server/
43
44 clean:
45 find . -name '*.pyc' -delete
46@@ -65,7 +67,7 @@
47 rm -rf tests/download-cache
48
49 deploy: setup
50- $(VENV)/bin/python ./tests/deploy.py
51+ $(VENV)/bin/python tests/deploy.py
52
53 help:
54 @echo -e 'Juju GUI charm - list of make targets:\n'
55
56=== modified file 'tests/00-setup'
57--- tests/00-setup 2013-11-19 14:25:24 +0000
58+++ tests/00-setup 2013-11-22 17:20:57 +0000
59@@ -34,7 +34,7 @@
60 fi
61 if [ ! -f "$ACTIVATE" -o "$TEST_REQUIREMENTS" -nt "$ACTIVATE" -o "$SERVER_REQUIREMENTS" -nt "$ACTIVATE" ]; then
62 [ $updated_downloadcache -eq 0 ] && bzr up $DOWNLOADCACHE
63- virtualenv --distribute $VENV
64+ virtualenv --distribute --extra-search-dir=$DOWNLOADCACHE $VENV
65 . $ACTIVATE && \
66 yes w | env BZR_PLUGIN_PATH='-user' \
67 pip install -r $TEST_REQUIREMENTS --find-links deps --find-links $DOWNLOADCACHE --no-allow-external --no-index

Subscribers

People subscribed via source and target branches

to all changes: