old_contents: #!/usr/bin/env python
  """
  setup.py file for compiling Infomap module
  """
  
  from distutils.core import setup, Extension
  from distutils.file_util import copy_file
  import sysconfig
  import fnmatch
  import os
  import re
  
  cppSources = []
  for root, dirnames, filenames in os.walk('.'):
      for filename in fnmatch.filter(filenames, '*.cpp'):
          cppSources.append(os.path.join('.', root, filename))
  
  # Extract Infomap version
  infomapVersion = ''
  with open(os.path.join('src', 'io', 'version.cpp')) as f:
      for line in f:
          m = re.match(r'.+INFOMAP_VERSION = \"(.+)\"', line)
          if m: infomapVersion = m.groups()[0]
  
  infomap_module = Extension(
      '_infomap',
      sources=cppSources,
      extra_compile_args=[
          '-DAS_LIB',
          '-DPYTHON',
          '-Wno-deprecated-register',
          '-std=c++14'
      ])
  
  setup(
      name='infomap',
      version=infomapVersion,
      author="Team at mapequation.org",
      description="""Infomap clustering algorithm""",
      url="www.mapequation.org",
      ext_modules=[infomap_module],
      py_modules=["infomap"])
  
  # Clean ABI Version Tagged .so Files
  ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
  if ext_suffix is None:
      ext_suffix = sysconfig.get_config_var('SO')
  if ext_suffix is not None:
      copy_file('_infomap{}'.format(ext_suffix), '_infomap.so')
new_contents: #!/usr/bin/env python
  """
  setup.py file for compiling Infomap module
  """
  
  from distutils.core import setup, Extension
  from distutils.file_util import copy_file
  import sysconfig
  import fnmatch
  import os
  import re
  
  cppSources = []
  for root, dirnames, filenames in os.walk('.'):
      for filename in fnmatch.filter(filenames, '*.cpp'):
          cppSources.append(os.path.join('.', root, filename))
  
  # Extract Infomap version
  infomapVersion = ''
  with open(os.path.join('src', 'io', 'version.cpp')) as f:
      for line in f:
          m = re.match(r'.+INFOMAP_VERSION = \"(.+)\"', line)
          if m: infomapVersion = m.groups()[0]
  
  infomap_module = Extension(
      '_infomap',
      sources=cppSources,
      extra_compile_args=[
          '-DAS_LIB',
          '-DPYTHON',
          '-Wno-deprecated-register',
          '-std=c++14',
          '-stdlib=libc++', # Fix error: no member named 'unique_ptr' in namespace 'std'
          '-mmacosx-version-min=10.10' # Fix clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
      ],
      extra_link_args=[
          '-mmacosx-version-min=10.10'
      ])
  
  setup(
      name='infomap',
      version=infomapVersion,
      author="Team at mapequation.org",
      description="""Infomap clustering algorithm""",
      url="www.mapequation.org",
      ext_modules=[infomap_module],
      py_modules=["infomap"])
  
  # Clean ABI Version Tagged .so Files
  ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
  if ext_suffix is None:
      ext_suffix = sysconfig.get_config_var('SO')
  if ext_suffix is not None:
      copy_file('_infomap{}'.format(ext_suffix), '_infomap.so')
subject: Fix python compilation in osx clang