source: TI03-DataExtractor/branches/repackaging/server/setup.py @ 1848

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/repackaging/server/setup.py@1848
Revision 1848, 2.4 KB checked in by spascoe, 14 years ago (diff)

Script hook into the test_suite.

Line 
1"""
2ndg.dx.server setup script.
3
4@author: Stephen Pascoe
5"""
6
7import ez_setup; ez_setup.use_setuptools()
8
9from setuptools import setup, find_packages
10
11from setuptools.command.test import test
12class ndgTest(test):
13    description = "create a temporary NDG environment before testing"
14
15    user_options = [
16        ('test-home', 'h', "directory to create the NDG environment"),
17        ('test-conf', 'c', "configuration file to base NDG_HOME/ndg.conf on"
18                          " (default: egg:ndg.dx.server.test.server.conf)"),
19        ] + test.user_options
20
21    def initialize_options(self):
22        test.initialize_options(self)
23        self.test_home = None
24        self.test_conf = None
25
26    def finalize_options(self):
27        test.finalize_options(self)
28        if not self.test_home:
29            self.test_home = './test_ndg_home'
30
31    def run(self):
32        import os, pkg_resources, shutil, ConfigParser
33        from ndg.dx.server.MakeConfig import makeTestHome
34
35        makeTestHome(self.test_home, self.test_conf)
36
37        # Run the tests
38        return test.run(self)
39
40
41setup(
42    name = 'ndg_dx_server',
43    version = '0.3.5a1',
44    description = 'Python Data Extractor Server',
45    author = 'Ag Stephens',
46    author_email = 'a.stephens@rl.ac.uk',
47    url = 'http://ndg.nerc.ac.uk/DataExtractor',
48    license = """Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
49This software may be distributed under the terms of the
50Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QP""",
51
52    packages = find_packages(),
53    namespace_packages = ['ndg', 'ndg.dx'],
54
55    install_requires = ['ZSI==2.0rc3', 'cdat_lite',
56                        'ndg_utils'],
57    entry_points = '''
58    [console_scripts]
59    addDatasetGroup = ndg.dx.server.scripts.addDatasetGroup:main
60    addDataset = ndg.dx.server.scripts.addDataset:main
61    addWholeCatalogue = ndg.dx.server.scripts.addWholeCatalogue:main
62    cleanOutDatasetXMLFile = ndg.dx.server.scripts.cleanOutDatasetXMLFile:main
63    DXWSInterface = ndg.dx.server.scripts.DXWSInterface:main
64    fixSession = ndg.dx.server.scripts.fixSession:main
65    removeDataset = ndg.dx.server.scripts.removeDataset:main
66    showSession = ndg.dx.server.scripts.showSession:main
67
68    testDxServer = ndg.dx.server.test:main
69    ''',
70
71    include_package_data = True,
72
73    test_suite = 'ndg.dx.server.test.test_suite',
74    cmdclass = {'test': ndgTest},
75    )
76   
Note: See TracBrowser for help on using the repository browser.