<commit_before>#!/usr/bin/env python3

'''
Installation script for MuPDF Python bindings, using scripts/pipcl.py.

Default behaviour:

    When building an sdist (e.g. with 'pip sdist'), we use clang-python to
    generate C++ source which is then included in the sdist.

    When installing or building a wheel (e.g. 'pip install <sdist>'), we
    assume that generated C++ source is already present. Thus we don't rely on
    clang-python being present.

Environmental variables:

    MUPDF_SETUP_BUILD_DIR
        Sets the build directory; overriden if --mupdf-build-dir is specified.

    MUPDF_SETUP_HAVE_CLANG_PYTHON
        Affects whether we use clang-python when building.

        If set and not '1', we do not attempt to use clang-python, and instead
        assume that generated files are already available in platform/c++/.

        Default is '0'.

    MUPDF_SETUP_HAVE_SWIG
        If set and not '1', we do not attempt to run swig, and instead assume
        that generated files are already available in platform/python/.
'''

import os
import re
import subprocess
import sys
import sys
import time

def log(text=''):
    for line in text.split('\n'):
        print(f'mupdf:setup.py: {line}')
    sys.stdout.flush()

if __name__ == '__main__':
    log(f'== We are being run directly. sys.argv={sys.argv}')
else:
    log(f'== We are being imported.')

mupdf_dir = os.path.abspath(f'{__file__}/..')
sys.path.append(f'{mupdf_dir}/scripts')
import pipcl

def mupdf_version():

    # If PKG-INFO exists, we are being used to create a wheel from an sdist, so
    # use the version from the PKG-INFO file.
    #
    if os.path.exists('PKG-INFO'):
        items = pipcl._parse_pkg_info('PKG-INFO')
        assert items['Name'] == 'mupdf'
        ret = items['Version']
        #log(f'Using version from PKG-INFO: {ret}')
        return ret

    # If we get here, we are in a source tree, e.g. to create an sdist.
    #
    # We use the MuPDF version with a unique(ish) suffix based on the current
    # date and time, so we can make multiple Python releases without requiring
    # an increment to the MuPDF version.
    #
    # This also allows us to easily experiment on test.pypi.org.
    #
    with open(f'{mupdf_dir}/include/mupdf/fitz/version.h') as f:
        text = f.read()
    m = re.search('\n#define FZ_VERSION "([^"]+)"\n', text)
    assert m
    version = m.group(1)
    version += time.strftime(".%Y%m%d.%H%M")
    log(f'Have created version number: {version}')
    return version

# Generated files that are copied into the Python installation.
#
out_names = [
        'libmupdf.so',      # C
        'libmupdfcpp.so',   # C++
        '_mupdf.so',        # Python internals
        'mupdf.py',         # Python
        ]

build_dir = os.environ.get('MUPDF_SETUP_BUILD_DIR', 'build/shared-release')
#log(f'MUPDF_SETUP_BUILD_DIR={os.environ.get("MUPDF_SETUP_BUILD_DIR")}')
#log(f'build_dir={build_dir}')

mupdf_build = None

# pipcl Callbacks.
#

# Set MUPDF_SETUP_MINIMAL=1 to create minimal package for testing
# upload/download etc, avoiding compilation when installing.
#
g_test_minimal = int(os.environ.get('MUPDF_SETUP_MINIMAL', '0'))

def git_info():
    '''
    Returns (current, origin, diff):
        current: git id from 'git show'.
        origin: git id from 'git show origin'.
        diff: diff relative to current.
    '''
    def get_id(command):
        text = subprocess.check_output(command, shell=True)
        text = text.decode('utf8')
        text = text.split('\n', 1)[0]
        text = text.split(' ', 1)[0]
        return text
    current = get_id('git show --pretty=oneline')
    origin = get_id('git show --pretty=oneline origin')
    diff = subprocess.check_output('git diff', shell=True).decode('utf8')
    return current, origin, diff

def sdist():
    '''
    pipcl callback. If we are a git checkout, return all files known to
    git. Otherwise return all files except for those in build/.
    '''
    # Create 'git-info' file containing git ids that identify this tree. For
    # the moment this is a simple text format, but we could possibly use pickle
    # instead, depending on whether we want to include more information, e.g.
    # diff relative to origin.
    #
    git_id, git_id_origin, git_diff = git_info()
    with open('git-info', 'w') as f:
        f.write(f'git-id: {git_id}\n')
        f.write(f'git-id-origin: {git_id_origin}\n')
        f.write(f'git-diff:\n{git_diff}\n')

    if g_test_minimal:
        # Cut-down for testing.
        return [
                'setup.py',
                'pyproject.toml',
                'scripts/pipcl.py',
                'include/mupdf/fitz/version.h',
                'COPYING',
                'git-info',
                ]

    if not os.path.exists('.git'):
        raise Exception(f'Cannot make sdist because not a git checkout')
    paths = pipcl.git_items( mupdf_dir, submodules=True)

    # Build C++ files and SWIG C code for inclusion in sdist, so that it can be
    # used on systems without clang-python or SWIG.
    #
    subprocess.check_call(f'./scripts/mupdfwrap.py -d {build_dir} -b 02', shell=True)
    paths += [
            'build/shared-release/mupdf.py',
            'platform/c++/container_classnames.pickle',
            'platform/c++/implementation/classes.cpp',
            'platform/c++/implementation/exceptions.cpp',
            'platform/c++/implementation/functions.cpp',
            'platform/c++/implementation/internal.cpp',
            'platform/c++/include/mupdf/classes.h',
            'platform/c++/include/mupdf/exceptions.h',
            'platform/c++/include/mupdf/functions.h',
            'platform/c++/include/mupdf/internal.h',
            'platform/c++/swig_c.pickle',
            'platform/c++/swig_python.pickle',
            'platform/c++/to_string_structnames.pickle',
            'platform/python/mupdfcpp_swig.cpp',
            'git-info',
            ]
    return paths

def build():
    '''
    pipcl callback. Build MuPDF C, C++ and Python libraries, with exact
    behaviour depending on <mupdf_build> and <build_dir>.
    '''
    if g_test_minimal:
        # Cut-down for testing.
        log(f'g_test_minimal set so doing minimal build.')
        os.makedirs(f'{mupdf_dir}/{build_dir}', exist_ok=True)
        path = f'{mupdf_dir}/{build_dir}/mupdf.py'
        with open(path, 'w') as f:
            f.write('print("This is fake mupdf!")')
        return [(path, os.path.basename(path))]

    global mupdf_build
    if mupdf_build is None:
        mupdf_build = os.environ.get('MUPDF_SETUP_BUILD')

    if mupdf_build is None:
        mupdf_build = '1'

    if mupdf_build == '1':
        if os.path.exists(f'{mupdf_dir}/PKG-INFO'):
            # We are in an sdist, so generated C++ source and generated SWIG
            # source files should be in place.
            #
            # We default to assuming that clang-python is not available and
            # SWIG is available.
            #
            have_clang_python = os.environ.get('MUPDF_SETUP_HAVE_CLANG_PYTHON', '0') == '1'
            have_swig = os.environ.get('MUPDF_SETUP_HAVE_SWIG', '1') == '1'
            b = 'm'         # Build C library.
            if have_clang_python:
                b += '0'    # Build C++ source.
            b += '1'        # Build C++ library.
            if have_swig:
                b += '2'    # Build SWIG-generated source.
            b += '3'        # Build SWIG library _mupdf.so.
        else:
            # Not an sdist so can't rely on pre-build C++ source etc, so build
            # everything.
            #
            log(f'Building with "-b all" because we do not appear to be in an sdist')
            b = 'all'
        command = f'cd {mupdf_dir} && ./scripts/mupdfwrap.py -d {build_dir} -b {b}'

    elif mupdf_build == '0':
        command = None

    else:
        log(f'build(): Building by copying files from {mupdf_build} into {build_dir}/')
        command = f'mkdir -p {build_dir}'
        for n in out_names:
            command += f' && rsync -ai {mupdf_build}/{n} {build_dir}/'

    if command:
        log(f'build(): Building MuPDF C, C++ and Python libraries with: {command}')
        subprocess.check_call(command, shell=True)
    else:
        log(f'build(): Not building mupdf because mupdf_build={mupdf_build}')

    paths = []
    for name in out_names:
        path = f'{mupdf_dir}/{build_dir}/{name}'
        paths.append((path, name))
    log(f'build(): returning: {paths}')
    return paths

def clean(all_):
    if all_:
        subprocess.check_call('(rm -r build || true)', shell=True)
    else:
        subprocess.check_call(f'(rm -r {build_dir} || true)', shell=True)

mupdf_package = pipcl.Package(
        name = 'mupdf',
        version = mupdf_version(),
        summary = 'Python bindings for MuPDF library',
        description = 'Python bindings for MuPDF library',
        classifiers = [
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'License :: OSI Approved :: GNU Affero General Public License v3',
                'Programming Language :: Python :: 3',
                ],
        author = 'Artifex Software, Inc',
        author_email = 'support@artifex.com',
        url_docs = 'https://twiki.ghostscript.com/do/view/Main/MuPDFWrap/',
        url_home = 'https://mupdf.com/',
        url_source = 'https://git.ghostscript.com/?p=mupdf.git',
        url_tracker = 'https://bugs.ghostscript.com/',
        keywords = 'PDF',
        platform = None,
        license_files = ['COPYING'],
        fn_build = build,
        fn_clean = clean,
        fn_sdist = sdist,
        )

#log(f'mupdf_package={mupdf_package}')

# Things to allow us to function as a PIP-517 backend:
#
def build_wheel( wheel_directory, config_settings=None, metadata_directory=None):
    return mupdf_package.build_wheel(
            wheel_directory,
            config_settings,
            metadata_directory,
            )

def build_sdist( sdist_directory, config_settings=None):
    return mupdf_package.build_sdist(
            sdist_directory,
            config_settings,
            )

# Allow us to be used as a pre-PIP-517 setup.py script.
#
if __name__ == '__main__':
    mupdf_package.handle_argv(sys.argv)
<commit_msg>setup.py: added support for building on windows.<commit_after>#!/usr/bin/env python3

'''
Installation script for MuPDF Python bindings, using scripts/pipcl.py.

Notes:

    When building an sdist (e.g. with 'pip sdist'), we use clang-python to
    generate C++ source which is then included in the sdist.

    Thus when we are in an sdist and are installing or building a wheel, we
    don't need clang-python .

Internal testing only - environmental variables:

    MUPDF_SETUP_BUILD_DIR
        Overrides the default build directory.

    MUPDF_SETUP_USE_CLANG_PYTHON
        Affects whether we use clang-python when building.

        If set, must be '0' or '1', and we override the default and do not
        ('0') / do ('1') use clang-python to generate C++ source code from
        MuPDF headers.

        If we are an sdist we default to not re-generating C++ - the generated
        files will be already available in platform/c++/. Otherwise we default
        to generating C++ source code.

    MUPDF_SETUP_USE_SWIG
        If set, must be '0' or '1', and we do not ('0') / do ('1') attempt to
        run swig.
'''

import os
import platform
import re
import subprocess
import sys
import sys
import time

def log(text=''):
    for line in text.split('\n'):
        print(f'mupdf:setup.py: {line}')
    sys.stdout.flush()

def cache(function):
    '''
    Simple (and probably unnecessary) caching decorator.
    '''
    cache = {}
    def wrapper(*args):
        if not args in cache:
            cache[args] = function()
        return cache[args]
    return wrapper

@cache
def root_dir():
    return os.path.dirname(os.path.abspath(__file__))

@cache
def windows():
    s = platform.system()
    return s == 'Windows' or s.startswith('CYGWIN')

@cache
def build_dir():
    # This is x86/x64-specific.
    #
    # We generate 32 or 64-bit binaries to match whatever Python we
    # are running under.
    #
    ret = os.environ.get('MUPDF_SETUP_BUILD_DIR')
    if ret is None:
        cpu = 'x32' if sys.maxsize == 2**31 - 1 else 'x64'
        python_version = '.'.join(platform.python_version().split('.')[:2])
        ret = f'{root_dir()}/build/shared-release-{cpu}-py{python_version}'
    return ret

@cache
def in_sdist():
    return os.path.exists(f'{root_dir()}/PKG-INFO')

sys.path.append(f'{root_dir()}/scripts')
import pipcl

@cache
def mupdf_version():
    '''
    Returns version string.

    If $MUPDF_SETUP_VERSION is set we use it directly, asserting that it starts
    with the version string defined in include/mupdf/fitz/version.h.

    Otherwise if we are in an sdist ('PKG-INFO' exists) we use its
    version. We assert that this starts with the base version in
    include/mupdf/fitz/version.h.

    Otherwise we generate a version string by appending the current date and
    time to the base version in include/mupdf/fitz/version.h. For example
    '1.18.0.20210330.1800'.
    '''
    with open(f'{root_dir()}/include/mupdf/fitz/version.h') as f:
        text = f.read()
    m = re.search('\n#define FZ_VERSION "([^"]+)"\n', text)
    assert m
    base_version = m.group(1)

    # If MUPDF_SETUP_VERSION exists, use it.
    #
    ret = os.environ.get('MUPDF_SETUP_VERSION')
    if ret:
        log(f'Using version from $MUPDF_SETUP_VERSION: {ret}')
        assert ret.startswith(base_version)
        return ret

    # If we are in an sdist, so use the version from the PKG-INFO file.
    #
    if in_sdist():
        items = pipcl.parse_pkg_info('PKG-INFO')
        assert items['Name'] == 'mupdf'
        ret = items['Version']
        #log(f'Using version from PKG-INFO: {ret}')
        assert ret.startswith(base_version)
        return ret

    # If we get here, we are in a source tree.
    #
    # We use the MuPDF version with a unique(ish) suffix based on the current
    # date and time, so we can make multiple Python releases without requiring
    # an increment to the MuPDF version.
    #
    # This also allows us to easily experiment on test.pypi.org.
    #
    ret = base_version + time.strftime(".%Y%m%d.%H%M")
    #log(f'Have created version number: {ret}')
    return ret

# Set MUPDF_SETUP_MINIMAL=1 to create minimal package for testing
# upload/download etc, avoiding compilation when installing.
#
g_test_minimal = int(os.environ.get('MUPDF_SETUP_MINIMAL', '0'))

def git_info():
    '''
    Returns (current, origin, diff):
        current: git id from 'git show'.
        origin: git id from 'git show origin'.
        diff: diff relative to current.
    '''
    def get_id(command):
        text = subprocess.check_output(command, shell=True, cwd=root_dir())
        text = text.decode('utf8')
        text = text.split('\n', 1)[0]
        text = text.split(' ', 1)[0]
        return text
    current = get_id('git show --pretty=oneline')
    origin = get_id('git show --pretty=oneline origin')
    command = ''
    diff = subprocess.check_output(f'cd {root_dir()} && git diff', shell=True).decode('utf8')
    return current, origin, diff

def get_flag(name, default):
    '''
    name:
        Name of environmental variable.
    default:
        Value to return if <name> undefined.
    Returns False if name is '0', True if name is '1', <default> if
    undefined. Otherwise assert fails.
    '''
    value = os.environ.get(name)
    if value is None:
        ret = default
    elif value == '0':
        ret = False
    elif value == '1':
        ret = True
    else:
        assert 0, f'If set, ${name} must be "0" or "1", but is: {value!r}'
    log(f'name={name} default={default} value={value} ret={ret}')
    return ret

# pipcl Callbacks.
#

def sdist():
    '''
    pipcl callback. If we are a git checkout, return all files known to
    git. Otherwise return all files except for those in build/.
    '''
    # Create 'git-info' file containing git ids that identify this tree. For
    # the moment this is a simple text format, but we could possibly use pickle
    # instead, depending on whether we want to include more information, e.g.
    # diff relative to origin.
    #
    git_id, git_id_origin, git_diff = git_info()
    with open(f'{root_dir()}/git-info', 'w') as f:
        f.write(f'git-id: {git_id}\n')
        f.write(f'git-id-origin: {git_id_origin}\n')
        f.write(f'git-diff:\n{git_diff}\n')

    if g_test_minimal:
        # Cut-down for testing.
        return [
                'setup.py',
                'pyproject.toml',
                'scripts/pipcl.py',
                'include/mupdf/fitz/version.h',
                'COPYING',
                'git-info',
                ]

    if not os.path.exists(f'{root_dir()}/.git'):
        raise Exception(f'Cannot make sdist because not a git checkout')
    paths = pipcl.git_items( root_dir(), submodules=True)

    # Build C++ files and SWIG C code for inclusion in sdist, so that it can be
    # used on systems without clang-python or SWIG.
    #
    use_clang_python = get_flag('MUPDF_SETUP_USE_CLANG_PYTHON', True)
    use_swig = get_flag('MUPDF_SETUP_USE_SWIG', True)
    b = ''
    if use_clang_python:
        b += '0'
    if use_swig:
        b += '2'
    extra = ' --swig-windows-auto' if windows() else ''
    command = '' if os.getcwd() == root_dir() else f'cd {os.path.relpath(root_dir())} && '
    command += f'{sys.executable} ./scripts/mupdfwrap.py{extra} -d {build_dir()} -b "{b}"'
    log(f'Running: {command}')
    subprocess.check_call(command, shell=True)
    paths += [
            'build/shared-release/mupdf.py',
            'git-info',
            'platform/c++/c_functions.pickle',
            'platform/c++/c_globals.pickle',
            'platform/c++/container_classnames.pickle',
            'platform/c++/implementation/classes.cpp',
            'platform/c++/implementation/exceptions.cpp',
            'platform/c++/implementation/functions.cpp',
            'platform/c++/implementation/internal.cpp',
            'platform/c++/include/mupdf/classes.h',
            'platform/c++/include/mupdf/exceptions.h',
            'platform/c++/include/mupdf/functions.h',
            'platform/c++/include/mupdf/internal.h',
            'platform/c++/swig_c.pickle',
            'platform/c++/swig_python.pickle',
            'platform/c++/to_string_structnames.pickle',
            'platform/c++/windows_mupdf.def',
            'platform/python/mupdfcpp_swig.cpp',
            ]
    return paths

def build():
    '''
    pipcl callback. Build MuPDF C, C++ and Python libraries.
    '''
    if g_test_minimal:
        # Cut-down for testing.
        log(f'g_test_minimal set so doing minimal build.')
        os.makedirs(f'{root_dir()}/{build_dir()}', exist_ok=True)
        paths = (
                f'{root_dir()}/{build_dir()}/mupdf.py',
                f'{root_dir()}/{build_dir()}/_mupdf.pyd',
                f'{root_dir()}/{build_dir()}/mupdfcpp.dll',
                )
        ret = []
        for path in paths:
            with open(path, 'w') as f:
                # Need to make files non-identical, otherwise
                # check-wheel-contents complains.
                f.write(f'{path}\n')
            ret.append( (path, os.path.basename(path)))
        return ret

    # If we are an sdist, default to not trying to run clang-python - the
    # generated files will already exist, and installing/using clang-python
    # might be tricky.
    #
    use_clang_python = get_flag('MUPDF_SETUP_USE_CLANG_PYTHON', not in_sdist())
    use_swig = get_flag('MUPDF_SETUP_USE_SWIG', True)

    b = ''
    if not windows():
        b = 'm'     # Build C library.
    if use_clang_python:
        b += '0'    # Build C++ source.
    b += '1'        # Build C++ library (also contains C library on Windows).
    if use_swig:
        b += '2'    # Build SWIG-generated source.
    b += '3'        # Build SWIG library _mupdf.so.

    command = '' if root_dir() == os.getcwd() else f'cd {os.path.relpath(root_dir())} && '
    command += (
            f'"{sys.executable}" ./scripts/mupdfwrap.py'
            f'{" --swig-windows-auto" if windows() else ""}'
            f' -d {build_dir()}'
            f' -b {b}'
            )

    do_build = os.environ.get('MUPDF_SETUP_DO_BUILD')
    if do_build == '0':
        # This is a hack for testing.
        log(f'Not doing build because $MUPDF_SETUP_DO_BUILD={do_build}')
    else:
        log(f'build(): Building MuPDF C, C++ and Python libraries with: {command}')
        subprocess.check_call(command, shell=True)

    # Return generated files to install or copy into wheel.
    #
    if windows():
        infix = '' if sys.maxsize == 2**31 - 1 else '64'
        names = [
                f'mupdfcpp{infix}.dll', # C and C++.
                '_mupdf.pyd',           # Python internals.
                'mupdf.py',             # Python.
                ]
    else:
        names = [
                'libmupdf.so',      # C.
                'libmupdfcpp.so',   # C++.
                '_mupdf.so',        # Python internals.
                'mupdf.py',         # Python.
                ]
    paths = []
    for name in names:
        paths.append((f'{build_dir()}/{name}', name))

    log(f'build(): returning: {paths}')
    return paths

def clean(all_):
    if all_:
        return [
                'build',
                'platform/win32/Release',
                'platform/win32/ReleaseDLL',
                'platform/win32/Win32',
                'platform/win32/x64',
                ]
    else:
        # Ideally we would return selected directories in platform/win32/ if on
        # Windows, but that would get a little involved.
        #
        return build_dir()

# Setup pipcl.
#
description = """
Summary
-------

* Python bindings for the MuPDF PDF library.
* A python module called ``mupdf``.
* Generated from the MuPDF C++ API, which is itself generated from the MuPDF C API.
* Provides Python functions that wrap most ``fz_`` and ``pdf_`` functions.
* Provides Python classes that wrap most ``fz_`` and ``pdf_`` structs.

  * Class methods provide access to most of the underlying C API functions (except for functions that don't take struct args such as ``fz_strlcpy()``).
* MuPDF's ``setjmp``/``longjmp`` exceptions are converted to Python exceptions.
* Functions and methods do not take ``fz_context`` arguments. (Automatically-generated per-thread contexts are used internally.)
* Wrapper classes automatically handle reference counting of the underlying structs (with internal calls to ``fz_keep_*()`` and ``fz_drop_*()``).
* Provides a small number of extensions beyond the basic C API:

  * Some generated classes have extra support for iteration.
  * Some custom class methods and constructors.
  * Simple 'POD' structs have ``__str__()`` methods, for example ``mupdf.Rect`` is represented like: ``(x0=90.51 y0=160.65 x1=501.39 y1=215.6)``.

Example usage
-------------

Minimal Python code that uses the ``mupdf`` module:

::

    import mupdf
    document = mupdf.Document('foo.pdf')

A simple example Python test script (run by ``scripts/mupdfwrap.py -t``) is:

* ``scripts/mupdfwrap_test.py``

More detailed usage of the Python API can be found in:

* ``scripts/mutool.py``
* ``scripts/mutool_draw.py``

Here is some example code that shows all available information about document's Stext blocks, lines and characters:

::

    #!/usr/bin/env python3

    import mupdf

    def show_stext(document):
        '''
        Shows all available information about Stext blocks, lines and characters.
        '''
        for p in range(document.count_pages()):
            page = document.load_page(p)
            stextpage = mupdf.StextPage(page, mupdf.StextOptions())
            for block in stextpage:
                block_ = block.m_internal
                log(f'block: type={block_.type} bbox={block_.bbox}')
                for line in block:
                    line_ = line.m_internal
                    log(f'    line: wmode={line_.wmode}'
                            + f' dir={line_.dir}'
                            + f' bbox={line_.bbox}'
                            )
                    for char in line:
                        char_ = char.m_internal
                        log(f'        char: {chr(char_.c)!r} c={char_.c:4} color={char_.color}'
                                + f' origin={char_.origin}'
                                + f' quad={char_.quad}'
                                + f' size={char_.size:6.2f}'
                                + f' font=('
                                    +  f'is_mono={char_.font.flags.is_mono}'
                                    + f' is_bold={char_.font.flags.is_bold}'
                                    + f' is_italic={char_.font.flags.is_italic}'
                                    + f' ft_substitute={char_.font.flags.ft_substitute}'
                                    + f' ft_stretch={char_.font.flags.ft_stretch}'
                                    + f' fake_bold={char_.font.flags.fake_bold}'
                                    + f' fake_italic={char_.font.flags.fake_italic}'
                                    + f' has_opentype={char_.font.flags.has_opentype}'
                                    + f' invalid_bbox={char_.font.flags.invalid_bbox}'
                                    + f' name={char_.font.name}'
                                    + f')'
                                )

    document = mupdf.Document('foo.pdf')
    show_stext(document)

More information
----------------

https://twiki.ghostscript.com/do/view/Main/MuPDFWrap

"""

mupdf_package = pipcl.Package(
        name = 'mupdf',
        version = mupdf_version(),
        root = root_dir(),
        summary = 'Python bindings for MuPDF library.',
        description = description,
        classifiers = [
                'Development Status :: 4 - Beta',
                'Intended Audience :: Developers',
                'License :: OSI Approved :: GNU Affero General Public License v3',
                'Programming Language :: Python :: 3',
                ],
        author = 'Artifex Software, Inc.',
        author_email = 'support@artifex.com',
        url_docs = 'https://twiki.ghostscript.com/do/view/Main/MuPDFWrap/',
        url_home = 'https://mupdf.com/',
        url_source = 'https://git.ghostscript.com/?p=mupdf.git',
        url_tracker = 'https://bugs.ghostscript.com/',
        keywords = 'PDF',
        platform = None,
        license_files = ['COPYING'],
        fn_build = build,
        fn_clean = clean,
        fn_sdist = sdist,
        )

# Things to allow us to function as a PIP-517 backend:
#
def build_wheel( wheel_directory, config_settings=None, metadata_directory=None):
    return mupdf_package.build_wheel(
            wheel_directory,
            config_settings,
            metadata_directory,
            )

def build_sdist( sdist_directory, config_settings=None):
    return mupdf_package.build_sdist(
            sdist_directory,
            config_settings,
            )

# Allow us to be used as a pre-PIP-517 setup.py script.
#
if __name__ == '__main__':
    mupdf_package.handle_argv(sys.argv)
<|endoftext|>


<commit_before># Copyright 2018 Google LLC
#
# 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 io
import os

import setuptools

# Package metadata.

name = 'google-api-core'
description = 'Google API client core library'
version = '1.1.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'googleapis-common-protos<2.0dev,>=1.5.3',
    'protobuf>=3.0.0',
    'google-auth<2.0.0dev,>=0.4.0',
    'requests<3.0.0dev,>=2.18.0',
    'setuptools>=34.0.0',
    'six>=1.10.0',
    'pytz',
]
extras = {
    'grpc': 'grpcio>=1.8.2',
    ':python_version < "3.2"': 'futures>=3.2.0',
}

# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)
<commit_msg>Use `install_requires` for platform dependencies instead of `extras_require` (#4991)<commit_after># Copyright 2018 Google LLC
#
# 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 io
import os

import setuptools

# Package metadata.

name = 'google-api-core'
description = 'Google API client core library'
version = '1.1.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'googleapis-common-protos<2.0dev,>=1.5.3',
    'protobuf>=3.0.0',
    'google-auth<2.0.0dev,>=0.4.0',
    'requests<3.0.0dev,>=2.18.0',
    'setuptools>=34.0.0',
    'six>=1.10.0',
    'pytz',
    'futures>=3.2.0;python_version<"3.2"'
]
extras = {
    'grpc': 'grpcio>=1.8.2'
}

# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)
<|endoftext|>


<commit_before>from setuptools import setup, Extension
from glob import glob
from distutils.command.build_ext import build_ext
from distutils.command.build_clib import build_clib

library = ('primesieve', dict(
    sources=glob("lib/primesieve/src/primesieve/*.cpp"),
    include_dirs=["lib/primesieve/include"],
    language="c++",
    ))

if glob("primesieve/*.pyx"):
    from Cython.Build import cythonize
else:
    # fallback to compiled cpp
    cythonize = None

extensions = []

extensions.append(Extension(
        "primesieve.core",
        ["primesieve/core.pyx"] if cythonize else ["primesieve/core.cpp"],
        include_dirs=["lib/primesieve/include"],
        language="c++",
        ))

def is_pypy():
    import platform
    try:
        if platform.python_implementation() == 'PyPy':
            return True
    except AttributeError:
        pass
    return False

def can_import(module_name):
    """can_import(module_name) -> module or None"""
    try:
        return __import__(module_name)
    except ImportError:
        return None

def is_Numpy_installed():
    if is_pypy():
        return False
    return bool(can_import("numpy"))

# Add primesieve.numpy extension if NumPy is installed
if is_Numpy_installed():
    import numpy
    numpy_include_dir = numpy.get_include()
    extensions.append(Extension(
        "primesieve.numpy.core",
        ["primesieve/numpy/core.pyx"] if cythonize else ["primesieve/numpy/core.cpp"],
        include_dirs=["lib/primesieve/include", numpy_include_dir],
        language="c++",
        ))

ext_modules = cythonize(extensions) if cythonize else [extensions]

def old_msvc(compiler):
    """Test whether compiler is msvc <= 9.0"""
    return compiler.compiler_type == "msvc" and hasattr(compiler, "_MSVCCompiler__version") and int(compiler._MSVCCompiler__version) <= 9

class build_clib_subclass(build_clib):
    """Workaround to add msvc_compat (stdint.h) for old msvc versions"""
    def build_libraries(self, libraries):
        if old_msvc(self.compiler):
            for lib_name, build_info in libraries:
                build_info['include_dirs'].append("lib/primesieve/src/msvc_compat")
                print(build_info)
        build_clib.build_libraries(self, libraries)

class build_ext_subclass(build_ext):
    """Workaround to add msvc_compat (stdint.h) for old msvc versions"""
    def build_extensions(self):
        if old_msvc(self.compiler):
            for e in self.extensions:
                e.include_dirs.append("lib/primesieve/src/msvc_compat")
        build_ext.build_extensions(self)

setup(
    name='primesieve',
    version="0.1.3",
    url = "https://github.com/hickford/primesieve-python",
    description="Fast prime number generator. Python bindings for primesieve C/C++ library",
    license = "MIT",
    libraries = [library],
    packages = ["primesieve", "primesieve.numpy"],
    ext_modules = ext_modules,
    cmdclass = {'build_ext': build_ext_subclass, 'build_clib' : build_clib_subclass},
    classifiers=[
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.6',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.2',
    'Programming Language :: Python :: 3.3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    ],
)
<commit_msg>Enable OpenMP if compiler supports it<commit_after>from setuptools import setup, Extension
from glob import glob
from distutils.command.build_ext import build_ext
from distutils.command.build_clib import build_clib
import os
import shutil
import subprocess
import tempfile

# If this C/C++ test program compiles the compiler supports OpenMP
# http://stackoverflow.com/questions/16549893/programatically-testing-for-openmp-support-from-a-python-setup-script
omp_test = \
    r"""
    #include <omp.h>
    #include <stdio.h>

    int main()
    {
        #pragma omp parallel
        printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
        return 0;
    }
    """

# Get the current compiler's OpenMP flag
def get_compiler_openmp_flag():
    openmp_flag = None
    tmpdir = tempfile.mkdtemp()
    curdir = os.getcwd()
    os.chdir(tmpdir)
    filename = r'omp_test.cpp'
    try:
        cxx = os.environ['CXX']
    except KeyError:
        cxx = 'c++'
    with open(filename, 'w', 0) as file:
        file.write(omp_test)

    # Compile test program using different OpenMP compiler flags
    with open(os.devnull, 'w') as fnull:
        exit_code = subprocess.call([cxx, '-fopenmp', filename], stdout=fnull, stderr=fnull)
        if exit_code == 0:
            openmp_flag = '-fopenmp'
        else:
            exit_code = subprocess.call([cxx, '-openmp', filename], stdout=fnull, stderr=fnull)
            if exit_code == 0:
                openmp_flag = '-openmp'
            else:
                exit_code = subprocess.call([cxx, '/openmp', filename], stdout=fnull, stderr=fnull)
                if exit_code == 0:
                    openmp_flag = '/openmp'

    print 'get_compiler_openmp_flag(): ', openmp_flag
    #clean up
    os.chdir(curdir)
    shutil.rmtree(tmpdir)
    return openmp_flag

openmp_flag = get_compiler_openmp_flag()

library = ('primesieve', dict(
    sources=glob("lib/primesieve/src/primesieve/*.cpp"),
    include_dirs=["lib/primesieve/include"],
    language="c++",
    extra_compile_args=openmp_flag,
    extra_link_args=openmp_flag
    ))

if glob("primesieve/*.pyx"):
    from Cython.Build import cythonize
else:
    # fallback to compiled cpp
    cythonize = None

extensions = []

extensions.append(Extension(
        "primesieve.core",
        ["primesieve/core.pyx"] if cythonize else ["primesieve/core.cpp"],
        include_dirs=["lib/primesieve/include"],
        language="c++",
        ))

def is_pypy():
    import platform
    try:
        if platform.python_implementation() == 'PyPy':
            return True
    except AttributeError:
        pass
    return False

def can_import(module_name):
    """can_import(module_name) -> module or None"""
    try:
        return __import__(module_name)
    except ImportError:
        return None

def is_Numpy_installed():
    if is_pypy():
        return False
    return bool(can_import("numpy"))

# Add primesieve.numpy extension if NumPy is installed
if is_Numpy_installed():
    import numpy
    numpy_include_dir = numpy.get_include()
    extensions.append(Extension(
        "primesieve.numpy.core",
        ["primesieve/numpy/core.pyx"] if cythonize else ["primesieve/numpy/core.cpp"],
        include_dirs=["lib/primesieve/include", numpy_include_dir],
        language="c++",
        ))

ext_modules = cythonize(extensions) if cythonize else [extensions]

def old_msvc(compiler):
    """Test whether compiler is msvc <= 9.0"""
    return compiler.compiler_type == "msvc" and hasattr(compiler, "_MSVCCompiler__version") and int(compiler._MSVCCompiler__version) <= 9

class build_clib_subclass(build_clib):
    """Workaround to add msvc_compat (stdint.h) for old msvc versions"""
    def build_libraries(self, libraries):
        if old_msvc(self.compiler):
            for lib_name, build_info in libraries:
                build_info['include_dirs'].append("lib/primesieve/src/msvc_compat")
                print(build_info)
        build_clib.build_libraries(self, libraries)

class build_ext_subclass(build_ext):
    """Workaround to add msvc_compat (stdint.h) for old msvc versions"""
    def build_extensions(self):
        if old_msvc(self.compiler):
            for e in self.extensions:
                e.include_dirs.append("lib/primesieve/src/msvc_compat")
        build_ext.build_extensions(self)

setup(
    name='primesieve',
    version="0.1.3",
    url = "https://github.com/hickford/primesieve-python",
    description="Fast prime number generator. Python bindings for primesieve C/C++ library",
    license = "MIT",
    libraries = [library],
    packages = ["primesieve", "primesieve.numpy"],
    ext_modules = ext_modules,
    cmdclass = {'build_ext': build_ext_subclass, 'build_clib' : build_clib_subclass},
    classifiers=[
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.6',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.2',
    'Programming Language :: Python :: 3.3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    ],
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(name='zipa',
      version='0.1.3',
      platforms='any',
      description='General purpose REST API client',
      author='Vlad Temian & Calin Don',
      author_email='vladtemian@gmail.com',
      url='https://github.com/vtemian/zipa',
      packages=['zipa'],
      include_package_data=True,
      install_requires=['requests'],
      classifiers=[
          'Programming Language :: Python :: 2.7',
      ])
<commit_msg>bump version<commit_after>from setuptools import setup

setup(name='zipa',
      version='0.1.4',
      platforms='any',
      description='General purpose REST API client',
      author='Vlad Temian & Calin Don',
      author_email='vladtemian@gmail.com',
      url='https://github.com/vtemian/zipa',
      packages=['zipa'],
      include_package_data=True,
      install_requires=['requests'],
      classifiers=[
          'Programming Language :: Python :: 2.7',
      ])
<|endoftext|>


<commit_before>
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages

exclude = ["forms_builder/example_project/dev.db",
           "forms_builder/example_project/local_settings.py"]
exclude = dict([(e, None) for e in exclude])
for e in exclude:
    if e.endswith(".py"):
        try:
            os.remove("%sc" % e)
        except:
            pass
    try:
        with open(e, "r") as f:
            exclude[e] = (f.read(), os.stat(e))
        os.remove(e)
    except Exception:
        pass

if sys.argv[:2] == ["setup.py", "bdist_wheel"]:
    # Remove previous build dir when creating a wheel build,
    # since if files have been removed from the project,
    # they'll still be cached in the build dir and end up
    # as part of the build, which is unexpected.
    try:
        rmtree("build")
    except:
        pass

try:
    setup(
        name = "django-forms-builder",
        version = __import__("forms_builder").__version__,
        author = "Stephen McDonald",
        author_email = "stephen.mc@gmail.com",
        description = ("A Django reusable app providing the ability for "
                       "admin users to create their own forms and report "
                       "on their collected data."),
        long_description = open("README.rst").read(),
        license = "BSD",
        url = "http://github.com/stephenmcd/django-forms-builder",
        zip_safe = False,
        include_package_data = True,
        packages = find_packages(),
        install_requires = [
            "sphinx-me >= 0.1.2",
            "unidecode",
            "django-email-extras >= 0.2",
            "django >= 1.8",
            "future <= 0.15.0",
        ],
        classifiers = [
            "Development Status :: 5 - Production/Stable",
            "Environment :: Web Environment",
            "Intended Audience :: Developers",
            "Operating System :: OS Independent",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.4",
            "Programming Language :: Python :: 3.5",
            "Framework :: Django",
            "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
            "Topic :: Internet :: WWW/HTTP :: Site Management",
        ]
    )
finally:
    for e in exclude:
        if exclude[e] is not None:
            data, stat = exclude[e]
            try:
                with open(e, "w") as f:
                    f.write(data)
                os.chown(e, stat.st_uid, stat.st_gid)
                os.chmod(e, stat.st_mode)
            except:
                pass
<commit_msg>Restrict to supported Django versions<commit_after>
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages

exclude = ["forms_builder/example_project/dev.db",
           "forms_builder/example_project/local_settings.py"]
exclude = dict([(e, None) for e in exclude])
for e in exclude:
    if e.endswith(".py"):
        try:
            os.remove("%sc" % e)
        except:
            pass
    try:
        with open(e, "r") as f:
            exclude[e] = (f.read(), os.stat(e))
        os.remove(e)
    except Exception:
        pass

if sys.argv[:2] == ["setup.py", "bdist_wheel"]:
    # Remove previous build dir when creating a wheel build,
    # since if files have been removed from the project,
    # they'll still be cached in the build dir and end up
    # as part of the build, which is unexpected.
    try:
        rmtree("build")
    except:
        pass

try:
    setup(
        name = "django-forms-builder",
        version = __import__("forms_builder").__version__,
        author = "Stephen McDonald",
        author_email = "stephen.mc@gmail.com",
        description = ("A Django reusable app providing the ability for "
                       "admin users to create their own forms and report "
                       "on their collected data."),
        long_description = open("README.rst").read(),
        license = "BSD",
        url = "http://github.com/stephenmcd/django-forms-builder",
        zip_safe = False,
        include_package_data = True,
        packages = find_packages(),
        install_requires = [
            "sphinx-me >= 0.1.2",
            "unidecode",
            "django-email-extras >= 0.2",
            "django >= 1.8, < 2.1",
            "future <= 0.15.0",
        ],
        classifiers = [
            "Development Status :: 5 - Production/Stable",
            "Environment :: Web Environment",
            "Intended Audience :: Developers",
            "Operating System :: OS Independent",
            "Programming Language :: Python",
            "Programming Language :: Python :: 2.7",
            "Programming Language :: Python :: 3",
            "Programming Language :: Python :: 3.4",
            "Programming Language :: Python :: 3.5",
            "Framework :: Django",
            "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
            "Topic :: Internet :: WWW/HTTP :: Site Management",
        ]
    )
finally:
    for e in exclude:
        if exclude[e] is not None:
            data, stat = exclude[e]
            try:
                with open(e, "w") as f:
                    f.write(data)
                os.chown(e, stat.st_uid, stat.st_gid)
                os.chmod(e, stat.st_mode)
            except:
                pass
<|endoftext|>


<commit_before>import codecs
from setuptools import setup

import wechatsogou

readme = codecs.open('docs/README.rst', encoding='utf-8').read()
history = codecs.open('docs/HISTORY.rst', encoding='utf-8').read()

setup(
    name='wechatsogou',
    version=wechatsogou.__version__,
    description='Api for wechat mp with sogou',
    long_description=u'\n\n'.join([readme, history]),
    author='Chyroc',
    author_email='chen_yunpeng@foxmail.com',
    url='https://github.com/Chyroc/WechatSogou',
    packages=[
        'wechatsogou',
    ],
    setup_requires=[
        # minimum version to use environment markers
        'setuptools>=20.6.8',
    ],
    install_requires=[
        'future', 'lxml', 'Pillow', 'requests', 'six', 'Werkzeug', 'xlrd'
    ],
    include_package_data=True,
    license='MIT License',
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7.12',
        'Programming Language :: Python :: 3.5.3',
        'Programming Language :: Python :: 3.6.1',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Programming Language :: Python :: Implementation :: CPython',
    ],
)
<commit_msg>fix setup python version name (#76)<commit_after>import codecs
from setuptools import setup

import wechatsogou

readme = codecs.open('docs/README.rst', encoding='utf-8').read()
history = codecs.open('docs/HISTORY.rst', encoding='utf-8').read()

setup(
    name='wechatsogou',
    version=wechatsogou.__version__,
    description='Api for wechat mp with sogou',
    long_description=u'\n\n'.join([readme, history]),
    author='Chyroc',
    author_email='chen_yunpeng@foxmail.com',
    url='https://github.com/Chyroc/WechatSogou',
    packages=[
        'wechatsogou',
    ],
    setup_requires=[
        # minimum version to use environment markers
        'setuptools>=20.6.8',
    ],
    install_requires=[
        'future', 'lxml', 'Pillow', 'requests', 'six', 'Werkzeug', 'xlrd'
    ],
    include_package_data=True,
    license='MIT License',
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Programming Language :: Python :: Implementation :: CPython',
    ],
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Hewlett Packard Enterprise Development LP
#
# 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 setuptools import setup, find_packages

def read(filename):
    """
    Read a file relative to setup.py location.
    """
    import os
    here = os.path.dirname(os.path.abspath(__file__))
    with open(os.path.join(here, filename)) as fd:
        return fd.read()

def find_version(filename):
    """
    Find package version in file.
    """
    import re
    content = read(filename)
    version_match = re.search(
        r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M
    )
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')

def find_requirements(filename):
    """
    Find requirements in file.
    """
    import string
    content = read(filename)
    requirements = []
    for line in content.splitlines():
        line = line.strip()
        if line and line[:1] in string.ascii_letters:
            requirements.append(line)
    return requirements

setup(
    name='topology_lib_systemctl',
    version=find_version('lib/topology_lib_systemctl/__init__.py'),
    package_dir={'': 'lib'},
    packages=find_packages('lib'),

    # Dependencies
    install_requires=find_requirements('requirements.txt'),

    # Metadata
    author='Hewlett Packard Enterprise Development LP',
    author_email='arman.kapbasov@hpe.com',
    description=(
        'Library for systemctl commands'
    ),
    long_description=read('README.rst'),
    url='https://github.com/HPENetworking/topology_lib_systemctl/tree/master/doc',
    keywords='topology_lib_systemctl',

    classifiers=[
    url=('https://github.com/HPENetworking/topology_lib_systemctl/tree\
 	/master/doc'),
    keywords='topology_lib_systemctl',
    keywords='topology_lib_systemctl',

	classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],

    # Entry points
    entry_points={
        'topology_library_10': [
            'systemctl = topology_lib_systemctl.library'
        ]
    }
)
<commit_msg>changes to setup.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Hewlett Packard Enterprise Development LP
#
# 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 setuptools import setup, find_packages

def read(filename):
    """
    Read a file relative to setup.py location.
    """
    import os
    here = os.path.dirname(os.path.abspath(__file__))
    with open(os.path.join(here, filename)) as fd:
        return fd.read()

def find_version(filename):
    """
    Find package version in file.
    """
    import re
    content = read(filename)
    version_match = re.search(
        r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M
    )
    if version_match:
        return version_match.group(1)
    raise RuntimeError('Unable to find version string.')

def find_requirements(filename):
    """
    Find requirements in file.
    """
    import string
    content = read(filename)
    requirements = []
    for line in content.splitlines():
        line = line.strip()
        if line and line[:1] in string.ascii_letters:
            requirements.append(line)
    return requirements

setup(
    name='topology_lib_systemctl',
    version=find_version('lib/topology_lib_systemctl/__init__.py'),
    package_dir={'': 'lib'},
    packages=find_packages('lib'),

    # Dependencies
    install_requires=find_requirements('requirements.txt'),

    # Metadata
    author='Hewlett Packard Enterprise Development LP',
    author_email='arman.kapbasov@hpe.com',
    description=(
        'Library for systemctl commands'
    ),
    long_description=read('README.rst'),
    url='https://github.com/HPENetworking/topology_lib_systemctl/tree/master/doc',
    keywords='topology_lib_systemctl',

    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],

    # Entry points
    entry_points={
        'topology_library_10': [
            'systemctl = topology_lib_systemctl.library'
        ]
    }
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(name='panphon',
      version='0.7',
      description='Tools for using the International Phonetic Alphabet with phonological features',
      url='https://github.com/dmort27/panphon',
      download_url='https://github.com/dmort27/panphon/tarball/0.7',
      author='David R. Mortensen',
      author_email='dmortens@cs.cmu.edu',
      license='MIT',
      install_requires=['setuptools',
                        'unicodecsv',
                        'PyYAML',
                        'regex',
                        'numpy',
                        'editdistance',
                        'munkres'],
      scripts=['panphon/bin/validate_ipa.py',
               'panphon/bin/align_wordlists.py',
               'panphon/bin/generate_ipa_all.py'],
      packages=['panphon'],
      package_dir={'panphon': 'panphon'},
      package_data={'panphon': ['data/*.csv', 'data/*.yml']},
      zip_safe=True,
      classifiers=['Operating System :: OS Independent',
                   'Programming Language :: Python :: 2',
                   'Programming Language :: Python :: 3',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                   'Topic :: Text Processing :: Linguistic']
      )
<commit_msg>Updated version<commit_after>from setuptools import setup

setup(name='panphon',
      version='0.8',
      description='Tools for using the International Phonetic Alphabet with phonological features',
      url='https://github.com/dmort27/panphon',
      download_url='https://github.com/dmort27/panphon/tarball/0.8',
      author='David R. Mortensen',
      author_email='dmortens@cs.cmu.edu',
      license='MIT',
      install_requires=['setuptools',
                        'unicodecsv',
                        'PyYAML',
                        'regex',
                        'numpy',
                        'editdistance',
                        'munkres'],
      scripts=['panphon/bin/validate_ipa.py',
               'panphon/bin/align_wordlists.py',
               'panphon/bin/generate_ipa_all.py'],
      packages=['panphon'],
      package_dir={'panphon': 'panphon'},
      package_data={'panphon': ['data/*.csv', 'data/*.yml']},
      zip_safe=True,
      classifiers=['Operating System :: OS Independent',
                   'Programming Language :: Python :: 2',
                   'Programming Language :: Python :: 3',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                   'Topic :: Text Processing :: Linguistic']
      )
<|endoftext|>


<commit_before>#!/usr/bin/env python

# Copyright (C) 2013-2014 SignalFuse, Inc. All rights reserved.
# Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved.

from setuptools import setup, find_packages

with open('signalfx/version.py') as f:
    exec(f.read())

with open('README.rst') as readme:
    long_description = readme.read()

test_requirements = ['httmock']

with open('requirements.txt') as f:
    requirements = [line.strip() for line in f.readlines()]

setup(
    name=name,  # noqa
    version=version,  # noqa
    author='SignalFx, Inc',
    author_email='info@signalfx.com',
    description='SignalFx Python Library',
    license='Apache Software License v2',
    long_description=long_description,
    zip_safe=True,
    packages=find_packages(),
    install_requires=requirements,
    tests_require=test_requirements,
    classifiers=[
        'Operating System :: OS Independent',
        'Programming Language :: Python',
    ],
    url='https://github.com/signalfx/signalfx-python',
)
<commit_msg>add python version classifiers to setup.py<commit_after>#!/usr/bin/env python

# Copyright (C) 2013-2014 SignalFuse, Inc. All rights reserved.
# Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved.

from setuptools import setup, find_packages

with open('signalfx/version.py') as f:
    exec(f.read())

with open('README.rst') as readme:
    long_description = readme.read()

test_requirements = ['httmock']

with open('requirements.txt') as f:
    requirements = [line.strip() for line in f.readlines()]

setup(
    name=name,  # noqa
    version=version,  # noqa
    author='SignalFx, Inc',
    author_email='info@signalfx.com',
    description='SignalFx Python Library',
    license='Apache Software License v2',
    long_description=long_description,
    zip_safe=True,
    packages=find_packages(),
    install_requires=requirements,
    tests_require=test_requirements,
    classifiers=[
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
    ],
    url='https://github.com/signalfx/signalfx-python',
)
<|endoftext|>


<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name = 'OpenFisca-France',
    version = '18.2.7',
    author = 'OpenFisca Team',
    author_email = 'contact@openfisca.fr',
    classifiers = [
        "Development Status :: 2 - Pre-Alpha",
        "License :: OSI Approved :: GNU Affero General Public License v3",
        "Operating System :: POSIX",
        "Programming Language :: Python",
        "Topic :: Scientific/Engineering :: Information Analysis",
        ],
    description = u'French tax and benefit system for OpenFisca',
    keywords = 'benefit france microsimulation social tax',
    license = 'http://www.fsf.org/licensing/licenses/agpl-3.0.html',
    url = 'https://github.com/openfisca/openfisca-france',

    data_files = [
        ('share/openfisca/openfisca-france', ['CHANGELOG.md', 'LICENSE.AGPL.txt', 'README.md']),
        ],
    extras_require = {
        'api': [
            'OpenFisca-Web-API >= 4.0.0, < 6.0',
            ],
        'inversion_revenus': [
            'scipy >= 0.17',
            ],
        'de_net_a_brut': [
            'scipy >= 0.17',
            ],
        'taxipp': [
            'pandas >= 0.13',
            ],
        'test': [
            'nose',
            'flake8',
            'scipy >= 0.17', # Only used to test de_net_a_brut reform
            ],
        },
    include_package_data = True,  # Will read MANIFEST.in
    install_requires = [
        'Biryani[datetimeconv] >= 0.10.4',
        'numpy >= 1.11',
        'OpenFisca-Core >= 12.1.1, < 13.0',
        'PyYAML >= 3.10',
        'requests >= 2.8',
        ],
    message_extractors = {'openfisca_france': [
        ('**.py', 'python', None),
        ]},
    packages = find_packages(exclude=['openfisca_france.tests*']),
    test_suite = 'nose.collector',
    )
<commit_msg>Upgrade core<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name = 'OpenFisca-France',
    version = '18.2.7',
    author = 'OpenFisca Team',
    author_email = 'contact@openfisca.fr',
    classifiers = [
        "Development Status :: 2 - Pre-Alpha",
        "License :: OSI Approved :: GNU Affero General Public License v3",
        "Operating System :: POSIX",
        "Programming Language :: Python",
        "Topic :: Scientific/Engineering :: Information Analysis",
        ],
    description = u'French tax and benefit system for OpenFisca',
    keywords = 'benefit france microsimulation social tax',
    license = 'http://www.fsf.org/licensing/licenses/agpl-3.0.html',
    url = 'https://github.com/openfisca/openfisca-france',

    data_files = [
        ('share/openfisca/openfisca-france', ['CHANGELOG.md', 'LICENSE.AGPL.txt', 'README.md']),
        ],
    extras_require = {
        'api': [
            'OpenFisca-Web-API >= 4.0.0, < 6.0',
            ],
        'inversion_revenus': [
            'scipy >= 0.17',
            ],
        'de_net_a_brut': [
            'scipy >= 0.17',
            ],
        'taxipp': [
            'pandas >= 0.13',
            ],
        'test': [
            'nose',
            'flake8',
            'scipy >= 0.17', # Only used to test de_net_a_brut reform
            ],
        },
    include_package_data = True,  # Will read MANIFEST.in
    install_requires = [
        'Biryani[datetimeconv] >= 0.10.4',
        'numpy >= 1.11',
        'OpenFisca-Core >= 12.2.0, < 13.0',
        'PyYAML >= 3.10',
        'requests >= 2.8',
        ],
    message_extractors = {'openfisca_france': [
        ('**.py', 'python', None),
        ]},
    packages = find_packages(exclude=['openfisca_france.tests*']),
    test_suite = 'nose.collector',
    )
<|endoftext|>


<commit_before>try:
    from setuptools import setup
    from setuptools import find_packages
    packages = find_packages()
except ImportError:
    from distutils.core import setup
    import os
    packages = [x.strip('./').replace('/','.') for x in os.popen('find -name "__init__.py" | xargs -n1 dirname').read().strip().split('\n')]

setup(
    name='cle',
    description='CLE Loads Everything (at least, may binary formats!) and provides a Pythonic interface to analyze what they are and what they would look like in memory.',
    version='6.7.3.26',
    packages=packages,
    install_requires=[ "pyelftools>=0.24", "cffi", "idalink", "archinfo", "pyvex", "pefile" ]
)
<commit_msg>ticked version number to 6.7.4.12<commit_after>try:
    from setuptools import setup
    from setuptools import find_packages
    packages = find_packages()
except ImportError:
    from distutils.core import setup
    import os
    packages = [x.strip('./').replace('/','.') for x in os.popen('find -name "__init__.py" | xargs -n1 dirname').read().strip().split('\n')]

setup(
    name='cle',
    description='CLE Loads Everything (at least, may binary formats!) and provides a Pythonic interface to analyze what they are and what they would look like in memory.',
    version='6.7.4.12',
    packages=packages,
    install_requires=[ "pyelftools>=0.24", "cffi", "idalink", "archinfo", "pyvex", "pefile" ]
)
<|endoftext|>


<commit_before>#!/usr/bin/env python

from setuptools import setup

setup(
    name="pantsmud",
    version="0.4.0",
    description="A simple MUD library built using the Pants networking framework.",
    author="ecdavis",
    author_email="me@ezdwt.com",
    url="http://github.com/ecdavis/pantsmud",
    download_url="https://github.com/ecdavis/pantsmud/tarball/master",
    packages=["pantsmud", "pantsmud.driver", "pantsmud.util"],
    install_requires=["pants >= 1.0"],
    tests_require=['mock'],
    classifiers=[
        "Programming Language :: Python :: 2.7",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
        "Environment :: Other Environment",
        "Intended Audience :: Developers",
        "Natural Language :: English"
    ]
)
<commit_msg>Bump version to 0.5.0<commit_after>#!/usr/bin/env python

from setuptools import setup

setup(
    name="pantsmud",
    version="0.5.0",
    description="A simple MUD library built using the Pants networking framework.",
    author="ecdavis",
    author_email="me@ezdwt.com",
    url="http://github.com/ecdavis/pantsmud",
    download_url="https://github.com/ecdavis/pantsmud/tarball/master",
    packages=["pantsmud", "pantsmud.driver", "pantsmud.util"],
    install_requires=["pants >= 1.0"],
    tests_require=['mock'],
    classifiers=[
        "Programming Language :: Python :: 2.7",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
        "Environment :: Other Environment",
        "Intended Audience :: Developers",
        "Natural Language :: English"
    ]
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#

import sys

if sys.version < '2.5':
    print 'Python 2.5+ required. Sorry :-('
    sys.exit(1)

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

setup(
    name = 'couchdb-auditor',
    version = '0.1',

    description = \
        'Audit configuration and security issues for an Apache CouchDB server.',
    long_description = \
        'Python port of Jason Smith https://github.com/iriscouch/audit_couchdb tool.',
    author = 'Alexander Shorin',
    author_email = 'kxepal@gmail.com',
    license = 'BSD',
    url = 'http://code.google.com/p/couchdb-auditor/',

    install_requires = ['couchdb'],
    entry_points = {
        'console_scripts': [
            'couchdb-auditor = couchdb_auditor:main',
        ],
    },

    packages = ['couchdb_auditor'],
)
<commit_msg>Version bump.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#

import sys

if sys.version < '2.5':
    print 'Python 2.5+ required. Sorry :-('
    sys.exit(1)

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

setup(
    name = 'couchdb-auditor',
    version = '0.2',

    description = \
        'Audit configuration and security issues for an Apache CouchDB server.',
    long_description = \
        'Python port of Jason Smith https://github.com/iriscouch/audit_couchdb tool.',
    author = 'Alexander Shorin',
    author_email = 'kxepal@gmail.com',
    license = 'BSD',
    url = 'http://code.google.com/p/couchdb-auditor/',

    install_requires = ['couchdb'],
    entry_points = {
        'console_scripts': [
            'couchdb-auditor = couchdb_auditor:main',
        ],
    },

    packages = ['couchdb_auditor'],
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(
    name = 'json2table',
    packages = ['json2table'],
    version = '1.0',
    description = 'Convert JSON to an HTML table',
    long_description=open('README.md').read(),
    author = 'Ryan Latture',
    author_email = 'ryan.latture@gmail.com',
    url = 'https://github.com/latture/json2table',
    download_url = 'https://github.com/latture/json2table/tarball/master',
    keywords = ['json', 'HTML', 'convert', 'table'],
    license = 'MIT',
    classifiers = (
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3'
        'License :: OSI Approved :: MIT License',
    ),
)
<commit_msg>Added missing comma between classifier items.<commit_after>from setuptools import setup

setup(
    name = 'json2table',
    packages = ['json2table'],
    version = '1.0',
    description = 'Convert JSON to an HTML table',
    long_description=open('README.md').read(),
    author = 'Ryan Latture',
    author_email = 'ryan.latture@gmail.com',
    url = 'https://github.com/latture/json2table',
    download_url = 'https://github.com/latture/json2table/tarball/master',
    keywords = ['json', 'HTML', 'convert', 'table'],
    license = 'MIT',
    classifiers = (
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
    ),
)
<|endoftext|>


<commit_before>"""
A Pretty Project Framework

Author: SF-Zhou
Date: 2016-09-21

See:
https://github.com/sf-zhou/prett
"""

from setuptools import setup, find_packages

setup(
    name='prett',
    version='0.0.1',
    description='A Pretty Project Framework',

    url='https://github.com/sf-zhou/prett',

    author='SF-Zhou',
    author_email='sfzhou.scut@gmail.com',

    license='MIT',
    classifiers=[
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',

        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],

    keywords='qt ui',
    packages=find_packages(exclude=['docs', 'tests']),
    install_requires=['PySide', 'typing']
)
<commit_msg>bump version<commit_after>"""
A Pretty Project Framework

Author: SF-Zhou
Date: 2016-09-21

See:
https://github.com/sf-zhou/prett
"""

from setuptools import setup, find_packages

setup(
    name='prett',
    version='0.0.2',
    description='A Pretty Project Framework',

    url='https://github.com/sf-zhou/prett',

    author='SF-Zhou',
    author_email='sfzhou.scut@gmail.com',

    license='MIT',
    classifiers=[
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',

        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],

    keywords='qt ui',
    packages=find_packages(exclude=['docs', 'tests']),
    install_requires=['PySide', 'typing']
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages

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

setup(
    name='crimg',
    version='0.0.1',
    description='Crop and resize an image without aspect ratio distortion.',
    long_description=readme,
    author='codeif',
    author_email='me@codeif.com',
    url='https://github.com/codeif/crimg',
    entry_points={
        'console_scripts': [
            'crimg = crimg.bin:main',
        ],
    },
    install_requires=['Pillow'],
    packages=find_packages(exclude=("tests", "tests.*")),
)
<commit_msg>setup.py add license<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages

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

setup(
    name='crimg',
    version='0.0.1',
    description='Crop and resize an image without aspect ratio distortion.',
    long_description=readme,
    author='codeif',
    author_email='me@codeif.com',
    url='https://github.com/codeif/crimg',
    license='MIT',
    entry_points={
        'console_scripts': [
            'crimg = crimg.bin:main',
        ],
    },
    install_requires=['Pillow'],
    packages=find_packages(exclude=("tests", "tests.*")),
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup

def reqs(filepath):
    with open(filepath) as stream:
        return [line.strip() for line in stream.readlines()]

setup(
    name='nameko-statsd',
    version='0.0.3',
    description='StatsD dependency for nameko services',
    author='Sohonet product team',
    author_email='fabrizio.romano@sohonet.com',
    url='https://github.com/sohonetlabs/nameko-statsd',
    packages=['nameko_statsd'],
    install_requires=reqs('requirements/base.txt'),
    extras_require={
        'dev': reqs('requirements/dev.txt'),
    },
    zip_safe=True,
    license='MIT',
    classifiers=[
        "Programming Language :: Python",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Topic :: Internet",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Intended Audience :: Developers",
    ]
)
<commit_msg>FR-1220-FR-1229: Bump version<commit_after>#!/usr/bin/env python
from setuptools import setup

def reqs(filepath):
    with open(filepath) as stream:
        return [line.strip() for line in stream.readlines()]

setup(
    name='nameko-statsd',
    version='0.0.4',
    description='StatsD dependency for nameko services',
    author='Sohonet product team',
    author_email='fabrizio.romano@sohonet.com',
    url='https://github.com/sohonetlabs/nameko-statsd',
    packages=['nameko_statsd'],
    install_requires=reqs('requirements/base.txt'),
    extras_require={
        'dev': reqs('requirements/dev.txt'),
    },
    zip_safe=True,
    license='MIT',
    classifiers=[
        "Programming Language :: Python",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Topic :: Internet",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Intended Audience :: Developers",
    ]
)
<|endoftext|>


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

import os
from setuptools import setup, find_packages

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

with open('docs/changelog.rst') as f:
    CHANGELOG = f.read()

# Load package meta from the pkgmeta module without loading the package.
pkgmeta = {}
pkgmeta_file = os.path.join(os.path.dirname(__file__), 'sigal', 'pkgmeta.py')
with open(pkgmeta_file) as f:
    code = compile(f.read(), 'pkgmeta.py', 'exec')
    exec(code, pkgmeta)

setup(
    name='sigal',
    version=pkgmeta['__version__'],
    url=pkgmeta['__url__'],
    license='MIT',
    author=pkgmeta['__author__'],
    author_email='contact@saimon.org',
    description='Simple static gallery generator',
    long_description=README + '\n' + CHANGELOG,
    packages=find_packages(exclude=['tests*']),
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    install_requires=['blinker', 'click', 'Jinja2', 'Markdown', 'Pillow',
                      'pilkit'],
    test_requires=['pytest'],
    extras_require={
        'CSS':  ['cssmin'],
        'S3': ['boto']
    },
    entry_points={
        'console_scripts': ['sigal = sigal:main']
    },
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Multimedia :: Graphics :: Viewers',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)
<commit_msg>Add keywords<commit_after># -*- coding:utf-8 -*-

import os
from setuptools import setup, find_packages

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

with open('docs/changelog.rst') as f:
    CHANGELOG = f.read()

# Load package meta from the pkgmeta module without loading the package.
pkgmeta = {}
pkgmeta_file = os.path.join(os.path.dirname(__file__), 'sigal', 'pkgmeta.py')
with open(pkgmeta_file) as f:
    code = compile(f.read(), 'pkgmeta.py', 'exec')
    exec(code, pkgmeta)

setup(
    name='sigal',
    version=pkgmeta['__version__'],
    url=pkgmeta['__url__'],
    license='MIT',
    author=pkgmeta['__author__'],
    author_email='contact@saimon.org',
    description='Simple static gallery generator',
    long_description=README + '\n' + CHANGELOG,
    packages=find_packages(exclude=['tests*']),
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    keywords=['gallery', 'static', 'generator', 'image', 'video', 'galleria'],
    install_requires=['blinker', 'click', 'Jinja2', 'Markdown', 'Pillow',
                      'pilkit'],
    test_requires=['pytest'],
    extras_require={
        'CSS':  ['cssmin'],
        'S3': ['boto']
    },
    entry_points={
        'console_scripts': ['sigal = sigal:main']
    },
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Multimedia :: Graphics :: Viewers',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
        name='ssbio',
        version='1.0.0a0',
        author='Nathan Mih',
        author_email='nmih@ucsd.edu',
        license='MIT',
        url='http://github.com/nmih/ssbio',
        description='Tools to enable structural systems biology',
        packages=find_packages(),
        package_dir={'ssbio': 'ssbio'},
        package_data={'ssbio': ['ssbio/etc/*']},
        scripts=['ssbio/structure/utils/cleanpdb.py',
                 'ssbio/sequence/properties/aggregation_propensity.py',
                 'ssbio/sequence/properties/thermostability.py',
                 'ssbio/structure/utils/mutatepdb.py',
                 'ssbio/structure/utils/tleap.py',
                 'ssbio/databases/drugbank.py',
                 'ssbio/structure/properties/msms.py'],
        long_description=open('README.md').read(),
        install_requires=required
)
<commit_msg>Change version<commit_after>from setuptools import setup, find_packages

with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
        name='ssbio',
        version='0.9.0',
        author='Nathan Mih',
        author_email='nmih@ucsd.edu',
        license='MIT',
        url='http://github.com/nmih/ssbio',
        description='Tools to enable structural systems biology',
        packages=find_packages(),
        package_dir={'ssbio': 'ssbio'},
        package_data={'ssbio': ['ssbio/etc/*']},
        scripts=['ssbio/structure/utils/cleanpdb.py',
                 'ssbio/sequence/properties/aggregation_propensity.py',
                 'ssbio/sequence/properties/thermostability.py',
                 'ssbio/structure/utils/mutatepdb.py',
                 'ssbio/structure/utils/tleap.py',
                 'ssbio/databases/drugbank.py',
                 'ssbio/structure/properties/msms.py'],
        long_description=open('README.md').read(),
        install_requires=required
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
import os
from setuptools import setup, find_packages

base = os.path.dirname(os.path.abspath(__file__))

README_PATH = os.path.join(base, "README.rst")

install_requires = ["packaging"]

tests_require = []

setup(
    name="vcver",
    version="0.2.0",
    description="provide package versions with version control data.",
    long_description=open(README_PATH).read(),
    author="Yusuke Tsutsumi",
    author_email="yusuke@tsutsumi.io",
    url="https://github.com/toumorokoshi/vcver-python",
    packages=find_packages(),
    install_requires=install_requires,
    classifiers=[
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS",
        "Operating System :: POSIX :: Linux",
        "Topic :: System :: Software Distribution",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.5",
    ],
    tests_require=tests_require,
    entry_points={
        "distutils.setup_keywords": ["vcver=vcver:setup_keywords_entry_point"]
    },
)
<commit_msg>Revving to 0.2.1<commit_after>#!/usr/bin/env python
import os
from setuptools import setup, find_packages

base = os.path.dirname(os.path.abspath(__file__))

README_PATH = os.path.join(base, "README.rst")

install_requires = ["packaging"]

tests_require = []

setup(
    name="vcver",
    version="0.2.1",
    description="provide package versions with version control data.",
    long_description=open(README_PATH).read(),
    author="Yusuke Tsutsumi",
    author_email="yusuke@tsutsumi.io",
    url="https://github.com/toumorokoshi/vcver-python",
    packages=find_packages(),
    install_requires=install_requires,
    classifiers=[
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS",
        "Operating System :: POSIX :: Linux",
        "Topic :: System :: Software Distribution",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.5",
    ],
    tests_require=tests_require,
    entry_points={
        "distutils.setup_keywords": ["vcver=vcver:setup_keywords_entry_point"]
    },
)
<|endoftext|>


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

import codecs

from setuptools import setup

with codecs.open('README.rst', encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='dbbrankingparser',
    version='0.1-dev',
    description='Extract league rankings from the DBB (Deutscher Basketball Bund e.V.) website.',
    long_description=long_description,
    url='http://homework.nwsnet.de/',
    author='Jochen Kupperschmidt',
    author_email='homework@nwsnet.de',
    license='MIT',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Other Audience',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Other/Nonlisted Topic',
    ],
    packages=['dbbrankingparser'],
    install_requires=['lxml>=3.4.0'],
    test_suite='tests',
)
<commit_msg>Set project-specific website URL.<commit_after># -*- coding: utf-8 -*-

import codecs

from setuptools import setup

with codecs.open('README.rst', encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='dbbrankingparser',
    version='0.1-dev',
    description='Extract league rankings from the DBB (Deutscher Basketball Bund e.V.) website.',
    long_description=long_description,
    url='http://homework.nwsnet.de/releases/4a51/#dbb-ranking-parser',
    author='Jochen Kupperschmidt',
    author_email='homework@nwsnet.de',
    license='MIT',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Other Audience',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Other/Nonlisted Topic',
    ],
    packages=['dbbrankingparser'],
    install_requires=['lxml>=3.4.0'],
    test_suite='tests',
)
<|endoftext|>


<commit_before>#!/bin/env python

from setuptools import setup

# Load module version from ovr/version.py
exec(open('src/openvr/version.py').read())

setup(
    name='openvr',
    version=__version__,
    author='Christopher Bruns and others',
    author_email='cmbruns@rotatingpenguin.com',
    description='Valve OpenVR SDK python bindings using ctypes',
    long_description='Valve OpenVR SDK python bindings using ctypes',
    url='https://github.com/cmbruns/pyopenvr',
    download_url='https://github.com/cmbruns/pyopenvr/tarball/' + __version__,
    package_dir={'': 'src'},
    packages=['openvr', 'openvr.glframework'],
    package_data={'openvr': ['*.dll', '*.so', '*.dylib']},
    keywords='openvr valve htc vive vr virtual reality 3d graphics',
    license='BSD',
    classifiers="""\
Environment :: Win32 (MS Windows)
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: Microsoft :: Windows
Operating System :: Microsoft :: Windows :: Windows 7
Operating System :: Microsoft :: Windows :: Windows 10
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Topic :: Multimedia :: Graphics :: 3D Rendering
Topic :: Scientific/Engineering :: Visualization
Development Status :: 4 - Beta
""".splitlines(),
    install_requires=[
        'numpy',
        'PyOpenGL',
    ],
    extras_require={
        'glfw': ['glfw'],
        'PyQt5': ['PyQt5'],
        #'PySide': ['PySide'], # does not support past python 3.5
        'wx': ['wxPython'],
    }
)
<commit_msg>fiddle with extras_require in setup.py<commit_after>#!/bin/env python

from setuptools import setup

# Load module version from ovr/version.py
exec(open('src/openvr/version.py').read())

setup(
    name='openvr',
    version=__version__,
    author='Christopher Bruns and others',
    author_email='cmbruns@rotatingpenguin.com',
    description='Valve OpenVR SDK python bindings using ctypes',
    long_description='Valve OpenVR SDK python bindings using ctypes',
    url='https://github.com/cmbruns/pyopenvr',
    download_url='https://github.com/cmbruns/pyopenvr/tarball/' + __version__,
    package_dir={'': 'src'},
    packages=['openvr', 'openvr.glframework'],
    package_data={'openvr': ['*.dll', '*.so', '*.dylib']},
    keywords='openvr valve htc vive vr virtual reality 3d graphics',
    license='BSD',
    classifiers="""\
Environment :: Win32 (MS Windows)
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: Microsoft :: Windows
Operating System :: Microsoft :: Windows :: Windows 7
Operating System :: Microsoft :: Windows :: Windows 10
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Topic :: Multimedia :: Graphics :: 3D Rendering
Topic :: Scientific/Engineering :: Visualization
Development Status :: 4 - Beta
""".splitlines(),
    install_requires=[],
    extras_require={
        'all': ['numpy', 'PyOpenGL', 'glfw', 'PyQt5', 'jinja2', 'wxPython'],
        'glfw': ['numpy', 'PyOpenGL', 'glfw'],
        'opengl': ['numpy', 'PyOpenGL'],
        'PyQt5': ['numpy', 'PyOpenGL', 'PyQt5', 'jinja2'],
        #'PySide': ['PySide'], # does not support past python 3.5
        'wx': ['numpy', 'PyOpenGL', 'wxPython'],
    }
)
<|endoftext|>