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

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
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
Roberto Alsina (community) Approve
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.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
137. By Mike McCracken

set pep8 version to 1.2 to match Quantal

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/devsetup/buildout.cfg'
--- scripts/devsetup/buildout.cfg 2012-05-30 17:47:08 +0000
+++ scripts/devsetup/buildout.cfg 2012-08-15 19:37:29 +0000
@@ -1,7 +1,27 @@
1# The first time you run buildout, run 'bin/buildout install'.
2
3# This will include the sourcedeps part that does a bzr branch for
4# dirspec and ubuntuone-dev-tools. Because it does 'branch', if you
5# re-install sourcedeps when those branches are still there, you'll
6# get an error.
7
8# So if you need to run it again to re-generate something else, avoid
9# sourcedeps by passing the part of interest on the command line, like
10# 'bin/buildout install development'
11
12# NOTE: this config is a little extra complicated to ensure we get
13# u1lint and u1trial scripts installed despite dev-tools not using
14# setuptools, which is what the zc.recipe.egg or z3c.recipe.scripts
15# recipes expect.
16
1[buildout]17[buildout]
2parts =18parts =
19 pylint
20 pyflakes
21 u1lint
22 u1trial
23 sourcedeps
3 development24 development
4 windows
525
6find-links =26find-links =
7 https://github.com/ghtdak/qtreactor/tarball/master#egg=qt4reactor27 https://github.com/ghtdak/qtreactor/tarball/master#egg=qt4reactor
@@ -18,15 +38,13 @@
18# http://sourceforge.net/tracker/index.php?func=detail&aid=3036368&group_id=115265&atid=69294038# http://sourceforge.net/tracker/index.php?func=detail&aid=3036368&group_id=115265&atid=692940
19 http://u1.to/ralsina/w/comtypes-0.6.2.zip#egg=comtypes39 http://u1.to/ralsina/w/comtypes-0.6.2.zip#egg=comtypes
20 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue40 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue
21 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
22 http://launchpad.net/dirspec/stable-3-0/3.0.0/+download/dirspec-3.0.0.tar.gz#egg=dirspec
23 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted41 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted
24unzip = true42unzip = true
25newest = false43newest = false
26versions = versions44versions = versions
2745
28[windows]46[windows]
29recipe = zc.recipe.egg:scripts47recipe = zc.recipe.egg
30versions = versions48versions = versions
31eggs =49eggs =
32 py2exe50 py2exe
@@ -35,15 +53,16 @@
35 ${development:eggs}53 ${development:eggs}
36interpreter = python54interpreter = python
3755
56# z3c.recipe.scripts generates a python interpreter that handles the
57# same python command line options as the real interpreter
38[development]58[development]
39recipe = zc.recipe.egg:scripts59recipe = z3c.recipe.scripts
40eggs =60eggs =
41 twisted61 twisted
42 qt4reactor62 qt4reactor
43 python-distutils-extra63 python-distutils-extra
44 keyring64 keyring
45 pycrypto65 pycrypto
46 lazr.restfulclient
47 pyOpenSSL66 pyOpenSSL
48 pil67 pil
49 httplib268 httplib2
@@ -53,15 +72,67 @@
53 logilab-common72 logilab-common
54 mocker73 mocker
55 coverage74 coverage
56 pylint
57 pyflakes
58 pep875 pep8
59 ubuntuone-dev-tools
60 dirspec
61 oauth76 oauth
62 simplejson77 simplejson
78 pylint
79 pyflakes
63versions = versions80versions = versions
64interpreter = python81interpreter = python
82# Use extra-paths so generated python interpreter can see the source
83# version of dev-tools and dirspec. We have to do this instead of
84# using the buildout 'develop' option that creates develop eggs
85# because that attempts to run ubuntuone-dev-tools setup, which fails
86# because it can't import dirspec yet.
87extra-paths =
88 ${buildout:parts-directory}/ubuntuone-dev-tools
89 ${buildout:parts-directory}/dirspec
90
91# Install various scripts. These are all separate sections because the
92# initialization and arguments values apply to every entry point you
93# declare in a section, and these four are incompatible. Only pyflakes
94# requires no tweaking.
95
96[pyflakes]
97recipe = zc.recipe.egg
98eggs = ${development:eggs}
99versions = versions
100entry-points =
101 pyflakes=pyflakes.scripts.pyflakes:main
102
103[pylint]
104recipe = zc.recipe.egg
105eggs = ${development:eggs}
106versions = versions
107arguments = sys.argv[1:]
108entry-points = pylint=pylint.lint:Run
109
110[u1lint]
111recipe = zc.recipe.egg:scripts
112eggs = ${development:eggs}
113versions = versions
114extra-paths = ${development:extra-paths}
115entry-points = u1lint=u1lintscript:main
116# The following is necessary because u1lint defines main() in the
117# runnable script, so the entry-point generated script needs to import
118# it
119initialization =
120 import imp
121 scriptname = "${buildout:parts-directory}/ubuntuone-dev-tools/bin/u1lint"
122 imp.load_source("u1lintscript", scriptname)
123
124[u1trial]
125recipe = zc.recipe.egg:scripts
126eggs = ${development:eggs}
127versions = versions
128extra-paths = ${development:extra-paths}
129entry-points =
130 u1trial=ubuntuone.devtools.runners:main
131# The code at top-level in u1trial is simpler than u1lint, so we just
132# copy it here:
133initialization =
134 import os
135 sys.path.insert(0, os.path.abspath("."))
65136
66[versions]137[versions]
67twisted = 11.1.0138twisted = 11.1.0
@@ -69,7 +140,6 @@
69python-distutils-extra = 2.31140python-distutils-extra = 2.31
70keyring = 0.7141keyring = 0.7
71pycrypto = 2.4.1142pycrypto = 2.4.1
72lazr.restfulclient = 0.12.0
73pyOpenSSL = 0.13143pyOpenSSL = 0.13
74pil = 1.1.7144pil = 1.1.7
75httplib2 = 0.7.2145httplib2 = 0.7.2
@@ -81,9 +151,7 @@
81coverage = 3.5.1151coverage = 3.5.1
82pylint = 0.25.1152pylint = 0.25.1
83pyflakes = 0.5.0153pyflakes = 0.5.0
84pep8 = 1.1154pep8 = 1.2
85ubuntuone-dev-tools = 3.0.0
86dirspec = 3.0.0
87oauth = 1.0.1155oauth = 1.0.1
88py2exe = 0.6.9156py2exe = 0.6.9
89comtypes = 0.6.2157comtypes = 0.6.2
@@ -93,6 +161,12 @@
93urls = 161urls =
94 lp:ubuntuone-client ubuntuone-client162 lp:ubuntuone-client ubuntuone-client
95 lp:ubuntu-sso-client ubuntu-sso-client163 lp:ubuntu-sso-client ubuntu-sso-client
96 lp:ubuntuone-storage-protocol ubuntuone-storage-protocol
97 lp:ubuntuone-control-panel ubuntuone-control-panel164 lp:ubuntuone-control-panel ubuntuone-control-panel
98 lp:ubuntuone-windows-installer ubuntuone-windows-installer165 lp:ubuntuone-windows-installer ubuntuone-windows-installer
166
167[sourcedeps]
168recipe = bazaarrecipeinfrae
169urls =
170 lp:ubuntuone-dev-tools ubuntuone-dev-tools
171 lp:dirspec dirspec
172 lp:ubuntuone-storage-protocol ubuntuone-storage-protocol
99\ No newline at end of file173\ No newline at end of file
100174
=== modified file 'scripts/devsetup/env-mac'
--- scripts/devsetup/env-mac 2012-04-27 15:51:42 +0000
+++ scripts/devsetup/env-mac 2012-08-15 19:37:29 +0000
@@ -1,20 +1,6 @@
1#!/bin/bash1#!/bin/bash
22
3CURRENT_DIR=`pwd`3export PATH=$PWD/bin:$PATH
4echo "Adding buildout bin path to the system path"4echo "Prepended pwd/bin to path. Contents:"
5PATH=`pwd`/bin:$PATH5ls -l bin
66
7echo "Adding u1trial to env-vars"
8export u1trial="`find $CURRENT_DIR -type f -name u1trial`"
9
10echo "Adding u1lint to env-vars"
11export u1lint="`find $CURRENT_DIR -type f -name u1lint`"
12
13if [ ! -f `pwd`/bin/pylint ]; then
14 echo "Adding pylint script to the bin folder"
15 PYLINT_PATH="`find $CURRENT_DIR -type f -name pylint`"
16 PYLINT_SCRIPT="$CURRENT_DIR/bin/pylint"
17 echo "#!/usr/bin/env sh" > $PYLINT_SCRIPT
18 echo "python $PYLINT_PATH "'$@' >> $PYLINT_SCRIPT
19 chmod +x $PYLINT_SCRIPT
20fi
217
=== modified file 'scripts/devsetup/env.bat'
--- scripts/devsetup/env.bat 2012-06-21 16:55:22 +0000
+++ scripts/devsetup/env.bat 2012-08-15 19:37:29 +0000
@@ -14,44 +14,6 @@
14:: This will use the Python on the Path that we got from Buildout14:: This will use the Python on the Path that we got from Buildout
15python.exe get_protoc.py15python.exe get_protoc.py
1616
17
18FOR /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
19FOR /F "tokens=*" %%A IN ('python -c "import sys;print [dir for dir in sys.path if \"pylint\" in dir][0]"') DO SET PYLINT=%%A
20FOR /F "tokens=*" %%A IN ('python -c "import sys;print [dir for dir in sys.path if \"pyflakes\" in dir][0]"') DO SET PYFLAKES=%%A
21
22IF EXIST "%~dp0bin\u1trial" GOTO TRIALALREADY
23echo Copying u1trial to bin
24copy %DEVTOOLS%\bin\u1trial bin
25copy %DEVTOOLS%\bin\u1trial.bat bin
26:TRIALALREADY
27
28IF EXIST "%~dp0bin\u1lint" GOTO LINTALREADY
29echo Copying u1lint to bin
30copy %DEVTOOLS%\bin\u1lint bin
31copy %DEVTOOLS%\bin\u1lint.bat bin
32:LINTALREADY
33
34IF EXIST "%~dp0bin\pylint" GOTO PYLINTALREADY
35echo Copying pylint to bin
36copy %PYLINT%\EGG-INFO\scripts\pylint bin
37copy %PYLINT%\\EGG-INFO\scripts\pylint.bat bin
38:PYLINTALREADY
39
40IF EXIST "%~dp0bin\pyflakes" GOTO PYFLAKESALREADY
41echo Copying pyflakes to bin
42copy %PYFLAKES%\pyflakes\scripts\pyflakes.py bin\pyflakes
43:PYFLAKESALREADY
44
45:: Running ubuntuone-control-panel tests requires -protocol to be built
46IF EXIST "%~dp0parts\ubuntuone-storage-protocol\build" GOTO PROTOCOLBUILT
47echo Building ubuntuone-storage-protocol
48cd parts\ubuntuone-storage-protocol
49python.exe setup.py install
50cd %~dp0
51:PROTOCOLBUILT
52
53
54
55:: Run all tests17:: Run all tests
56IF NOT "%1" == "testall" GOTO END18IF NOT "%1" == "testall" GOTO END
5719

Subscribers

People subscribed via source and target branches