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

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

Moved test_home creation code into the package so that it can be run when
deployed.

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        # Wipe clean self.test_home
36        if os.path.exists(self.test_home):
37            shutil.rmtree(self.test_home)
38        os.mkdir(self.test_home)
39
40        makeTestHome(self.test_home, self.test_conf)
41
42        # Run the tests
43        return test.run(self)
44
45
46setup(
47    name = 'ndg_dx_server',
48    version = '0.3.5a1',
49    description = 'Python Data Extractor Server',
50    author = 'Ag Stephens',
51    author_email = 'a.stephens@rl.ac.uk',
52    url = 'http://ndg.nerc.ac.uk/DataExtractor',
53    license = """Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
54This software may be distributed under the terms of the
55Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QP""",
56
57    packages = find_packages(),
58    namespace_packages = ['ndg', 'ndg.dx'],
59
60    install_requires = ['ZSI==2.0rc3', 'cdat_lite',
61                        'ndg_utils'],
62    entry_points = '''
63    [console_scripts]
64    addDatasetGroup = ndg.dx.server.scripts.addDatasetGroup:main
65    addDataset = ndg.dx.server.scripts.addDataset:main
66    addWholeCatalogue = ndg.dx.server.scripts.addWholeCatalogue:main
67    cleanOutDatasetXMLFile = ndg.dx.server.scripts.cleanOutDatasetXMLFile:main
68    DXWSInterface = ndg.dx.server.scripts.DXWSInterface:main
69    fixSession = ndg.dx.server.scripts.fixSession:main
70    removeDataset = ndg.dx.server.scripts.removeDataset:main
71    showSession = ndg.dx.server.scripts.showSession:main
72    ''',
73
74    include_package_data = True,
75
76    test_suite = 'ndg.dx.server.test.test_suite',
77    cmdclass = {'test': ndgTest},
78    )
79   
Note: See TracBrowser for help on using the repository browser.