Merge lp:~mikemc/ubuntuone-windows-installer/improve-buildout into lp:ubuntuone-windows-installer

Proposed by Mike McCracken on 2012-08-10
Status: Merged
Approved by: dobey on 2012-08-17
Approved revision: 137
Merged at revision: 132
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/improve-buildout
Merge into: lp:ubuntuone-windows-installer
Diff against target: 251 lines (+93/-71)
3 files modified
scripts/devsetup/buildout.cfg (+89/-15)
scripts/devsetup/env-mac (+4/-18)
scripts/devsetup/env.bat (+0/-38)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/improve-buildout
Reviewer Review Type Date Requested Status
dobey (community) Approve on 2012-08-17
Roberto Alsina (community) 2012-08-10 Approve on 2012-08-13
Review via email: mp+119195@code.launchpad.net

Commit message

- Generate all necessary scripts in buildout bin/ directory, and other improvements.

Description of the change

- Generate all necessary scripts in buildout bin/ directory, and other improvements:

- Use recipe that builds more capable python interpreter wrapper (accepts all cmdline args)

- Remove unused eggs

- change env.bat to not bother copying in scripts from eggs, because buildout does that now

- change env-mac to just set PATH and not go searching for scripts.

- Install dirspec and dev-tools as source and include them in default paths.

NOTE: we could take the same approach with the other branches, but since people may be grabbing different branches into different directories (ie, for testing) it seemed wise not to bake the path to e.g. parts/ubuntu-sso-client into the buildout scripts. Doing this for dirspec and dev-tools will make that a bit of a pain (need to use colo branches or move directories around) but they don't change that often, so hopefully it's OK.

To post a comment you must log in.
Roberto Alsina (ralsina) :
review: Approve
137. By Mike McCracken on 2012-08-15

set pep8 version to 1.2 to match Quantal

dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/devsetup/buildout.cfg'
2--- scripts/devsetup/buildout.cfg 2012-05-30 17:47:08 +0000
3+++ scripts/devsetup/buildout.cfg 2012-08-15 19:37:29 +0000
4@@ -1,7 +1,27 @@
5+# The first time you run buildout, run 'bin/buildout install'.
6+
7+# This will include the sourcedeps part that does a bzr branch for
8+# dirspec and ubuntuone-dev-tools. Because it does 'branch', if you
9+# re-install sourcedeps when those branches are still there, you'll
10+# get an error.
11+
12+# So if you need to run it again to re-generate something else, avoid
13+# sourcedeps by passing the part of interest on the command line, like
14+# 'bin/buildout install development'
15+
16+# NOTE: this config is a little extra complicated to ensure we get
17+# u1lint and u1trial scripts installed despite dev-tools not using
18+# setuptools, which is what the zc.recipe.egg or z3c.recipe.scripts
19+# recipes expect.
20+
21 [buildout]
22 parts =
23+ pylint
24+ pyflakes
25+ u1lint
26+ u1trial
27+ sourcedeps
28 development
29- windows
30
31 find-links =
32 https://github.com/ghtdak/qtreactor/tarball/master#egg=qt4reactor
33@@ -18,15 +38,13 @@
34 # http://sourceforge.net/tracker/index.php?func=detail&aid=3036368&group_id=115265&atid=692940
35 http://u1.to/ralsina/w/comtypes-0.6.2.zip#egg=comtypes
36 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue
37- http://launchpad.net/ubuntuone-dev-tools/stable-3-0/3.0.0/+download/ubuntuone-dev-tools-3.0.0.tar.gz#egg=ubuntuone-dev-tools
38- http://launchpad.net/dirspec/stable-3-0/3.0.0/+download/dirspec-3.0.0.tar.gz#egg=dirspec
39 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted
40 unzip = true
41 newest = false
42 versions = versions
43
44 [windows]
45-recipe = zc.recipe.egg:scripts
46+recipe = zc.recipe.egg
47 versions = versions
48 eggs =
49 py2exe
50@@ -35,15 +53,16 @@
51 ${development:eggs}
52 interpreter = python
53
54+# z3c.recipe.scripts generates a python interpreter that handles the
55+# same python command line options as the real interpreter
56 [development]
57-recipe = zc.recipe.egg:scripts
58+recipe = z3c.recipe.scripts
59 eggs =
60 twisted
61 qt4reactor
62 python-distutils-extra
63 keyring
64 pycrypto
65- lazr.restfulclient
66 pyOpenSSL
67 pil
68 httplib2
69@@ -53,15 +72,67 @@
70 logilab-common
71 mocker
72 coverage
73- pylint
74- pyflakes
75 pep8
76- ubuntuone-dev-tools
77- dirspec
78 oauth
79 simplejson
80+ pylint
81+ pyflakes
82 versions = versions
83 interpreter = python
84+# Use extra-paths so generated python interpreter can see the source
85+# version of dev-tools and dirspec. We have to do this instead of
86+# using the buildout 'develop' option that creates develop eggs
87+# because that attempts to run ubuntuone-dev-tools setup, which fails
88+# because it can't import dirspec yet.
89+extra-paths =
90+ ${buildout:parts-directory}/ubuntuone-dev-tools
91+ ${buildout:parts-directory}/dirspec
92+
93+# Install various scripts. These are all separate sections because the
94+# initialization and arguments values apply to every entry point you
95+# declare in a section, and these four are incompatible. Only pyflakes
96+# requires no tweaking.
97+
98+[pyflakes]
99+recipe = zc.recipe.egg
100+eggs = ${development:eggs}
101+versions = versions
102+entry-points =
103+ pyflakes=pyflakes.scripts.pyflakes:main
104+
105+[pylint]
106+recipe = zc.recipe.egg
107+eggs = ${development:eggs}
108+versions = versions
109+arguments = sys.argv[1:]
110+entry-points = pylint=pylint.lint:Run
111+
112+[u1lint]
113+recipe = zc.recipe.egg:scripts
114+eggs = ${development:eggs}
115+versions = versions
116+extra-paths = ${development:extra-paths}
117+entry-points = u1lint=u1lintscript:main
118+# The following is necessary because u1lint defines main() in the
119+# runnable script, so the entry-point generated script needs to import
120+# it
121+initialization =
122+ import imp
123+ scriptname = "${buildout:parts-directory}/ubuntuone-dev-tools/bin/u1lint"
124+ imp.load_source("u1lintscript", scriptname)
125+
126+[u1trial]
127+recipe = zc.recipe.egg:scripts
128+eggs = ${development:eggs}
129+versions = versions
130+extra-paths = ${development:extra-paths}
131+entry-points =
132+ u1trial=ubuntuone.devtools.runners:main
133+# The code at top-level in u1trial is simpler than u1lint, so we just
134+# copy it here:
135+initialization =
136+ import os
137+ sys.path.insert(0, os.path.abspath("."))
138
139 [versions]
140 twisted = 11.1.0
141@@ -69,7 +140,6 @@
142 python-distutils-extra = 2.31
143 keyring = 0.7
144 pycrypto = 2.4.1
145-lazr.restfulclient = 0.12.0
146 pyOpenSSL = 0.13
147 pil = 1.1.7
148 httplib2 = 0.7.2
149@@ -81,9 +151,7 @@
150 coverage = 3.5.1
151 pylint = 0.25.1
152 pyflakes = 0.5.0
153-pep8 = 1.1
154-ubuntuone-dev-tools = 3.0.0
155-dirspec = 3.0.0
156+pep8 = 1.2
157 oauth = 1.0.1
158 py2exe = 0.6.9
159 comtypes = 0.6.2
160@@ -93,6 +161,12 @@
161 urls =
162 lp:ubuntuone-client ubuntuone-client
163 lp:ubuntu-sso-client ubuntu-sso-client
164- lp:ubuntuone-storage-protocol ubuntuone-storage-protocol
165 lp:ubuntuone-control-panel ubuntuone-control-panel
166 lp:ubuntuone-windows-installer ubuntuone-windows-installer
167+
168+[sourcedeps]
169+recipe = bazaarrecipeinfrae
170+urls =
171+ lp:ubuntuone-dev-tools ubuntuone-dev-tools
172+ lp:dirspec dirspec
173+ lp:ubuntuone-storage-protocol ubuntuone-storage-protocol
174\ No newline at end of file
175
176=== modified file 'scripts/devsetup/env-mac'
177--- scripts/devsetup/env-mac 2012-04-27 15:51:42 +0000
178+++ scripts/devsetup/env-mac 2012-08-15 19:37:29 +0000
179@@ -1,20 +1,6 @@
180 #!/bin/bash
181
182-CURRENT_DIR=`pwd`
183-echo "Adding buildout bin path to the system path"
184-PATH=`pwd`/bin:$PATH
185-
186-echo "Adding u1trial to env-vars"
187-export u1trial="`find $CURRENT_DIR -type f -name u1trial`"
188-
189-echo "Adding u1lint to env-vars"
190-export u1lint="`find $CURRENT_DIR -type f -name u1lint`"
191-
192-if [ ! -f `pwd`/bin/pylint ]; then
193- echo "Adding pylint script to the bin folder"
194- PYLINT_PATH="`find $CURRENT_DIR -type f -name pylint`"
195- PYLINT_SCRIPT="$CURRENT_DIR/bin/pylint"
196- echo "#!/usr/bin/env sh" > $PYLINT_SCRIPT
197- echo "python $PYLINT_PATH "'$@' >> $PYLINT_SCRIPT
198- chmod +x $PYLINT_SCRIPT
199-fi
200+export PATH=$PWD/bin:$PATH
201+echo "Prepended pwd/bin to path. Contents:"
202+ls -l bin
203+
204
205=== modified file 'scripts/devsetup/env.bat'
206--- scripts/devsetup/env.bat 2012-06-21 16:55:22 +0000
207+++ scripts/devsetup/env.bat 2012-08-15 19:37:29 +0000
208@@ -14,44 +14,6 @@
209 :: This will use the Python on the Path that we got from Buildout
210 python.exe get_protoc.py
211
212-
213-FOR /F "tokens=*" %%A IN ('python -c "import sys;print [dir for dir in sys.path if \"ubuntuone-dev-tools\" in dir][0]"') DO SET DEVTOOLS=%%A
214-FOR /F "tokens=*" %%A IN ('python -c "import sys;print [dir for dir in sys.path if \"pylint\" in dir][0]"') DO SET PYLINT=%%A
215-FOR /F "tokens=*" %%A IN ('python -c "import sys;print [dir for dir in sys.path if \"pyflakes\" in dir][0]"') DO SET PYFLAKES=%%A
216-
217-IF EXIST "%~dp0bin\u1trial" GOTO TRIALALREADY
218-echo Copying u1trial to bin
219-copy %DEVTOOLS%\bin\u1trial bin
220-copy %DEVTOOLS%\bin\u1trial.bat bin
221-:TRIALALREADY
222-
223-IF EXIST "%~dp0bin\u1lint" GOTO LINTALREADY
224-echo Copying u1lint to bin
225-copy %DEVTOOLS%\bin\u1lint bin
226-copy %DEVTOOLS%\bin\u1lint.bat bin
227-:LINTALREADY
228-
229-IF EXIST "%~dp0bin\pylint" GOTO PYLINTALREADY
230-echo Copying pylint to bin
231-copy %PYLINT%\EGG-INFO\scripts\pylint bin
232-copy %PYLINT%\\EGG-INFO\scripts\pylint.bat bin
233-:PYLINTALREADY
234-
235-IF EXIST "%~dp0bin\pyflakes" GOTO PYFLAKESALREADY
236-echo Copying pyflakes to bin
237-copy %PYFLAKES%\pyflakes\scripts\pyflakes.py bin\pyflakes
238-:PYFLAKESALREADY
239-
240-:: Running ubuntuone-control-panel tests requires -protocol to be built
241-IF EXIST "%~dp0parts\ubuntuone-storage-protocol\build" GOTO PROTOCOLBUILT
242-echo Building ubuntuone-storage-protocol
243-cd parts\ubuntuone-storage-protocol
244-python.exe setup.py install
245-cd %~dp0
246-:PROTOCOLBUILT
247-
248-
249-
250 :: Run all tests
251 IF NOT "%1" == "testall" GOTO END
252

Subscribers

People subscribed via source and target branches