<commit_before>from __future__ import division # confidence high

import distutils.extension
import sys
import logging

pkg = [ "pyfits", "pyfits.tests" ]
 

try:
    import numpy
    ext_modules = [distutils.extension.Extension("pyfits.pyfitsComp",
                     ["src/compress.c", "src/fits_hcompress.c",
                      "src/fits_hdecompress.c", "src/fitsio.c",
                      "src/pliocomp.c", "src/pyfitsCompWrapper.c",
                      "src/quantize.c", "src/ricecomp.c"],
                      include_dirs = ["src", numpy.get_include()],)]

except ImportError:
    ext_modules = ''
    logging.warn("NUMPY was not found.  It may not be installed or it may")
    logging.warn("not be in your PYTHONPATH")
    logging.warn("optional extension module pyfits.pyfitsComp failed to build")

# Reimplement distutils build_ext class to allow us to continue
# setup even if the extension fails to build.
from distutils.command.build_ext import build_ext as _build_ext

class build_ext(_build_ext):

   def build_extensions(self):
      for ext in self.extensions:

          try:
              self.build_extension(ext)
          except:
              distutils.log.warn(str(sys.exc_info()[1]))
              warn = "optional extension module %s failed to build" % (ext.name)
              logging.warn(warn)


setupargs = {
    'version' :                 "2.3",
    'description' :             "General Use Python Tools",
    'author' :                  "<NAME>, <NAME>, <NAME>, <NAME>, <NAME>",
    'maintainer_email' :        "<EMAIL>",
    'license' :                 "http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE",
    'platforms' :               ["Linux","Solaris","Mac OS X","Win"],
    'ext_modules' :             ext_modules,
    'cmdclass' :                {'build_ext': build_ext,},
    'package_dir' :             { 'pyfits' : 'lib', 'pyfits.tests' : 'lib/tests' },
    'data_files' :              [ ( 'pyfits/tests', [ 'lib/tests/*.fits' ] ) ],
}
<commit_msg>Change to allow setup to continue running on Windows when the compiler available on the windows platform does not match the compiler used to build Python.<commit_after>from __future__ import division # confidence high

import distutils.extension
import sys
import logging

pkg = [ "pyfits", "pyfits.tests" ]
 

try:
    import numpy
    ext_modules = [distutils.extension.Extension("pyfits.pyfitsComp",
                     ["src/compress.c", "src/fits_hcompress.c",
                      "src/fits_hdecompress.c", "src/fitsio.c",
                      "src/pliocomp.c", "src/pyfitsCompWrapper.c",
                      "src/quantize.c", "src/ricecomp.c"],
                      include_dirs = ["src", numpy.get_include()],)]

except ImportError:
    ext_modules = ''
    logging.warn("NUMPY was not found.  It may not be installed or it may")
    logging.warn("not be in your PYTHONPATH")
    logging.warn("optional extension module pyfits.pyfitsComp failed to build")

# Reimplement distutils build_ext class to allow us to continue
# setup even if the extension fails to build.
from distutils.command.build_ext import build_ext as _build_ext

class build_ext(_build_ext):

   def run(self):
      try:
         _build_ext.run(self)
      except:
         distutils.log.warn(str(sys.exc_info()[1]))
         warn = "optional extension modules failed to build"
         logging.warn(warn)

   def build_extensions(self):
      for ext in self.extensions:

          try:
              self.build_extension(ext)
          except:
              distutils.log.warn(str(sys.exc_info()[1]))
              warn = "optional extension module %s failed to build" % (ext.name)
              logging.warn(warn)


setupargs = {
    'version' :                 "2.3",
    'description' :             "General Use Python Tools",
    'author' :                  "<NAME>, <NAME>, <NAME>, <NAME>, <NAME>",
    'maintainer_email' :        "<EMAIL>",
    'license' :                 "http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE",
    'platforms' :               ["Linux","Solaris","Mac OS X","Win"],
    'ext_modules' :             ext_modules,
    'cmdclass' :                {'build_ext': build_ext,},
    'package_dir' :             { 'pyfits' : 'lib', 'pyfits.tests' : 'lib/tests' },
    'data_files' :              [ ( 'pyfits/tests', [ 'lib/tests/*.fits' ] ) ],
}

{'fraction_non_alphanumeric': 0.12813497492020065, 'fraction_numerical': 0.0015959872321021432, 'mean_word_length': 2.2281089036055923, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6044009', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1290, 'n_words': 315}