<commit_before>#!/usr/bin/python

"""
   Copyright 2013 The Trustees of Princeton University

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   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.
"""

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import os
import sys
import shutil

source_root = "../"
build_dir = ""
distro = "UNKNOWN"

# is build_root in the args?
i = 0
while i < len(sys.argv):
   if sys.argv[i].startswith('--source-root='):
      source_root = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue

   if sys.argv[i].startswith("--build-dir="):
      build_dir = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue

   if sys.argv[i].startswith("--distro="):
      distro = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue 

   i += 1

distro_switch = "-D_DISTRO_%s" % distro

ext_source_root = source_root

ext_modules=[
    Extension("syndicate",
              sources=["syndicate.pyx"],
              libraries=["syndicate"],
              library_dirs=[os.path.join(source_root, build_dir, "lib/libsyndicate")],             # libsyndicate local build
              include_dirs=[os.path.join(source_root, build_dir, "lib/libsyndicate"), os.path.join(source_root, build_dir, "lib/libsyndicate/ms"), os.path.join(source_root, build_dir, "protobufs/python"), os.path.join(source_root, build_dir, "lib")],
              extra_compile_args=["-D__STDC_FORMAT_MACROS", "-D_FORTIFY_SOUCRE", "-D_BUILD_PYTHON", "-fstack-protector", "-fstack-protector-all", distro_switch],
              language="c++"),
    
    # Extension("volume",
    #          sources=["volume.pyx"],
    #          libraries=["syndicate", "syndicateUGclient"],
    #          library_dirs=[os.path.join(source_root, build_dir, "lib/libsyndicate"), os.path.join(source_root, build_dir, "bin/UG")],             # local build
    #          include_dirs=[os.path.join(source_root, build_dir, "lib/libsyndicate"),
    #                        os.path.join(source_root, build_dir, "lib/"),
    #                        os.path.join(source_root, build_dir, "protobufs"),
    #                        os.path.join(source_root, build_dir, "bin/UG"),
    #                        os.path.join(source_root, build_dir, "bin/UG/fs"), 
    #                        "/usr/local/include/syndicate"],
    #          extra_compile_args=["-D__STDC_FORMAT_MACROS", "-D_FORTIFY_SOUCRE", "-D_BUILD_PYTHON", "-fstack-protector", "-fstack-protector-all", distro_switch],
    #          language="c++"),
]

# get the list of RG drivers
driver_path = os.path.abspath( os.path.join(ext_source_root, "RG") )
sys.path.append( driver_path )

drivers = __import__("drivers")
driver_package_names = ["syndicate.rg.drivers." + name for name in drivers.__all__]

driver_package_paths = dict( [(package_name, os.path.join(ext_source_root, os.path.join("RG/drivers", package_name))) for package_name in drivers.__all__] )

setup(name='syndicate',
      version='0.1',
      description='Syndicate Python library',
      url='https://github.com/jcnelson/syndicate',
      author='<NAME>',
      author_email='<EMAIL>',
      license='Apache 2.0',<commit_msg>Build volume and syndicate extensions, and use the proper include directories.<commit_after>#!/usr/bin/python

"""
   Copyright 2013 The Trustees of Princeton University

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   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.
"""

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import os
import sys
import shutil

source_root = "../"
build_dir = ""
distro = "UNKNOWN"

# is build_root in the args?
i = 0
while i < len(sys.argv):
   if sys.argv[i].startswith('--source-root='):
      source_root = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue

   if sys.argv[i].startswith("--build-dir="):
      build_dir = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue

   if sys.argv[i].startswith("--distro="):
      distro = sys.argv[i].split("=", 1)[1]
      sys.argv.remove( sys.argv[i] )
      continue 

   i += 1

distro_switch = "-D_DISTRO_%s" % distro

ext_source_root = source_root

ext_modules=[
    Extension("syndicate",
              sources=["syndicate.pyx"],
              libraries=["syndicate"],
              library_dirs=[os.path.join(source_root, build_dir, "../lib/libsyndicate")],             # libsyndicate local build
              include_dirs=[os.path.join(source_root, build_dir, "../include")],
              extra_compile_args=["-D__STDC_FORMAT_MACROS", "-D_FORTIFY_SOUCRE", "-D_BUILD_PYTHON", "-fstack-protector", "-fstack-protector-all", distro_switch],
              language="c++"),
    
    Extension("volume",
              sources=["volume.pyx"],
              libraries=["syndicate", "syndicate-ug"],
              library_dirs=[os.path.join(source_root, build_dir, "../lib/libsyndicate")],
              include_dirs=[os.path.join(source_root, build_dir, "../include")],
              extra_compile_args=["-D__STDC_FORMAT_MACROS", "-D_FORTIFY_SOUCRE", "-D_BUILD_PYTHON", "-fstack-protector", "-fstack-protector-all", distro_switch],
              language="c++"),
]

# get the list of RG drivers
driver_path = os.path.abspath( os.path.join(ext_source_root, "RG") )
sys.path.append( driver_path )

drivers = __import__("drivers")
driver_package_names = ["syndicate.rg.drivers." + name for name in drivers.__all__]

driver_package_paths = dict( [(package_name, os.path.join(ext_source_root, os.path.join("RG/drivers", package_name))) for package_name in drivers.__all__] )

setup(name='syndicate',
      version='0.1',
      description='Syndicate Python library',
      url='https://github.com/jcnelson/syndicate',
      author='<NAME>',
      author_email='<EMAIL>@lists.cs.princeton.edu',
      license='Apache 2.0',
{'fraction_non_alphanumeric': 0.13995649021029732, 'fraction_numerical': 0.005801305293691081, 'mean_word_length': 3.1642512077294684, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1251973', 'n_tokens_mistral': 2260, 'n_tokens_neox': 2216, 'n_words': 490}