Commits

Anonymous committed 9176c60

Use virtualenv to install hornet (currently has issues with matplotlib installation.

  • Participants
  • Parent commits 68efc89

Comments (0)

Files changed (6)

 syntax: glob
 *.pyc
-*.pyo
-*.o
-*.so
 *.cfg
 *.log
 *.egg-info
 sloccount.sc
 data/
 results/
-old/
 docs/.build
 build/
 dist/
 target/
+bootstrap/

File logging.conf

-[loggers]
-keys=root,hornet
-
-[handlers]
-keys=consoleHandler,fileHandler
-
-[formatters]
-keys=simpleFormatter
-
-[logger_root]
-level=WARN
-handlers=consoleHandler,fileHandler
-
-[logger_hornet]
-level=DEBUG
-handlers=consoleHandler,fileHandler
-qualname=hornet
-propagate=0
-
-[handler_consoleHandler]
-class=StreamHandler
-level=DEBUG
-formatter=simpleFormatter
-args=(sys.stdout,)
-
-[handler_fileHandler]
-class=FileHandler
-level=DEBUG
-formatter=simpleFormatter
-args=('hornet.log', 'a+')
-
-[formatter_simpleFormatter]
-format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
-datefmt=
 
 SRC_DIR = './src'
 TEST_DIR = './tests'
+BOOTSTRAP_DIR = "bootstrap"
+BOOTSTRAP_PYEXEC = "%s/bin/python" % BOOTSTRAP_DIR
+BOOTSTRAP_SCRIPT = "%s/bootstrap.py" % BOOTSTRAP_DIR
 
 sys.path.extend(map(os.path.abspath, [SRC_DIR, TEST_DIR]))
 import hornet.release as release
     },
 
     #test_suite = 'nose.collector',
-    #install_requires = ['matplotlib', 'numpy', 'processing', 'decorator',
-    #                    'networkx', 'wxPython', 'sqlalchemy'], #'configobj', 
-    setup_requires = ['sphinx', 'mock', 'nose', 'NoseXUnit', 'coverage'],
+    install_requires = ['matplotlib', 'numpy', 'decorator',
+                        'networkx', 'sqlalchemy'], #'wxPython', 'configobj', 
+    #setup_requires = ['sphinx==0.6.1', 'mock==0.5.0', 'nose=0.10.4', 'NoseXUnit==0.3.2', 'coverage==2.85'],
 )
 
 options(
         builddir = '.build'
     ),
     pylint = Bunch(
-        module=['hornet']
+        module = ['hornet']
     ),
     htmlserve = Bunch(
         docsdir = './docs/.build/html/',
         port = 8000
     ),
+    virtualenv=Bunch(
+        script_name = BOOTSTRAP_SCRIPT,
+        packages_to_install = ['sphinx==0.6.1', 'mock==0.5.0', 'nose=0.10.4', 
+                               'NoseXUnit==0.3.2', 'coverage==2.85', 'networkx==1.0.dev', 
+                               'decorator', 'sqlalchemy==0.5.3', 'numpy==1.3.0'], 
+                               #FIXME get matplotlib installed 'matplotlib==0.91.1'
+    )
 )
 
 @task
+def bootstrap():
+    """create virtualenv in ./bootstrap"""
+    install = paver.path.path(BOOTSTRAP_DIR)
+    if not install.exists():
+        install.mkdir()
+    call_task('paver.virtual.bootstrap')
+    sh('cd %s; %s bootstrap.py' % (BOOTSTRAP_DIR, sys.executable))
+
+@task
 @needs(['paver.doctools.html'])
 def html():
     """Build the docs."""
     """Overrides sdist to make sure that our setup.py is generated."""
     pass
 
-#@task
-#@needs(['build'])
-#def coverage():
-#    import coverage
-#    import hornet.tests
-#    coverage.start()
-#    hornet.tests.main()
-#    coverage.stop()
-#    coverage.analysis()
-#    coverage.report()
-
 @task
 @needs('html')
 def doctest():

File src/hornet/__init__.py

 .. moduleauthor:: John Paulett <john.paulett -at- vanderbilt.edu>
 """
 
-import matplotlib; matplotlib.use('Agg')

File src/hornet/command.py

 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008 John Paulett (john -at- vanderbilt.edu)
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution.
+# Copyright 2009 Vanderbilt University
+# 
+# Licensed under the Apache License, Version 2.0 (the "License"); 
+# you may not use this file except in compliance with the License. 
+# You may obtain a copy of the License at 
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0 
+# 
+# Unless required by applicable law or agreed to in writing, software 
+# distributed under the License is distributed on an "AS IS" BASIS, 
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+# See the License for the specific language governing permissions and 
+# limitations under the License. 
 
-#import pyximport; pyximport.install(pyimport = True)
+"""Entry point for HORNET that launches the program. 
+
+.. moduleauthor:: John Paulett <john.paulett -at- vanderbilt.edu>
+"""
 
 from hornet.application import PluginRunner, Config
+from hornet.file import get_dir, join
 from hornet.loading import load_class
 from hornet.release import version
 from optparse import OptionParser
 import logging
 import os
 
+import matplotlib; matplotlib.use('Agg')
+
 #import sys
 #limit = sys.getrecursionlimit()
 #sys.setrecursionlimit(limit*20)
     return options, args
 
 def main():
-    logging.config.fileConfig('logging.conf')
+    logging.config.fileConfig(join(get_dir(__file__), 'logging.conf'))
     logger = logging.getLogger(__name__)
     
     options, args = _optparse()
 
     action = options.action
     if action == 'run':
-        main(options.config)
+        run(options.config)
     elif action == 'profile':
         profile()
       

File src/hornet/logging.conf

+[loggers]
+keys=root,hornet
+
+[handlers]
+keys=consoleHandler,fileHandler
+
+[formatters]
+keys=simpleFormatter
+
+[logger_root]
+level=WARN
+handlers=consoleHandler,fileHandler
+
+[logger_hornet]
+level=DEBUG
+handlers=consoleHandler,fileHandler
+qualname=hornet
+propagate=0
+
+[handler_consoleHandler]
+class=StreamHandler
+level=DEBUG
+formatter=simpleFormatter
+args=(sys.stdout,)
+
+[handler_fileHandler]
+class=FileHandler
+level=DEBUG
+formatter=simpleFormatter
+args=('hornet.log', 'a+')
+
+[formatter_simpleFormatter]
+format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+datefmt=