Quantum Packaging Proposal

Notes:

virtualenv ~/.quantum-venv && pip install quantum -E ~/.quantum-venv
#Install the sample-plugin
pip install quantum-sample-plugin -E ~/.quantum-venv

Requirements:

Based on those requirements, my proposal is to use Python's setuptools (http://pypi.python.org/pypi/setuptools) to manage building packages. This has many benefits:

Project Format:

To use setuptools for Quantum, we first need to break it out into its individual projects, each with its own build script. I see 4 good candidates for main Quantum packages:

The git repo looks something like this:

quantum/
  setup.py
  client/
    setup.py
    lib/
      __init__.py
      quantum/
        __init__.py
        client.py
  common/
    setup.py
    lib/
      __init__.py
      quantum/
        __init__.py
        common/
          __init__.py
          exceptions.py
          serializer.py
          utils.py
  server/
    setup.py
    lib/
      __init__.py
      quantum/
        __init__.py
        server.py
  plugins/
    sample-plugin/
      setup.py
      lib/
        __init__.py
    cisco-plugin/
      setup.py
      lib/
        __init__.py

Application:

I have built and added a setup.py file for the root of the repo. It has a few different commands to use so that you don't have to do them on each package individually.

sudo python setup.py install
  -- Installs quantum-common, quantum-client, quantum-server, and quantum-sample-plugin server-wide

python setup.py install --venv
  -- The same as above, but creates and installs into ~/.quantum-venv.  Requires no root permissions.

python setup.py install --user
  -- The same as above, but installs into ~/.local.  Requires no root permissions, but also less usable (unless you add it to you add to
     your PATH)

python setup.py uninstall
  -- Uninstalls quantum-common, quantum-client, quantum-server, and quantum-sample-plugin

python setup.py build rpm
  -- Builds RPM packages.  Requires rpmbuild (or rpm on Debian).

python setup.py build deb    (Experimental)
  -- Builds Deb packages.  It first builds RPMs, then uses alien to convert them.  Requires rpm and alien.

Development:

Setuptools allows you to install your software in "Development" mode where you don't need to re-install after each change. I haven't used it, but here is a link to its documentation: http://packages.python.org/distribute/setuptools.html#development-mode

I have setup the server and test scripts to find the module paths correctly, so you can directly use them without needing to install at all.

You can start server with:

bin/quantum-server

And run tests with:

python run_tests.py

CLI support is coming soon.

Wiki: QuantumPackaging (last edited 2011-09-29 18:14:43 by TylerSmith)