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

"""Compile the Cython libraries of Python-Solvespace."""

__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016-2019"
__license__ = "AGPL"
__email__ = "<EMAIL>"

from setuptools import setup, Extension, find_packages
from platform import system
from distutils import sysconfig

src_path = 'src/'
platform_path = src_path + 'platform/'
ver = sysconfig.get_config_var('VERSION')
lib = sysconfig.get_config_var('BINDIR')

with open("README.md", "r") as f:
    long_description = f.read()

macros = [
    ('_hypot', 'hypot'),
    ('M_PI', 'PI'),  # C++ 11
    ('ISOLATION_AWARE_ENABLED', None),
    ('LIBRARY', None),
    ('EXPORT_DLL', None),
    ('_CRT_SECURE_NO_WARNINGS', None),
]

compile_args = [
    '-O3',
    '-Wno-cpp',
    '-g',
    '-Wno-write-strings',
    '-fpermissive',
    '-fPIC',
    '-std=c++11',
]

sources = [
    'Cython/' + 'slvs.pyx',
    src_path + 'util.cpp',
    src_path + 'entity.cpp',
    src_path + 'expr.cpp',
    src_path + 'constrainteq.cpp',
    src_path + 'constraint.cpp',
    src_path + 'system.cpp',
    src_path + 'lib.cpp',
]

if system() == 'Windows':
    # Avoid compile error with CYTHON_USE_PYLONG_INTERNALS.
    # https://github.com/cython/cython/issues/2670#issuecomment-432212671
    macros.append(('MS_WIN64', None))
    # Disable format warning
    compile_args.append('-Wno-format')

    # Solvespace arguments
    macros.append(('WIN32', None))

    # Platform sources
    sources.append(platform_path + 'w32util.cpp')
    sources.append(platform_path + 'platform.cpp')
else:
    sources.append(platform_path + 'unixutil.cpp')

setup(
    name="python_solvespace",
    # version="3.0.0",
    author=__author__,
    author_email=__email__,
    description="Python library of Solvespace",
    long_description=long_description,
    url="https://github.com/solvespace/solvespace",
    packages=find_packages(),
    ext_modules=[Extension(
        "slvs",
        sources=sources,
        language="c++",
        include_dirs=['include', src_path, platform_path],
        define_macros=macros,
        extra_compile_args=compile_args
    )],
    setup_requires=[
        'setuptools>=18.0',
        'wheel',
        'cython',
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: Cython",
        "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Operating System :: OS Independent",
    ]<commit_msg>Update reader function.<commit_after># -*- coding: utf-8 -*-

"""Compile the Cython libraries of Python-Solvespace."""

__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016-2019"
__license__ = "AGPL"
__email__ = "<EMAIL>"

import os
import codecs
from setuptools import setup, Extension, find_packages
from platform import system
from distutils import sysconfig

here = os.path.abspath(os.path.dirname(__file__))
src_path = 'src/'
platform_path = src_path + 'platform/'
ver = sysconfig.get_config_var('VERSION')
lib = sysconfig.get_config_var('BINDIR')


def read(*parts):
    with codecs.open(os.path.join(here, *parts), 'r') as f:
        return f.read()


macros = [
    ('_hypot', 'hypot'),
    ('M_PI', 'PI'),  # C++ 11
    ('ISOLATION_AWARE_ENABLED', None),
    ('LIBRARY', None),
    ('EXPORT_DLL', None),
    ('_CRT_SECURE_NO_WARNINGS', None),
]

compile_args = [
    '-O3',
    '-Wno-cpp',
    '-g',
    '-Wno-write-strings',
    '-fpermissive',
    '-fPIC',
    '-std=c++11',
]

sources = [
    'Cython/' + 'slvs.pyx',
    src_path + 'util.cpp',
    src_path + 'entity.cpp',
    src_path + 'expr.cpp',
    src_path + 'constrainteq.cpp',
    src_path + 'constraint.cpp',
    src_path + 'system.cpp',
    src_path + 'lib.cpp',
]

if system() == 'Windows':
    # Avoid compile error with CYTHON_USE_PYLONG_INTERNALS.
    # https://github.com/cython/cython/issues/2670#issuecomment-432212671
    macros.append(('MS_WIN64', None))
    # Disable format warning
    compile_args.append('-Wno-format')

    # Solvespace arguments
    macros.append(('WIN32', None))

    # Platform sources
    sources.append(platform_path + 'w32util.cpp')
    sources.append(platform_path + 'platform.cpp')
else:
    sources.append(platform_path + 'unixutil.cpp')

setup(
    name="python_solvespace",
    # version="3.0.0",
    author=__author__,
    author_email=__email__,
    description="Python library of Solvespace",
    long_description=read("README.md"),
    url="https://github.com/solvespace/solvespace",
    packages=find_packages(),
    ext_modules=[Extension(
        "slvs",
        sources,
        language="c++",
        include_dirs=['include', src_path, platform_path],
        define_macros=macros,
        extra_compile_args=compile_args
    )],
    python_requires=">=3.6",
    setup_requires=[
        'setuptools',
        'wheel',
        'cython',
    ],
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: Cython",
        "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Operating System :: OS Independent",
    ]
{'fraction_non_alphanumeric': 0.1547304937806257, 'fraction_numerical': 0.017150395778364115, 'mean_word_length': 3.2286852589641435, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '2779319', 'n_tokens_mistral': 1861, 'n_tokens_neox': 1785, 'n_words': 360}