← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~flacoste/maas/buildout-site-packages into lp:maas

 

Francis J. Lacoste has proposed merging lp:~flacoste/maas/buildout-site-packages into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~flacoste/maas/buildout-site-packages/+merge/94628

This branch adds explicit versioning the the MaaS dependencies.

It adds buildout-versions which makes it easy to manage the versions.cfg
file.

All runtime dependencies are loaded from site packages (well, if they are
available, apart Django, there is not much harm done if you didn't install
the package, as it will still pull it from PyPI).

I turned off allow-picked-versions which will make buildout complain if any
new dependencies are introduced without adding the correct entry to
versions.cfg This should make us more mindful of introducing dep and make us
pause to see if this is a runtime dep (should be packaged and loaded from
site-packages) or a dev-only dep.

I also updated setup.py with the dependencies.

-- 
https://code.launchpad.net/~flacoste/maas/buildout-site-packages/+merge/94628
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~flacoste/maas/buildout-site-packages into lp:maas.
=== modified file 'HACKING.txt'
--- HACKING.txt	2012-02-24 11:16:36 +0000
+++ HACKING.txt	2012-02-24 22:17:17 +0000
@@ -23,20 +23,32 @@
 
 Prerequisites
 =============
-You will need to manually install Postgres 9.1 (postgresql-9.1 and
-libpq-dev), RabbitMQ (rabbitmq-server), python-dev and make::
-
-    $ sudo apt-get install postgresql-9.1 libpq-dev rabbitmq-server python-dev make
+You will need to manually install Postgres 9.1 (postgresql-9.1),
+, RabbitMQ (rabbitmq-server), python-dev and make::
+
+    $ sudo apt-get install postgresql-9.1 rabbitmq-server python-dev make
+
 
 Also, you might want to install Bazaar (bzr) to grab the source code directly
 from Launchpad::
 
     $ sudo apt-get install bzr
 
-If you intend to run the test suite, you also need libxslt1-dev, libxml2-dev,
-xvfb and firefox::
-
-    $ sudo apt-get install libxslt1-dev libxml2-dev xvfb firefox
+This is the list of runtime dependencies that you'll need to install::
+
+    $ sudo apt-get install python-django python-django-piston \
+        python-django-south python-twisted python-txamqp python-amqplib \
+        python-formencode python-oauth python-oops python-oops-datedir-repo \
+        python-twisted python-oops-wsgi python-psycopg2 python-yaml
+
+Additionally, you probably want to install the following python libraries
+for development convenience::
+
+    $ sudo apt-get install python-sphinx python-lxml
+
+If you intend to run the test suite, you also need xvfb and firefox::
+
+    $ sudo apt-get install xvfb firefox
 
 All other development dependencies are pulled automatically from `PyPI`_
 when buildout runs.
@@ -107,6 +119,22 @@
 
     $ make distclean
 
+Adding new dependencies
+=======================
+
+Since MaaS is distributed mainly as Ubuntu package, all runtime dependencies
+should be packaged and we should develop with the packaged version if
+possible. You'll need to add the dependency to the
+``allowed-eggs-from-site-packages`` option in the ``buildout.cfg`` file. (And
+don't forget to add the version to ``versions.cfg`` as we run with
+``allowed-picked-version`` set to false.)
+
+If it is a development-only depency (i.e. only needed for the test suite, or
+for developers' convenience), simply running ``buildout`` like this will make
+the necessary updates to ``versions.cfg``::
+
+    $ ./bin/buildout -v buildout:allow-picked-versions=true
+
 
 Adding new source files
 =======================

=== modified file 'buildout.cfg'
--- buildout.cfg	2012-02-24 10:54:15 +0000
+++ buildout.cfg	2012-02-24 22:17:17 +0000
@@ -7,12 +7,44 @@
   pserv-test
   repl
   sphinx
+extensions = buildout-versions
+buildout_versions_file = versions.cfg
+versions = versions
 extends = versions.cfg
-versions = versions
-include-site-packages = false
-# Don't always check for newer packages; use `bin/buildout -n` to
-# override this and check explicitly.
-newest = false
+download-cache = download-cache
+install-from-cache = false
+
+# Since MaaS's main deployment target is Ubuntu, all
+# runtime dependencies should come from python packages.
+# Only development-time dependencies should come from eggs.
+# For convenience, we allow some of those to come from site-packages,
+# mainly those which contains C extensions like lxml
+include-site-packages = true
+allowed-eggs-from-site-packages =
+    Django
+    South
+    amqplib
+    django-piston
+    FormEncode
+    oauth
+    oops
+    oops-datedir-repo
+    oops-twisted
+    oops-wsgi
+    psycopg2
+    PyYAML
+    Twisted
+    txAMQP
+    # Convenient developer dependencies
+    Jinja2
+    Pygments
+    Sphinx
+    docutils
+    lxml
+    ipython
+
+prefer-final = true
+allow-picked-versions = false
 
 [common]
 extra-paths =

=== modified file 'setup.py'
--- setup.py	2012-01-24 12:53:05 +0000
+++ setup.py	2012-02-24 22:17:17 +0000
@@ -56,8 +56,22 @@
         ),
     package_dir={'': b'src'},
 
-    install_requires=['setuptools'],
-
+    install_requires=[
+        'setuptools',
+        'Django' = 1.3.1,
+        'psycopg2',
+        'amqplib',
+        'django-piston',
+        'FormEncode',
+        'oauth',
+        'oops',
+        'oops-datedir-repo',
+        'oops-twisted',
+        'PyYAML',
+        'South',
+        'Twisted',
+        'txAMQP',
+        ],
     classifiers=[
         'Development Status :: 4 - Beta',
         'Framework :: Django',
@@ -67,5 +81,23 @@
         'Operating System :: OS Independent',
         'Programming Language :: Python',
         'Topic :: Internet :: WWW/HTTP',
-        ]
+        ],
+    extra_requires=dict(
+        doc=[
+            'collective.recipe.sphinxbuilder',
+            'Sphinx',
+            ],
+        tests=[
+            'coverage',
+            'django-nose',
+            'lxml',
+            'sst',
+            'fixtures',
+            'nose',
+            'nose-subunit',
+            'python-subunit',
+            'rabbitfixture',
+            'testresources',
+            'testtools',
+            ],
     )

=== modified file 'versions.cfg'
--- versions.cfg	2012-02-24 10:54:15 +0000
+++ versions.cfg	2012-02-24 22:17:17 +0000
@@ -1,31 +1,91 @@
 [versions]
-coverage =
-django = 1.3.1
+# Actually, we depend on the version of django in Ubuntu precise
+# which contains the backported fix for
+# https://code.djangoproject.com/ticket/16250
+# Otherwise, psycopg2 > 2.4.1 is problematic with Django 1.3.1.
+Django = 1.3.1
+# psycopg2 = 2.4.1
+psycopg2 = 2.4.4
+
 # Bug 251 is problematic in 0.9.2.
 django-debug-toolbar = 0.9.1
-django-nose =
-django-piston =
-docutils =
-fixtures =
-formencode = 1.2.4
-ipython =
-lxml =
-nose =
-nose-subunit =
-oauth =
-oops =
-oops-datedir-repo =
-oops-twisted =
-oops-wsgi =
-# psycopg2 > 2.4.1 is problematic with Django 1.3.1; see
-# https://code.djangoproject.com/ticket/16250
-psycopg2 = 2.4.1
-python-subunit =
-pyyaml = 3.10
+
+# Automatic versions in Precise
+amqplib = 1.0.0
+django-piston = 0.2.3
+docutils = 0.8.1
+FormEncode = 1.2.4
+ipython = 0.12
+Jinja2 = 2.6
+lxml = 2.3.2
+oauth = 1.0.1
+oops = 0.0.10
+oops-datedir-repo = 0.0.15
+oops-twisted = 0.0.6
+oops-wsgi = 0.0.9
+Pygments = 1.4
+PyYAML = 3.10
+South = 0.7.3
+Sphinx = 1.0.8
+Twisted = 11.1.0
+txAMQP = 0.5
+
+# Added by Buildout Versions at 2012-02-24 15:51:04.865203
+buildout-versions = 1.7
+collective.recipe.sphinxbuilder = 0.7.0
+coverage = 3.5.1
+distribute = 0.6.24
+django-nose = 0.1.3
+fixtures = 0.3.8
+flake8 = 1.1
+nose = 1.1.2
+nose-subunit = 0.2
+python-subunit = 0.0.7
 rabbitfixture = 0.3.2
-South =
-sst =
-testresources >= 0.2.4-r58
-testtools =
-twisted =
-txamqp =
+testresources = 0.2.5
+testtools = 0.9.14
+z3c.recipe.scripts = 1.0.1
+
+# Required by:
+# collective.recipe.sphinxbuilder==0.7.0
+zc.buildout = 1.5.2
+
+# Required by:
+# collective.recipe.sphinxbuilder==0.7.0
+zc.recipe.egg = 1.3.2
+
+# Added by Buildout Versions at 2012-02-24 16:56:06.100791
+PyVirtualDisplay = 0.0.9
+sst = 0.1.0
+
+# Required by:
+# PyVirtualDisplay==0.0.9
+EasyProcess = 0.1.3
+
+# Required by:
+# entrypoint2==0.0.4
+argparse = 1.2.1
+
+# Required by:
+# entrypoint2==0.0.4
+decorator = 3.3.2
+
+# Required by:
+# PyVirtualDisplay==0.0.9
+entrypoint2 = 0.0.4
+
+# Required by:
+# sst==0.1.0
+junitxml = 0.6
+
+# Required by:
+# PyVirtualDisplay==0.0.9
+path.py = 2.2.2
+
+# Required by:
+# sst==0.1.0
+selenium = 2.19.1
+
+# Required by:
+# sst==0.1.0
+unittest2 = 0.5.1


Follow ups