#!/usr/bin/env python

################################################################################
# Copyright (c) 2007-2016, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
#   https://opensource.org/licenses/BSD-3-Clause
#
# 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 os

from setuptools import dist, find_packages

# Ensure we have numpy before we start as it is needed before we call setup()
# If not installed system-wide it will be downloaded into the local .eggs dir
dist.Distribution(dict(setup_requires='numpy'))

from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration


def configuration(parent_package='', top_path=None):
    if os.path.exists('MANIFEST'):
        os.remove('MANIFEST')

    config = Configuration(None, parent_package, top_path,
                           namespace_packages=['scikits'])

    config.set_options(ignore_setup_xxx_py=True,
                       assume_default_configuration=True,
                       delegate_options_to_subpackages=True,
                       quiet=True)

    config.add_subpackage('scikits')
    config.add_subpackage('scikits.fitting')
    config.add_data_files('scikits/__init__.py')
    config.add_data_dir('scikits/fitting/tests')

    return config

here = os.path.abspath(os.path.dirname(__file__))
readme = open(os.path.join(here, 'README.rst')).read()
news = open(os.path.join(here, 'NEWS.rst')).read()
long_description = readme + '\n\n' + news

if __name__ == "__main__":
    setup(name='scikits.fitting',
          description='Framework for fitting functions to data with SciPy',
          long_description=long_description,
          maintainer='Ludwig Schwardt',
          maintainer_email='ludwig@ska.ac.za',
          url='https://github.com/ska-sa/scikits.fitting',
          license='Modified BSD',
          version='0.5.1',
          classifiers=['Development Status :: 4 - Beta',
                       'Environment :: Console',
                       'Intended Audience :: Developers',
                       'Intended Audience :: Science/Research',
                       'License :: OSI Approved :: BSD License',
                       'Topic :: Scientific/Engineering'],
          configuration=configuration,
          install_requires=['numpy', 'scipy>=0.9'],
          namespace_packages=['scikits'],
          packages=find_packages(),
          include_package_data=True,
          zip_safe=False)

@@ -1997,39 +1997,8 @@
 ws%0A%0A
-if __name__ == %22__main__%22:%0A    
 setu
@@ -2029,20 +2029,16 @@
 ,%0A      
-   
- 
 descript
@@ -2101,20 +2101,16 @@
 ,%0A      
-    
 long_des
@@ -2134,36 +2134,32 @@
 cription,%0A      
-  
-  
 maintainer='Ludw
@@ -2172,20 +2172,16 @@
 wardt',%0A
-    
       ma
@@ -2221,20 +2221,16 @@
 ,%0A      
- 
-   
 url='htt
@@ -2276,20 +2276,16 @@
 ,%0A      
-   
- 
 license=
@@ -2306,20 +2306,16 @@
 ,%0A      
-    
 version=
@@ -2329,20 +2329,16 @@
 ,%0A      
-  
-  
 classifi
@@ -2395,20 +2395,16 @@
         
-    
 'Environ
@@ -2432,36 +2432,32 @@
                 
- 
-   
 'Intended Audien
@@ -2475,20 +2475,16 @@
 opers',%0A
-    
         
@@ -2554,20 +2554,16 @@
         
-    
 'License
@@ -2615,20 +2615,16 @@
         
-  
-  
 'Topic :
@@ -2657,20 +2657,16 @@
 ,%0A      
-    
 configur
@@ -2692,20 +2692,16 @@
 ,%0A      
- 
-   
 install_
@@ -2736,28 +2736,24 @@
 .9'%5D,%0A      
-   
- 
 namespace_pa
@@ -2778,20 +2778,16 @@
 ,%0A      
-    
 packages
@@ -2810,20 +2810,16 @@
 ,%0A      
-  
-  
 include_
@@ -2833,28 +2833,24 @@
 _data=True,%0A
-    
       zip_sa

Remove main script test as it should be redundant