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

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

Ammendments that make "python setup.py test" fetch dependencies.

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