old_contents: #!/usr/bin/env python
  try:
      from setuptools import setup
  except ImportError:
      from distutils.core import setup
  import os
  import re
  
  
  def read(file_name):
      return open(os.path.join(os.path.dirname(__file__), file_name)).read()
  
  
  # Implemented from http://stackoverflow.com/a/41110107
  def get_property(prop, project):
      result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), open(project + '/__init__.py').read())
      return result.group(1)
  
  
  setup(
      name='geomdl',
      version=get_property('__version__', 'geomdl'),
      description='NURBS curve and surface evaluation library in pure python',
      author='Onur Rauf Bingol',
      author_email='contact@onurbingol.net',
      license='MIT',
      url='https://github.com/orbingol/NURBS-Python',
      packages=['geomdl', 'geomdl.visualization', 'geomdl.shapes'],
      extras_require={
          'tests': ['pytest'],
          'visualization': ['matplotlib', 'plotly'],
      },
      long_description=read('DESCRIPTION.rst'),
      keywords='NURBS B-Spline curve surface CAD modeling visualization',
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: MIT License',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Visualization',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 3'
      ],
      project_urls={
          'Documentation': 'http://nurbs-python.readthedocs.io/',
          'Source': 'https://github.com/orbingol/NURBS-Python',
          'Tracker': 'https://github.com/orbingol/NURBS-Python/issues',
      },
  )
  
new_contents: #!/usr/bin/env python
  
  """
      NURBS-Python (geomdl) Setup Script
      NURBS-Python is released under the MIT License.
  
      The setup script directly depends on "setuptools" package and it does not fallback to "distutils".
      As a result, "setuptools" package has been set as an install requirement.
  """
  
  from setuptools import setup
  from setuptools.command.test import test as TestCommand
  import sys
  import os
  import re
  
  
  def read(file_name):
      return open(os.path.join(os.path.dirname(__file__), file_name)).read()
  
  
  # Implemented from http://stackoverflow.com/a/41110107
  def get_property(prop, project):
      result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), open(project + '/__init__.py').read())
      return result.group(1)
  
  
  # Reference: https://docs.pytest.org/en/latest/goodpractices.html
  class PyTest(TestCommand):
      user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
  
      def initialize_options(self):
          TestCommand.initialize_options(self)
          self.pytest_args = ""
  
      def run_tests(self):
          import shlex
  
          # import here, cause outside the eggs aren't loaded
          import pytest
  
          errno = pytest.main(shlex.split(self.pytest_args))
          sys.exit(errno)
  
  
  setup(
      name='geomdl',
      version=get_property('__version__', 'geomdl'),
      description='NURBS curve and surface evaluation library in pure python',
      author='Onur Rauf Bingol',
      author_email='contact@onurbingol.net',
      license='MIT',
      url='https://github.com/orbingol/NURBS-Python',
      packages=['geomdl', 'geomdl.visualization', 'geomdl.shapes'],
      install_requires=['setuptools'],
      extras_require={
          'visualization': ['matplotlib', 'plotly'],
      },
      tests_require=["pytest"],
      cmdclass={"test": PyTest},
      long_description=read('DESCRIPTION.rst'),
      keywords='NURBS B-Spline curve surface CAD modeling visualization',
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: MIT License',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Visualization',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 3'
      ],
      project_urls={
          'Documentation': 'http://nurbs-python.readthedocs.io/',
          'Source': 'https://github.com/orbingol/NURBS-Python',
          'Tracker': 'https://github.com/orbingol/NURBS-Python/issues',
      },
  )
  
subject: Remove distutils fallback option and add "setup.py test"