<commit_before># Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.

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

import os
from setuptools import setup, Extension, find_packages
from distutils.command.build import build
from setuptools.command.install import install
import subprocess

def copy_glpk_header():
    glpsol_path = os.path.dirname(subprocess.check_output(['which', 'glpsol']))
    glpk_header_path = os.path.join(os.path.dirname(glpsol_path), 'include', 'glpk.h')
    if os.path.exists(glpk_header_path):
        with open('glpk.h', 'w') as out_handle:
            with open(glpk_header_path) as in_handle:
                for line in in_handle:
                    if line == 'void glp_vprintf(const char *fmt, va_list arg);\n':
                        out_handle.write('// The following line is commented out because it is causing problems with swig\n')
                        out_handle.write('// void glp_vprintf(const char *fmt, va_list arg);')
                    else:
                        out_handle.write(line)
    else:
        raise Exception('Could not find glpk.h! Maybe glpk or glpsol is not installed.')


class CustomBuild(build):
    def run(self):
        self.run_command('build_ext')
        build.run(self)


class CustomInstall(install):
    def run(self):
        self.run_command('build_ext')
        self.do_egg_install()

# Copy and process glpk.h into current directory
copy_glpk_header()

setup(
    name='swiglpk',
    version='0.1.0',
    author='<NAME>',
    author_email='<EMAIL>',
    description='swiglpk - Simple swig bindings for the GNU Linear Programming Kit',
    license='Apache License Version 2.0',
    keywords='optimization swig glpk',
    url='TBD',
    long_description=open('README.md').read(),
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Topic :: Utilities',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'License :: OSI Approved :: Apache Software License',
    ],
    py_modules=['swiglpk'],
    cmdclass={'build': CustomBuild, 'install': CustomInstall},
    ext_modules=[Extension("_swiglpk", sources=["glpk.i"], libraries=['glpk'])]
)<commit_msg>Changed development status to Beta<commit_after># Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.

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

import os
from setuptools import setup, Extension, find_packages
from distutils.command.build import build
from setuptools.command.install import install
import subprocess

def copy_glpk_header():
    glpsol_path = os.path.dirname(subprocess.check_output(['which', 'glpsol']))
    glpk_header_path = os.path.join(os.path.dirname(glpsol_path), 'include', 'glpk.h')
    if os.path.exists(glpk_header_path):
        with open('glpk.h', 'w') as out_handle:
            with open(glpk_header_path) as in_handle:
                for line in in_handle:
                    if line == 'void glp_vprintf(const char *fmt, va_list arg);\n':
                        out_handle.write('// The following line is commented out because it is causing problems with swig\n')
                        out_handle.write('// void glp_vprintf(const char *fmt, va_list arg);')
                    else:
                        out_handle.write(line)
    else:
        raise Exception('Could not find glpk.h! Maybe glpk or glpsol is not installed.')


class CustomBuild(build):
    def run(self):
        self.run_command('build_ext')
        build.run(self)


class CustomInstall(install):
    def run(self):
        self.run_command('build_ext')
        self.do_egg_install()

# Copy and process glpk.h into current directory
copy_glpk_header()

setup(
    name='swiglpk',
    version='0.1.0',
    author='<NAME>',
    author_email='<EMAIL>',
    description='swiglpk - Simple swig bindings for the GNU Linear Programming Kit',
    license='Apache License Version 2.0',
    keywords='optimization swig glpk',
    url='TBD',
    long_description=open('README.md').read(),
    classifiers=[
        'Development Status :: 4 - Beta',
        'Topic :: Utilities',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'License :: OSI Approved :: Apache Software License',
    ],
    py_modules=['swiglpk'],
    cmdclass={'build': CustomBuild, 'install': CustomInstall},
    ext_modules=[Extension("_swiglpk", sources=["glpk.i"], libraries=['glpk'])]
)
{'fraction_non_alphanumeric': 0.11099137931034483, 'fraction_numerical': 0.007183908045977011, 'mean_word_length': 3.1840721262208866, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1605268', 'n_tokens_mistral': 1637, 'n_tokens_neox': 1585, 'n_words': 506}