Commits

Eric Larson  committed cfba55a

Removed some crud

  • Participants
  • Parent commits 1c4ef7f

Comments (0)

Files changed (4)

File configs/all_sample.conf

-[my-app]
-command = python -m my_app.server -h {host} -p {port}
-host = example.mydomain.com
-port = 8080
-instances = 1
-
-[my-app:config]
-dir = 'configs'
-filename = 'server.conf'
-text = '
-  Environment:
-    db: mongodb://foo:27017/bar/baz
-  '
-
-[other-app]
-host = db
-port = 27017
-command = mongodb --dbpath=/home/db/

File dad/lib/packaging.py

-'''
-Dad doesn't do much for packaging. The only responsibility it tries to
-take on is running whatever commands need to be run in order to
-install a package in a sandbox.
-
-This does include a really simple "package manager" that allows you to
-"install" packages. The packages are simple gzipped tarballs
-(tarr.gz). They should contain a MANIFEST that provides all the files
-that are placed on the filesystem. Uniinstalling is simply looping
-over the list of files and rm'ing the file. If you want something more
-complicated or with better dependency management, then use a real
-package manager like dpkg or rpm.
-'''
-
-from ConfigParser import ConfigParser, NoSectionError
-
-
-class PackageMeta(object):
-    '''
-    Package meta data is:
-      1. Version
-      2. Canonical name of what it provides
-      3. Description
-      4. Dependencies/Build Instructions
-    '''
-    def __init__(self, metafile):
-        cp = ConfigParser()
-        out = cp.read(metafile)
-        print metafile
-        sections = [
-            'main',
-            'description',
-            'install_deps',
-            'test_deps',
-            'run_deps',
-        ]
-
-        for section in sections:
-            try:
-                items = cp.items(section)
-                setattr(self, section, dict(items))
-            except NoSectionError as e:
-                pass
-        
-
-class Package(object):
-    '''
-    Loads a package to see its metadata (version, what it provides,
-    dependencies, etc.) and allows installing the package in a dad
-    sandbox.
-    '''
-
-    def __init__(self, pkgsrc):
-        self.pkgsrc = pkgsrc
-
-        
-
-

File dad/tests/unit/lib/stubs/test_meta.conf

-[main]
-name = my-package
-version = 2.3
-
-[install_deps]
-sqlalchemy = py#sqlalchemy==3.4
-
-[run_deps]
-libevent-dev = deb#libevent-dev
-
-[test_deps]
-lxml = pys#http://pypi.python.org/packages/source/l/lxml/lxml-2.3.tar.gz

File dad/tests/unit/lib/test_packaging.py

-import os
-
-from cStringIO import StringIO
-
-from dad.lib.packaging import PackageMeta
-
-
-from pprint import pprint
-
-
-here = os.path.dirname(os.path.abspath(__file__))
-
-class TestPackageMeta(object):
-
-    def test_load_meta(self):
-        pm = PackageMeta(os.path.join(here, 'stubs', 'test_meta.conf'))
-        pprint(dir(pm))
-        assert pm.main['name'] == 'my-package'
-        assert pm.main['version'] == '2.3'
-        assert pm.install_deps['sqlalchemy'] == 'py#sqlalchemy==3.4'
-        assert pm.run_deps['libevent-dev'] == 'deb#libevent-dev'
-        assert pm.test_deps['lxml'] == 'pys#http://pypi.python.org/packages/source/l/lxml/lxml-2.3.tar.gz'
-
-