<commit_before># -*- coding: utf-8 -*-

from setuptools import setup, Extension
import platform
import os


with open('README.md') as f:
    readme = f.read()


def ls_dir(base_dir):
    """List files recursively."""
    base_dir = os.path.join(base_dir, "")
    return [
        os.path.join(dirpath.replace(base_dir, "", 1), f)
        for (dirpath, dirnames, files) in os.walk(base_dir)
        for f in files
    ]

x64 = platform.architecture()[0] == '64bit'
libdir = 'lib64' if x64 else 'lib32'

setup(
    name='amplpy',
    version='0.1.0a3',
    description='Python API for AMPL',
    long_description=readme,
    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/ampl/amplpy',
    license='BSD',
    platforms='any',
    classifiers=[
        'Development Status :: 1 - Planning',
        'Environment :: Console',
        'Operating System :: OS Independent',
        'Intended Audience :: Science/Research',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Scientific/Engineering',
    ],
    packages=['amplpy'],
    ext_modules=[Extension(
        'amplpy.amplpython._amplpython',
        libraries=['ampl'],
        library_dirs=[os.path.join('amplpy', 'amplpython', libdir)],
        include_dirs=[os.path.join('amplpy', 'amplpython', 'include')],
        runtime_library_dirs=[os.path.join('amplpy', 'amplpython', libdir)],
        sources=[
          os.path.join('amplpy', 'amplpython', 'amplpythonPYTHON_wrap.cxx')
        ],
    )],
    package_data={"": ls_dir("amplpy/")},
)<commit_msg>Fix runtime_lib_dirs on Linux and macOS<commit_after># -*- coding: utf-8 -*-

from setuptools import setup, Extension
import platform
import os


with open('README.md') as f:
    readme = f.read()


def ls_dir(base_dir):
    """List files recursively."""
    base_dir = os.path.join(base_dir, "")
    return [
        os.path.join(dirpath.replace(base_dir, "", 1), f)
        for (dirpath, dirnames, files) in os.walk(base_dir)
        for f in files
    ]


x64 = platform.architecture()[0] == '64bit'
libdir = 'lib64' if x64 else 'lib32'
ostype = platform.system()

if ostype == 'Linux':
    runtime_lib_dirs = [
        os.path.join('$ORIGIN', 'amplpy', 'amplpython', libdir)
    ]
elif ostype == 'Darwin':
    runtime_lib_dirs = [
        os.path.join('@loader_path', 'amplpy', 'amplpython', libdir)
    ]
else:
    runtime_lib_dirs = []

setup(
    name='amplpy',
    version='0.1.0a3',
    description='Python API for AMPL',
    long_description=readme,
    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/ampl/amplpy',
    license='BSD',
    platforms='any',
    classifiers=[
        'Development Status :: 1 - Planning',
        'Environment :: Console',
        'Operating System :: OS Independent',
        'Intended Audience :: Science/Research',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Scientific/Engineering',
    ],
    packages=['amplpy'],
    ext_modules=[Extension(
        '_amplpython',
        libraries=['ampl'],
        library_dirs=[os.path.join('amplpy', 'amplpython', libdir)],
        include_dirs=[os.path.join('amplpy', 'amplpython', 'include')],
        runtime_library_dirs=runtime_lib_dirs,
        sources=[
          os.path.join('amplpy', 'amplpython', 'amplpythonPYTHON_wrap.cxx')
        ],
    )],
    package_data={"": ls_dir("amplpy/")},
)
{'fraction_non_alphanumeric': 0.1636788776305534, 'fraction_numerical': 0.013510002598077423, 'mean_word_length': 2.91260162601626, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '4340698', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1226, 'n_words': 261}