Merge lp:~frankban/juju-quickstart/improve-venv into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 14
Proposed branch: lp:~frankban/juju-quickstart/improve-venv
Merge into: lp:juju-quickstart
Diff against target: 165 lines (+75/-11)
7 files modified
HACKING.rst (+16/-0)
MANIFEST.in (+24/-0)
Makefile (+3/-2)
quickstart/settings.py (+1/-1)
requirements.pip (+25/-0)
setup.py (+5/-6)
test-requirements.pip (+1/-2)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/improve-venv
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+195200@code.launchpad.net

Description of the change

Update the quickstart test venv set up process.

Remove the activate file if the requirements
installation process fails.

Also updated the default GUI charm URL, and
the documentation.

https://codereview.appspot.com/26540043/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :
Download full text (7.3 KiB)

Reviewers: mp+195200_code.launchpad.net,

Message:
Please take a look.

Description:
Update the quickstart test venv set up process.

Remove the activate file if the requirements
installation process fails.

Also updated the default GUI charm URL, and
the documentation.

https://code.launchpad.net/~frankban/juju-quickstart/improve-venv/+merge/195200

(do not edit description out of merge proposal)

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

Affected files (+76, -11 lines):
   M HACKING.rst
   A MANIFEST.in
   M Makefile
   A [revision details]
   M quickstart/settings.py
   A requirements.pip
   M setup.py
   M test-requirements.pip

Index: HACKING.rst
=== modified file 'HACKING.rst'
--- HACKING.rst 2013-11-12 15:34:15 +0000
+++ HACKING.rst 2013-11-14 10:50:46 +0000
@@ -83,3 +83,18 @@
  Packages depend on `python-jujuclient` and `python-websocket-client` to be
  available. They are available in saucy, and they are also stored in our
PPA in
  order to support previous Ubuntu releases.
+
+Updating application and test dependencies
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Test dependencies are listed in the ``test-requirements.pip`` file in the
+branch root, application ones in the ``requirements.pip`` file. The former
+includes the latter, so any updates to the application requirements will
also
+update the test dependencies and therefore the testing virtual environment.
+Note that, since the source requirements are dynamically generated parsing
+``requirements.pip``, that file must only include PACKAGE==VERSION
formatted
+dependencies, and not other pip specific requirement specifications.
+Also ensure, before updating the application dependencies, that those
packages
+are available in the main Ubuntu repositories for the series we support
(from
+precise to saucy), or in the Juju Quickstart Beta PPA: see
+<https://launchpad.net/~juju-gui/+archive/quickstart-beta/+packages>.

Index: MANIFEST.in
=== added file 'MANIFEST.in'
--- MANIFEST.in 1970-01-01 00:00:00 +0000
+++ MANIFEST.in 2013-11-14 10:37:29 +0000
@@ -0,0 +1,24 @@
+# This file is part of the Juju Quickstart Plugin, which lets users set up
a
+# Juju environment in very few steps
(https://launchpad.net/juju-quickstart).
+# Copyright (C) 2012-2013 Canonical Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
under
+# the terms of the GNU Affero General Public License version 3, as
published by
+# the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
WITHOUT
+# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
+# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+include COPYING
+include HACKING.rst
+include MANIFEST.in
+include README.rst
+# Note: since the source requirements are dynamically generated parsing the
+# requirements.pip file, removing it from this list will break the source
+# distribution and therefore t...

Read more...

Revision history for this message
Gary Poster (gary) wrote :

Nice. LGTM with trivial comments.

https://codereview.appspot.com/26540043/diff/1/HACKING.rst
File HACKING.rst (right):

https://codereview.appspot.com/26540043/diff/1/HACKING.rst#newcode97
HACKING.rst:97: Also ensure, before updating the application
dependencies, that those packages
I suggest that you make this a second paragraph, since it is a separate
topic.

https://codereview.appspot.com/26540043/diff/1/MANIFEST.in
File MANIFEST.in (right):

https://codereview.appspot.com/26540043/diff/1/MANIFEST.in#newcode23
MANIFEST.in:23: # distribution and therefore the Debian package builds.
Do not do that.
Thank you for this comment!

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

https://codereview.appspot.com/26540043/diff/1/Makefile#newcode27
Makefile:27: (rm -f $(VENV_ACTIVATE); exit 1)
same comment as with gui charm: instead of rm'ing, let's touch
test-requirements.pip.

https://codereview.appspot.com/26540043/

18. By Francesco Banconi

Changes as per review.

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

*** Submitted:

Update the quickstart test venv set up process.

Remove the activate file if the requirements
installation process fails.

Also updated the default GUI charm URL, and
the documentation.

R=gary.poster
CC=
https://codereview.appspot.com/26540043

https://codereview.appspot.com/26540043/diff/1/HACKING.rst
File HACKING.rst (right):

https://codereview.appspot.com/26540043/diff/1/HACKING.rst#newcode97
HACKING.rst:97: Also ensure, before updating the application
dependencies, that those packages
On 2013/11/14 12:04:01, gary.poster wrote:
> I suggest that you make this a second paragraph, since it is a
separate topic.

Done.

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

https://codereview.appspot.com/26540043/diff/1/Makefile#newcode27
Makefile:27: (rm -f $(VENV_ACTIVATE); exit 1)
On 2013/11/14 12:04:01, gary.poster wrote:
> same comment as with gui charm: instead of rm'ing, let's touch
> test-requirements.pip.

Done.

https://codereview.appspot.com/26540043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING.rst'
2--- HACKING.rst 2013-11-12 15:34:15 +0000
3+++ HACKING.rst 2013-11-14 12:21:11 +0000
4@@ -83,3 +83,19 @@
5 Packages depend on `python-jujuclient` and `python-websocket-client` to be
6 available. They are available in saucy, and they are also stored in our PPA in
7 order to support previous Ubuntu releases.
8+
9+Updating application and test dependencies
10+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
12+Test dependencies are listed in the ``test-requirements.pip`` file in the
13+branch root, application ones in the ``requirements.pip`` file. The former
14+includes the latter, so any updates to the application requirements will also
15+update the test dependencies and therefore the testing virtual environment.
16+Note that, since the source requirements are dynamically generated parsing
17+``requirements.pip``, that file must only include PACKAGE==VERSION formatted
18+dependencies, and not other pip specific requirement specifications.
19+
20+Also ensure, before updating the application dependencies, that those packages
21+are available in the main Ubuntu repositories for the series we support (from
22+precise to saucy), or in the Juju Quickstart Beta PPA: see
23+<https://launchpad.net/~juju-gui/+archive/quickstart-beta/+packages>.
24
25=== added file 'MANIFEST.in'
26--- MANIFEST.in 1970-01-01 00:00:00 +0000
27+++ MANIFEST.in 2013-11-14 12:21:11 +0000
28@@ -0,0 +1,24 @@
29+# This file is part of the Juju Quickstart Plugin, which lets users set up a
30+# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
31+# Copyright (C) 2012-2013 Canonical Ltd.
32+#
33+# This program is free software: you can redistribute it and/or modify it under
34+# the terms of the GNU Affero General Public License version 3, as published by
35+# the Free Software Foundation.
36+#
37+# This program is distributed in the hope that it will be useful, but WITHOUT
38+# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
39+# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
40+# Affero General Public License for more details.
41+#
42+# You should have received a copy of the GNU Affero General Public License
43+# along with this program. If not, see <http://www.gnu.org/licenses/>.
44+
45+include COPYING
46+include HACKING.rst
47+include MANIFEST.in
48+include README.rst
49+# Note: since the source requirements are dynamically generated parsing the
50+# requirements.pip file, removing it from this list will break the source
51+# distribution and therefore the Debian package builds. Do not do that.
52+include requirements.pip
53
54=== modified file 'Makefile'
55--- Makefile 2013-10-30 10:16:36 +0000
56+++ Makefile 2013-11-14 12:21:11 +0000
57@@ -21,9 +21,10 @@
58 VENV_ACTIVATE = $(VENV)/bin/activate
59
60
61-$(VENV_ACTIVATE): test-requirements.pip
62+$(VENV_ACTIVATE): test-requirements.pip requirements.pip
63 virtualenv --distribute -p $(PYTHON) $(VENV)
64- $(VENV)/bin/pip install --use-mirrors -r test-requirements.pip
65+ $(VENV)/bin/pip install --use-mirrors -r test-requirements.pip || \
66+ (touch test-requirements.pip; exit 1)
67 @touch $(VENV_ACTIVATE)
68
69 all: setup
70
71=== modified file 'quickstart/settings.py'
72--- quickstart/settings.py 2013-11-13 12:23:36 +0000
73+++ quickstart/settings.py 2013-11-14 12:21:11 +0000
74@@ -24,7 +24,7 @@
75
76 # The default Juju GUI charm URL to use when it is not possible to retrieve it
77 # from the charmworld API, e.g. due to temporary connection/charmworld errors.
78-DEFAULT_CHARM_URL = 'cs:precise/juju-gui-79'
79+DEFAULT_CHARM_URL = 'cs:precise/juju-gui-80'
80
81 # The quickstart app short description.
82 DESCRIPTION = 'set up a Juju environment (including the GUI) in very few steps'
83
84=== added file 'requirements.pip'
85--- requirements.pip 1970-01-01 00:00:00 +0000
86+++ requirements.pip 2013-11-14 12:21:11 +0000
87@@ -0,0 +1,25 @@
88+# Juju Quickstart application requirements.
89+
90+# This file is part of the Juju Quickstart Plugin, which lets users set up a
91+# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
92+# Copyright (C) 2013 Canonical Ltd.
93+#
94+# This program is free software: you can redistribute it and/or modify it under
95+# the terms of the GNU Affero General Public License version 3, as published by
96+# the Free Software Foundation.
97+#
98+# This program is distributed in the hope that it will be useful, but WITHOUT
99+# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
100+# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
101+# Affero General Public License for more details.
102+#
103+# You should have received a copy of the GNU Affero General Public License
104+# along with this program. If not, see <http://www.gnu.org/licenses/>.
105+
106+# Note: since the source requirements are dynamically generated parsing the
107+# requirements.pip file, the list below must only include PACKAGE==VERSION
108+# formatted dependencies. Do not include other pip specific requirement
109+# specifications (e.g. -e ... or -r ...).
110+
111+jujuclient==0.11
112+PyYAML==3.10
113
114=== modified file 'setup.py'
115--- setup.py 2013-11-06 15:21:19 +0000
116+++ setup.py 2013-11-14 12:21:11 +0000
117@@ -26,14 +26,14 @@
118
119 ROOT = os.path.abspath(os.path.dirname(__file__))
120 PROJECT_NAME = 'quickstart'
121-REQUIREMENTS = (
122- 'jujuclient==0.11',
123- 'PyYAML==3.10',
124-)
125
126 project = __import__(PROJECT_NAME)
127 description_path = os.path.join(ROOT, 'README.rst')
128
129+requirements_path = os.path.join(ROOT, 'requirements.pip')
130+requirements = [i.strip() for i in open(requirements_path).readlines()]
131+install_requires = [i for i in requirements if i and not i.startswith('#')]
132+
133 os.chdir(ROOT)
134
135 data_files = []
136@@ -49,7 +49,6 @@
137 dirpath[len(PROJECT_NAME) + 1:], f))
138
139
140-os.chdir(ROOT)
141 setup(
142 name='juju-quickstart',
143 version=project.get_version(),
144@@ -62,7 +61,7 @@
145 packages=find_packages(),
146 package_data={PROJECT_NAME: data_files},
147 scripts=['juju-quickstart'],
148- install_requires=REQUIREMENTS,
149+ install_requires=install_requires,
150 zip_safe=False,
151 classifiers=[
152 'Development Status :: 3 - Alpha',
153
154=== modified file 'test-requirements.pip'
155--- test-requirements.pip 2013-10-30 10:16:36 +0000
156+++ test-requirements.pip 2013-11-14 12:21:11 +0000
157@@ -18,7 +18,6 @@
158
159 coverage==3.7
160 flake8==2.0
161-jujuclient==0.11
162 mock==1.0.1
163 nose==1.3.0
164-PyYAML==3.10
165+-r requirements.pip

Subscribers

People subscribed via source and target branches