<commit_before># Copyright 2013-2016 DataStax, Inc.
#
# 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 __future__ import print_function
import os
import sys
import warnings

if __name__ == '__main__' and sys.argv[1] == "gevent_nosetests":
    print("Running gevent tests")
    from gevent.monkey import patch_all
    patch_all()

if __name__ == '__main__' and sys.argv[1] == "eventlet_nosetests":
    print("Running eventlet tests")
    from eventlet import monkey_patch
    monkey_patch()

import ez_setup
ez_setup.use_setuptools()

from setuptools import setup
from distutils.command.build_ext import build_ext
from distutils.core import Extension
from distutils.errors import (CCompilerError, DistutilsPlatformError,
                              DistutilsExecError)
from distutils.cmd import Command

PY3 = sys.version_info[0] == 3

try:
    import subprocess
    has_subprocess = True
except ImportError:
    has_subprocess = False

from cassandra import __version__

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

try:
    from nose.commands import nosetests
except ImportError:
    gevent_nosetests = None
    eventlet_nosetests = None
else:
    class gevent_nosetests(nosetests):
        description = "run nosetests with gevent monkey patching"

    class eventlet_nosetests(nosetests):
        description = "run nosetests with eventlet monkey patching"

has_cqlengine = False
if __name__ == '__main__' and sys.argv[1] == "install":
    try:
        import cqlengine
        has_cqlengine = True
    except ImportError:
        pass

PROFILING = False

class DocCommand(Command):

    description = "generate or test documentation"

    user_options = [("test", "t",
                     "run doctests instead of generating documentation")]

    boolean_options = ["test"]

    def initialize_options(self):
        self.test = False

    def finalize_options(self):
        pass

    def run(self):
        if self.test:
            path = "docs/_build/doctest"
            mode = "doctest"
        else:
            path = "docs/_build/%s" % __version__
            mode = "html"

            try:
                os.makedirs(path)
            except:
                pass

        if has_subprocess:
            # Prevent run with in-place extensions because cython-generated objects do not carry docstrings
            # http://docs.cython.org/src/userguide/special_methods.html#docstrings
            import glob
            for f in glob.glob("cassandra/*.so"):
                print("Removing '%s' to allow docs to run on pure python modules." %(f,))
                os.unlink(f)

            # Build io extension to make import and docstrings work
            try:
                output = subprocess.check_output(
                    ["python", "setup.py", "build_ext", "--inplace", "--force", "--no-murmur3", "--no-cython"],
                    stderr=subprocess.STDOUT)
            except subprocess.CalledProcessError as exc:
                raise RuntimeError("Documentation step '%s' failed: %s: %s" % ("build_ext", exc, exc.output))
            else:
                print(output)

            try:
                output = subprocess.check_output(
                    ["sphinx-build", "-b", mode, "docs", path],
                    stderr=subprocess.STDOUT)
            except subprocess.CalledProcessError as exc:
                raise RuntimeError("Documentation step '%s' failed: %s: %s" % (mode, exc, exc.output))
            else:
                print(output)

            print("")
            print("Documentation step '%s' performed, results here:" % mode)
            print("   file://%s/%s/index.html" % (os.path.dirname(os.path.realpath(__file__)), path))

class BuildFailed(Exception):

    def __init__(self, ext):
        self.ext = ext

murmur3_ext = Extension('cassandra.cmurmur3',
                        sources=['cassandra/cmurmur3.c'])

libev_ext = Extension('cassandra.io.libevwrapper',
                      sources=['cassandra/io/libevwrapper.c'],
                      include_dirs=['/usr/include/libev', '/usr/local/include', '/opt/local/include'],
                      libraries=['ev'],
                      library_dirs=['/usr/local/lib', '/opt/local/lib'])

platform_unsupported_msg = \
"""
===============================================================================
The optional C extensions are not supported on this platform.
===============================================================================
"""

arch_unsupported_msg = \
"""
===============================================================================
The optional C extensions are not supported on big-endian systems.
===============================================================================
"""

pypy_unsupported_msg = \
"""
=================================================================================
Some optional C extensions are not supported in PyPy. Only murmur3 will be built.
=================================================================================
"""

is_windows = os.name == 'nt'

is_pypy = "PyPy" in sys.version
if is_pypy:
    sys.stderr.write(pypy_unsupported_msg)

is_supported_platform = sys.platform != "cli" and not sys.platform.startswith("java")
is_supported_arch = sys.byteorder != "big"
if not is_supported_platform:
    sys.stderr.write(platform_unsupported_msg)
elif not is_supported_arch:
    sys.stderr.write(arch_unsupported_msg)

try_extensions = "--no-extensions" not in sys.argv and is_supported_platform and is_supported_arch and not os.environ.get('CASS_DRIVER_NO_EXTENSIONS')
try_murmur3 = try_extensions and "--no-murmur3" not in sys.argv
try_libev = try_extensions and "--no-libev" not in sys.argv and not is_pypy and not is_windows
try_cython = try_extensions and "--no-cython" not in sys.argv and not is_pypy and not os.environ.get('CASS_DRIVER_NO_CYTHON')
try_cython &= 'egg_info' not in sys.argv  # bypass setup_requires for pip egg_info calls, which will never have --install-option"--no-cython" coming fomr pip

sys.argv = [a for a in sys.argv if a not in ("--no-murmur3", "--no-libev", "--no-cython", "--no-extensions")]

build_concurrency = int(os.environ.get('CASS_DRIVER_BUILD_CONCURRENCY', '0'))

class NoPatchExtension(Extension):

    # Older versions of setuptools.extension has a static flag which is set False before our
    # setup_requires lands Cython. It causes our *.pyx sources to be renamed to *.c in
    # the initializer.
    # The other workaround would be to manually generate sources, but that bypasses a lot
    # of the niceness cythonize embodies (setup build dir, conditional build, etc).
    # Newer setuptools does not have this problem because it checks for cython dynamically.
    # https://bitbucket.org/pypa/setuptools/commits/714c3144e08fd01a9f61d1c88411e76d2538b2e4

    def __init__(self, *args, **kwargs):
        # bypass the patched init if possible
        if Extension.__bases__:
            base, = Extension.__bases__
            base.__init__(self, *args, **kwargs)
        else:
            Extension.__init__(self, *args, **kwargs)

class build_extensions(build_ext):

    error_message = """
===============================================================================
WARNING: could not compile %s.

The C extensions are not required for the driver to run, but they add support
for token-aware routing with the Murmur3Partitioner.

On Windows, make sure Visual Studio or an SDK is installed, and your environment
is configured to build for the appropriate architecture (matching your Python runtime).
This is often a matter of using vcvarsall.bat from your install directory, or running
from a command prompt in the Visual Studio Tools Start Menu.
===============================================================================
""" if is_windows else """
===============================================================================
WARNING: could not compile %s.

The C extensions are not required for the driver to run, but they add support
for libev and token-aware routing with the Murmur3Partitioner.

Linux users should ensure that GCC and the Python headers are available.

On Ubuntu and Debian, this can be accomplished by running:

    $ sudo apt-get install build-essential python-dev

On RedHat and RedHat-based systems like CentOS and Fedora:

    $ sudo yum install gcc python-devel

On OSX, homebrew installations of Python should provide the necessary headers.

libev Support
-------------
For libev support, you will also need to install libev and its headers.

On Debian/Ubuntu:

    $ sudo apt-get install libev4 libev-dev

On RHEL/CentOS/Fedora:

    $ sudo yum install libev libev-devel

On OSX, via homebrew:

    $ brew install libev

===============================================================================
    """

    def run(self):
        try:
            self._setup_extensions()
            build_ext.run(self)
        except DistutilsPlatformError as exc:
            sys.stderr.write('%s\n' % str(exc))
            warnings.warn(self.error_message % "C extensions.")

    def build_extensions(self):
        if build_concurrency > 1:
            self.check_extensions_list(self.extensions)

            import multiprocessing.pool
            multiprocessing.pool.ThreadPool(processes=build_concurrency).map(self.build_extension, self.extensions)
        else:
            build_ext.build_extensions(self)

    def build_extension(self, ext):
        try:
            build_ext.build_extension(self, ext)
        except (CCompilerError, DistutilsExecError,
                DistutilsPlatformError, IOError) as exc:
            sys.stderr.write('%s\n' % str(exc))
            name = "The %s extension" % (ext.name,)
            warnings.warn(self.error_message % (name,))

    def _setup_extensions(self):
        # We defer extension setup until this command to leveraage 'setup_requires' pulling in Cython before we
        # attempt to import anything
        self.extensions = []

        if try_murmur3:
            self.extensions.append(murmur3_ext)

        if try_libev:
            self.extensions.append(libev_ext)

        if try_cython:
            try:
                from Cython.Build import cythonize
                cython_candidates = ['cluster', 'concurrent', 'connection', 'cqltypes', 'metadata',
                                     'pool', 'protocol', 'query', 'util']
                compile_args = [] if is_windows else ['-Wno-unused-function']
                self.extensions.extend(cythonize(
                    [Extension('cassandra.%s' % m, ['cassandra/%s.py' % m],
                               extra_compile_args=compile_args)
                        for m in cython_candidates],
                    nthreads=build_concurrency,
                    exclude_failures=True))

                self.extensions.extend(cythonize(NoPatchExtension("*", ["cassandra/*.pyx"], extra_compile_args=compile_args),
                                                 nthreads=build_concurrency))
            except Exception:
                sys.stderr.write("Failed to cythonize one or more modules. These will not be compiled as extensions (optional).\n")

def run_setup(extensions):

    kw = {'cmdclass': {'doc': DocCommand}}
    if gevent_nosetests is not None:
        kw['cmdclass']['gevent_nosetests'] = gevent_nosetests

    if eventlet_nosetests is not None:
        kw['cmdclass']['eventlet_nosetests'] = eventlet_nosetests

    kw['cmdclass']['build_ext'] = build_extensions
    kw['ext_modules'] = [Extension('DUMMY', [])]  # dummy extension makes sure build_ext is called for install

    if try_cython:
        kw['setup_requires'] = ['Cython>=0.20']

    dependencies = ['six >=1.6']

    if not PY3:
        dependencies.append('futures')

    setup(
        name='cassandra-driver',
        version=__version__,
        description='Python driver for Cassandra',
        long_description=long_description,
        url='http://github.com/datastax/python-driver',
        author='Tyler Hobbs',
        author_email='tyler@datastax.com',
        packages=['cassandra', 'cassandra.io', 'cassandra.cqlengine'],
        keywords='cassandra,cql,orm',
        include_package_data=True,
        install_requires=dependencies,
        tests_require=['nose', 'mock<=1.0.1', 'PyYAML', 'pytz', 'sure'],
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: Apache Software License',
            'Natural Language :: English',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: Implementation :: CPython',
            'Programming Language :: Python :: Implementation :: PyPy',
            'Topic :: Software Development :: Libraries :: Python Modules'
        ],
        **kw)

run_setup(None)

if has_cqlengine:
    warnings.warn("\n#######\n'cqlengine' package is present on path: %s\n"
                  "cqlengine is now an integrated sub-package of this driver.\n"
                  "It is recommended to remove this package to reduce the chance for conflicting usage" % cqlengine.__file__)
<commit_msg>precheck compiler during setup PYTHON-471 avoids setup failure if we try to build Cython as a setup_requires and there are no build tools<commit_after># Copyright 2013-2016 DataStax, Inc.
#
# 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 __future__ import print_function
import os
import sys
import warnings

if __name__ == '__main__' and sys.argv[1] == "gevent_nosetests":
    print("Running gevent tests")
    from gevent.monkey import patch_all
    patch_all()

if __name__ == '__main__' and sys.argv[1] == "eventlet_nosetests":
    print("Running eventlet tests")
    from eventlet import monkey_patch
    monkey_patch()

import ez_setup
ez_setup.use_setuptools()

from setuptools import setup
from distutils.command.build_ext import build_ext
from distutils.core import Extension
from distutils.errors import (CCompilerError, DistutilsPlatformError,
                              DistutilsExecError)
from distutils.cmd import Command

PY3 = sys.version_info[0] == 3

try:
    import subprocess
    has_subprocess = True
except ImportError:
    has_subprocess = False

from cassandra import __version__

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

try:
    from nose.commands import nosetests
except ImportError:
    gevent_nosetests = None
    eventlet_nosetests = None
else:
    class gevent_nosetests(nosetests):
        description = "run nosetests with gevent monkey patching"

    class eventlet_nosetests(nosetests):
        description = "run nosetests with eventlet monkey patching"

has_cqlengine = False
if __name__ == '__main__' and sys.argv[1] == "install":
    try:
        import cqlengine
        has_cqlengine = True
    except ImportError:
        pass

PROFILING = False

class DocCommand(Command):

    description = "generate or test documentation"

    user_options = [("test", "t",
                     "run doctests instead of generating documentation")]

    boolean_options = ["test"]

    def initialize_options(self):
        self.test = False

    def finalize_options(self):
        pass

    def run(self):
        if self.test:
            path = "docs/_build/doctest"
            mode = "doctest"
        else:
            path = "docs/_build/%s" % __version__
            mode = "html"

            try:
                os.makedirs(path)
            except:
                pass

        if has_subprocess:
            # Prevent run with in-place extensions because cython-generated objects do not carry docstrings
            # http://docs.cython.org/src/userguide/special_methods.html#docstrings
            import glob
            for f in glob.glob("cassandra/*.so"):
                print("Removing '%s' to allow docs to run on pure python modules." %(f,))
                os.unlink(f)

            # Build io extension to make import and docstrings work
            try:
                output = subprocess.check_output(
                    ["python", "setup.py", "build_ext", "--inplace", "--force", "--no-murmur3", "--no-cython"],
                    stderr=subprocess.STDOUT)
            except subprocess.CalledProcessError as exc:
                raise RuntimeError("Documentation step '%s' failed: %s: %s" % ("build_ext", exc, exc.output))
            else:
                print(output)

            try:
                output = subprocess.check_output(
                    ["sphinx-build", "-b", mode, "docs", path],
                    stderr=subprocess.STDOUT)
            except subprocess.CalledProcessError as exc:
                raise RuntimeError("Documentation step '%s' failed: %s: %s" % (mode, exc, exc.output))
            else:
                print(output)

            print("")
            print("Documentation step '%s' performed, results here:" % mode)
            print("   file://%s/%s/index.html" % (os.path.dirname(os.path.realpath(__file__)), path))

class BuildFailed(Exception):

    def __init__(self, ext):
        self.ext = ext

murmur3_ext = Extension('cassandra.cmurmur3',
                        sources=['cassandra/cmurmur3.c'])

libev_ext = Extension('cassandra.io.libevwrapper',
                      sources=['cassandra/io/libevwrapper.c'],
                      include_dirs=['/usr/include/libev', '/usr/local/include', '/opt/local/include'],
                      libraries=['ev'],
                      library_dirs=['/usr/local/lib', '/opt/local/lib'])

platform_unsupported_msg = \
"""
===============================================================================
The optional C extensions are not supported on this platform.
===============================================================================
"""

arch_unsupported_msg = \
"""
===============================================================================
The optional C extensions are not supported on big-endian systems.
===============================================================================
"""

pypy_unsupported_msg = \
"""
=================================================================================
Some optional C extensions are not supported in PyPy. Only murmur3 will be built.
=================================================================================
"""

is_windows = os.name == 'nt'

is_pypy = "PyPy" in sys.version
if is_pypy:
    sys.stderr.write(pypy_unsupported_msg)

is_supported_platform = sys.platform != "cli" and not sys.platform.startswith("java")
is_supported_arch = sys.byteorder != "big"
if not is_supported_platform:
    sys.stderr.write(platform_unsupported_msg)
elif not is_supported_arch:
    sys.stderr.write(arch_unsupported_msg)

try_extensions = "--no-extensions" not in sys.argv and is_supported_platform and is_supported_arch and not os.environ.get('CASS_DRIVER_NO_EXTENSIONS')
try_murmur3 = try_extensions and "--no-murmur3" not in sys.argv
try_libev = try_extensions and "--no-libev" not in sys.argv and not is_pypy and not is_windows
try_cython = try_extensions and "--no-cython" not in sys.argv and not is_pypy and not os.environ.get('CASS_DRIVER_NO_CYTHON')
try_cython &= 'egg_info' not in sys.argv  # bypass setup_requires for pip egg_info calls, which will never have --install-option"--no-cython" coming fomr pip

sys.argv = [a for a in sys.argv if a not in ("--no-murmur3", "--no-libev", "--no-cython", "--no-extensions")]

build_concurrency = int(os.environ.get('CASS_DRIVER_BUILD_CONCURRENCY', '0'))

class NoPatchExtension(Extension):

    # Older versions of setuptools.extension has a static flag which is set False before our
    # setup_requires lands Cython. It causes our *.pyx sources to be renamed to *.c in
    # the initializer.
    # The other workaround would be to manually generate sources, but that bypasses a lot
    # of the niceness cythonize embodies (setup build dir, conditional build, etc).
    # Newer setuptools does not have this problem because it checks for cython dynamically.
    # https://bitbucket.org/pypa/setuptools/commits/714c3144e08fd01a9f61d1c88411e76d2538b2e4

    def __init__(self, *args, **kwargs):
        # bypass the patched init if possible
        if Extension.__bases__:
            base, = Extension.__bases__
            base.__init__(self, *args, **kwargs)
        else:
            Extension.__init__(self, *args, **kwargs)

class build_extensions(build_ext):

    error_message = """
===============================================================================
WARNING: could not compile %s.

The C extensions are not required for the driver to run, but they add support
for token-aware routing with the Murmur3Partitioner.

On Windows, make sure Visual Studio or an SDK is installed, and your environment
is configured to build for the appropriate architecture (matching your Python runtime).
This is often a matter of using vcvarsall.bat from your install directory, or running
from a command prompt in the Visual Studio Tools Start Menu.
===============================================================================
""" if is_windows else """
===============================================================================
WARNING: could not compile %s.

The C extensions are not required for the driver to run, but they add support
for libev and token-aware routing with the Murmur3Partitioner.

Linux users should ensure that GCC and the Python headers are available.

On Ubuntu and Debian, this can be accomplished by running:

    $ sudo apt-get install build-essential python-dev

On RedHat and RedHat-based systems like CentOS and Fedora:

    $ sudo yum install gcc python-devel

On OSX, homebrew installations of Python should provide the necessary headers.

libev Support
-------------
For libev support, you will also need to install libev and its headers.

On Debian/Ubuntu:

    $ sudo apt-get install libev4 libev-dev

On RHEL/CentOS/Fedora:

    $ sudo yum install libev libev-devel

On OSX, via homebrew:

    $ brew install libev

===============================================================================
    """

    def run(self):
        try:
            self._setup_extensions()
            build_ext.run(self)
        except DistutilsPlatformError as exc:
            sys.stderr.write('%s\n' % str(exc))
            warnings.warn(self.error_message % "C extensions.")

    def build_extensions(self):
        if build_concurrency > 1:
            self.check_extensions_list(self.extensions)

            import multiprocessing.pool
            multiprocessing.pool.ThreadPool(processes=build_concurrency).map(self.build_extension, self.extensions)
        else:
            build_ext.build_extensions(self)

    def build_extension(self, ext):
        try:
            build_ext.build_extension(self, ext)
        except (CCompilerError, DistutilsExecError,
                DistutilsPlatformError, IOError) as exc:
            sys.stderr.write('%s\n' % str(exc))
            name = "The %s extension" % (ext.name,)
            warnings.warn(self.error_message % (name,))

    def _setup_extensions(self):
        # We defer extension setup until this command to leveraage 'setup_requires' pulling in Cython before we
        # attempt to import anything
        self.extensions = []

        if try_murmur3:
            self.extensions.append(murmur3_ext)

        if try_libev:
            self.extensions.append(libev_ext)

        if try_cython:
            try:
                from Cython.Build import cythonize
                cython_candidates = ['cluster', 'concurrent', 'connection', 'cqltypes', 'metadata',
                                     'pool', 'protocol', 'query', 'util']
                compile_args = [] if is_windows else ['-Wno-unused-function']
                self.extensions.extend(cythonize(
                    [Extension('cassandra.%s' % m, ['cassandra/%s.py' % m],
                               extra_compile_args=compile_args)
                        for m in cython_candidates],
                    nthreads=build_concurrency,
                    exclude_failures=True))

                self.extensions.extend(cythonize(NoPatchExtension("*", ["cassandra/*.pyx"], extra_compile_args=compile_args),
                                                 nthreads=build_concurrency))
            except Exception:
                sys.stderr.write("Failed to cythonize one or more modules. These will not be compiled as extensions (optional).\n")

def precheck_compiler():
    """
    Try to verify build tools
    """
    try:
        from distutils.ccompiler import new_compiler
        from distutils.sysconfig import customize_compiler
        from distutils.dist import Distribution
        from distutils.spawn import find_executable

        # base build_ext just to emulate compiler option setup
        be = build_ext(Distribution())
        be.initialize_options()
        be.finalize_options()

        compiler = new_compiler(compiler=be.compiler)
        customize_compiler(compiler)
        if compiler.compiler_type in ('unix', 'cygwin'):
            return all(find_executable(compiler.executables[exe][0]) for exe in ('compiler_so', 'linker_so'))
        elif compiler.compiler_type == 'nt':
            return all(find_executable(getattr(compiler, exe)) for exe in ('cc', 'linker'))
    except Exception:
        raise
    # if we are unable to positively id the compiler type, or one of these assumptions fails,
    # just proceed as we would have without the check
    return True

def run_setup(extensions):

    kw = {'cmdclass': {'doc': DocCommand}}
    if gevent_nosetests is not None:
        kw['cmdclass']['gevent_nosetests'] = gevent_nosetests

    if eventlet_nosetests is not None:
        kw['cmdclass']['eventlet_nosetests'] = eventlet_nosetests

    kw['cmdclass']['build_ext'] = build_extensions
    kw['ext_modules'] = [Extension('DUMMY', [])]  # dummy extension makes sure build_ext is called for install

    # precheck compiler before adding to setup_requires
    # we don't actually negate try_cython because:
    # 1.) build_ext eats errors at compile time, letting the install complete while producing useful feedback
    # 2.) there could be a case where the python environment has cython installed but the system doesn't have build tools
    if try_cython and precheck_compiler():
        kw['setup_requires'] = ['Cython>=0.20']

    dependencies = ['six >=1.6']

    if not PY3:
        dependencies.append('futures')

    setup(
        name='cassandra-driver',
        version=__version__,
        description='Python driver for Cassandra',
        long_description=long_description,
        url='http://github.com/datastax/python-driver',
        author='Tyler Hobbs',
        author_email='tyler@datastax.com',
        packages=['cassandra', 'cassandra.io', 'cassandra.cqlengine'],
        keywords='cassandra,cql,orm',
        include_package_data=True,
        install_requires=dependencies,
        tests_require=['nose', 'mock<=1.0.1', 'PyYAML', 'pytz', 'sure'],
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: Apache Software License',
            'Natural Language :: English',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: Implementation :: CPython',
            'Programming Language :: Python :: Implementation :: PyPy',
            'Topic :: Software Development :: Libraries :: Python Modules'
        ],
        **kw)

run_setup(None)

if has_cqlengine:
    warnings.warn("\n#######\n'cqlengine' package is present on path: %s\n"
                  "cqlengine is now an integrated sub-package of this driver.\n"
                  "It is recommended to remove this package to reduce the chance for conflicting usage" % cqlengine.__file__)
<|endoftext|>


<commit_before>import os
from setuptools import setup, find_packages

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

def _read_long_description():
    try:
        import pypandoc
        return pypandoc.convert('README.md', 'rst')
    except ImportError:
        return None

setup(
    name="django-nopassword",
    version='1.3.1',
    url='http://github.com/relekang/django-nopassword',
    author='Rolf Erik Lekang',
    author_email='me@rolflekang.com',
    description='Authentication backend for django that uses a one time code instead of passwords',
    long_description=_read_long_description(),
    packages=find_packages(exclude='tests'),
    install_require=[
        'django>=1.4',
    ],
    tests_require=[
        'django>=1.4',
        'twilio==4.0.0',
        'mock>=1.0'
    ],
    license='MIT',
    test_suite='runtests.runtests',
    include_package_data=True,
    classifiers=[
        "Programming Language :: Python",
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Framework :: Django",
        "Environment :: Web Environment",
        "Operating System :: OS Independent",
        "Natural Language :: English",
    ]
)
<commit_msg>[requires.io] dependency update<commit_after>import os
from setuptools import setup, find_packages

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

def _read_long_description():
    try:
        import pypandoc
        return pypandoc.convert('README.md', 'rst')
    except ImportError:
        return None

setup(
    name="django-nopassword",
    version='1.3.1',
    url='http://github.com/relekang/django-nopassword',
    author='Rolf Erik Lekang',
    author_email='me@rolflekang.com',
    description='Authentication backend for django that uses a one time code instead of passwords',
    long_description=_read_long_description(),
    packages=find_packages(exclude='tests'),
    install_require=[
        'django>=1.4',
    ],
    tests_require=[
        'django>=1.4',
        'twilio==4.3.0',
        'mock>=1.0'
    ],
    license='MIT',
    test_suite='runtests.runtests',
    include_package_data=True,
    classifiers=[
        "Programming Language :: Python",
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Framework :: Django",
        "Environment :: Web Environment",
        "Operating System :: OS Independent",
        "Natural Language :: English",
    ]
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages
import os

ROOT = os.path.dirname(os.path.realpath(__file__))

setup(
    name='grab',
    version='0.6.33',
    description='Web Scraping Framework',
    long_description=open(os.path.join(ROOT, 'README.rst')).read(),
    url='http://grablib.org',
    author='Gregory Petukhov',
    author_email='lorien@lorien.name',

    packages=find_packages(exclude=['test', 'test.files']),
    install_requires=['weblib>=0.1.23', 'six',
                      'user_agent'],
    extras_require={
        'lxml': ['lxml', 'selection'],
        'pycurl': ['pycurl'],
        'urllib3': ['urllib3'],
        'full': ['lxml', 'selection', 'pycurl', 'urllib3'],
    },

    license='MIT',
    keywords='pycurl multicurl curl network parsing grabbing scraping'
             ' lxml xpath data mining',
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: Implementation :: CPython',
        'License :: OSI Approved :: MIT License',
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Internet :: WWW/HTTP',
    ],
)
<commit_msg>Update install_requies in setup.py<commit_after>from setuptools import setup, find_packages
import os

ROOT = os.path.dirname(os.path.realpath(__file__))

setup(
    name='grab',
    version='0.6.33',
    description='Web Scraping Framework',
    long_description=open(os.path.join(ROOT, 'README.rst')).read(),
    url='http://grablib.org',
    author='Gregory Petukhov',
    author_email='lorien@lorien.name',

    packages=find_packages(exclude=['test', 'test.files']),
    install_requires=[
        'weblib>=0.1.23',
        'six',
        'user_agent',
        'selection',
        'lxml;platform_system!="Windows"',
        'lxml;platform_system!="Windows"',
        'pycurl;platform_system!="Windows"',
    ],
    extras_require={
        'full': ['urllib3'],
    },

    license='MIT',
    keywords='pycurl multicurl curl network parsing grabbing scraping'
             ' lxml xpath data mining',
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: Implementation :: CPython',
        'License :: OSI Approved :: MIT License',
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Internet :: WWW/HTTP',
    ],
)
<|endoftext|>


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

version = '0.2.6'
here = os.path.abspath(os.path.dirname(__file__))
long_description = open(os.path.join(here, 'README.rst')).read()

setup(name='specloud',
      version=version,
      description="install nosetests and plugins to ease bdd unit specs",
      long_description=long_description,
      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
      keywords='test bdd nosetests spec unit',
      author='Hugo Lopes Tavares',
      author_email='hltbra@gmail.com',
      url='http://github.com/hugobr/specloud',
      license='MIT',
      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
      include_package_data=True,
      zip_safe=False,
      install_requires=[
          'nose',
          'pinocchio',
          'figleaf',
          # -*- Extra requirements: -*-
      ],
      entry_points="""
      # -*- Entry points: -*-
      [console_scripts]
      specloud = specloud:main
      """,
      )
<commit_msg>updated version<commit_after>from setuptools import setup, find_packages
import sys, os

version = '0.3'
here = os.path.abspath(os.path.dirname(__file__))
long_description = open(os.path.join(here, 'README.rst')).read()

setup(name='specloud',
      version=version,
      description="install nosetests and plugins to ease bdd unit specs",
      long_description=long_description,
      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
      keywords='test bdd nosetests spec unit',
      author='Hugo Lopes Tavares',
      author_email='hltbra@gmail.com',
      url='http://github.com/hugobr/specloud',
      license='MIT',
      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
      include_package_data=True,
      zip_safe=False,
      install_requires=[
          'nose',
          'pinocchio',
          'figleaf',
          # -*- Extra requirements: -*-
      ],
      entry_points="""
      # -*- Entry points: -*-
      [console_scripts]
      specloud = specloud:main
      """,
      )
<|endoftext|>


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

import os
import re
import sys
import sysconfig
import platform
import subprocess

from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.test import test as TestCommand
from setuptools.command.install_lib import install_lib
from setuptools.command.develop import develop
from distutils.version import LooseVersion

class CMakeExtension(Extension):
    def __init__(self, name, sourcedir=''):
        Extension.__init__(self, name, sources=[])
        self.sourcedir = os.path.abspath(sourcedir)

class CMakeBuild(build_ext):
    def run(self):
        try:
            out = subprocess.check_output(['cmake', '--version'])
        except OSError:
            raise RuntimeError("CMake must be installed to build the following extensions: " +
                               ", ".join(e.name for e in self.extensions))

        if platform.system() == "Windows":
            cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
            if cmake_version < '3.1.0':
                raise RuntimeError("CMake >= 3.1.0 is required on Windows")

        for ext in self.extensions:
            self.build_extension(ext)

    def build_extension(self, ext):
        self.debug = True
        extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
        cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
                      '-DPYTHON_EXECUTABLE=' + sys.executable]

        cfg = 'Debug' if self.debug else 'Release'
        build_args = ['--config', cfg, '--target', 'all']

        if platform.system() == "Windows":
            cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
            if sys.maxsize > 2**32:
                cmake_args += ['-A', 'x64']
            build_args += ['--', '/m']
        else:
            cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
            build_args += ['--', '-j2']

        env = os.environ.copy()
        env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
                                                              self.distribution.get_version())
        if not os.path.exists(self.build_temp):
            os.makedirs(self.build_temp)
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
        subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
        subprocess.check_call(['cp', './pinetree_test', '../pinetree_test'], cwd=self.build_temp)

class CustomInstall(install_lib):
    """Customized setuptools install command - prints a friendly greeting."""
    def run(self):
        print("Hello, developer, how are you? :)")
        # print(self.get_inputs())
        # print(self.install_scripts)
        install_lib.run(self)

class CustomDevelop(develop):
    """Customized setuptools install command - prints a friendly greeting."""
    def run(self):
        print("Hello, developer, how are you? :)")
        print(os.path.dirname(self.build_base))
        develop.run(self)

class CatchTestCommand(TestCommand):

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def distutils_dir_name(self, dname):
        """Returns the name of a distutils build directory"""
        f = "{dirname}.{platform}-{version[0]}.{version[1]}"
        return f.format(dirname=dname,
                        platform=sysconfig.get_platform(),
                        version=sys.version_info)

    def run(self):

        # Run ctest
        # subprocess.call(['make', 'test'], cwd=os.path.join('build', self.distutils_dir_name('temp')))

        subprocess.check_call(['pinetree_test'])
        print("\nC++ tests complete, now running Python tests...\n")

        # Run python unittest tests
        subprocess.check_call([sys.executable, '-m', 'unittest', 'discover', '--start-directory', 'tests'])

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

with open('LICENSE') as f:
    license = f.read()

setup(
    name='pinetree',
    version='0.0.1',
    description='a stochastic simulation of gene expression',
    long_description=readme,
    author='Benjamin Jack',
    author_email='benjamin.r.jack@gmail.com',
    url='https://github.com/benjaminjack/pysinthe',
    license=license,
    packages=['pinetree'],
    install_requires=['pyaml',
                      'voluptuous'],
    ext_modules=[CMakeExtension('pinetree/pinetree')],
    cmdclass=dict(install_lib=CustomInstall,
                  build_ext=CMakeBuild,
                  test=CatchTestCommand),
    zip_safe=False,
    scripts = ['bin/pinetree_run.py',
               'bin/pinetree_batch.py',
               'bin/parse_genbank.py'],
    data_files = [('bin', ['build/pinetree_test'])]
)
<commit_msg>more setup.py tweaks<commit_after>#! /usr/bin/env python3

import os
import re
import sys
import sysconfig
import platform
import subprocess

from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from setuptools.command.test import test as TestCommand
from setuptools.command.install import install
from setuptools.command.develop import develop
from distutils.version import LooseVersion

class CMakeExtension(Extension):
    def __init__(self, name, sourcedir=''):
        Extension.__init__(self, name, sources=[])
        self.sourcedir = os.path.abspath(sourcedir)

class CMakeBuild(build_ext):
    def run(self):
        try:
            out = subprocess.check_output(['cmake', '--version'])
        except OSError:
            raise RuntimeError("CMake must be installed to build the following extensions: " +
                               ", ".join(e.name for e in self.extensions))

        if platform.system() == "Windows":
            cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
            if cmake_version < '3.1.0':
                raise RuntimeError("CMake >= 3.1.0 is required on Windows")

        for ext in self.extensions:
            self.build_extension(ext)

    def build_extension(self, ext):
        self.debug = True
        extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
        cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
                      '-DPYTHON_EXECUTABLE=' + sys.executable]

        cfg = 'Debug' if self.debug else 'Release'
        build_args = ['--config', cfg, '--target', 'all']

        if platform.system() == "Windows":
            cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
            if sys.maxsize > 2**32:
                cmake_args += ['-A', 'x64']
            build_args += ['--', '/m']
        else:
            cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
            build_args += ['--', '-j2']

        env = os.environ.copy()
        env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
                                                              self.distribution.get_version())
        if not os.path.exists(self.build_temp):
            os.makedirs(self.build_temp)
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
        subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
        # Move test binary into lib.xxxx directory
        subprocess.check_call(['mv', './pinetree_test', extdir + '/'], cwd=self.build_temp)

class CustomInstall(install):
    """Customized setuptools install command - prints a friendly greeting."""
    def run(self):
        install.run(self)
        # A hacky way of getting the pinetree_test executable to somewhere
        # that the testrunner can find it
        lib_dir = self.install_lib
        scripts_dir = self.install_scripts
        subprocess.check_call(['mv', lib_dir+'/pinetree/pinetree_test', scripts_dir + '/'])

class CatchTestCommand(TestCommand):

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        # Run catch tests
        subprocess.check_call(['pinetree_test'])
        print("\nC++ tests complete, now running Python tests...\n")

        # Run python unittest tests
        subprocess.check_call([sys.executable, '-m', 'unittest', 'discover', '--start-directory', 'tests'])

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

with open('LICENSE') as f:
    license = f.read()

setup(
    name='pinetree',
    version='0.0.1',
    description='a stochastic simulation of gene expression',
    long_description=readme,
    author='Benjamin Jack',
    author_email='benjamin.r.jack@gmail.com',
    url='https://github.com/benjaminjack/pysinthe',
    license=license,
    packages=['pinetree'],
    install_requires=['pyaml',
                      'voluptuous'],
    ext_modules=[CMakeExtension('pinetree/pinetree')],
    cmdclass=dict(install=CustomInstall,
                  build_ext=CMakeBuild,
                  test=CatchTestCommand),
    zip_safe=False,
    scripts = ['bin/pinetree_run.py',
               'bin/pinetree_batch.py',
               'bin/parse_genbank.py']
)
<|endoftext|>


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

# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License

from setuptools import setup

setup(
    name='python-saml',
    version='2.4.2',
    description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
    ],
    author='OneLogin',
    author_email='support@onelogin.com',
    license='MIT',
    url='https://github.com/onelogin/python-saml',
    packages=['onelogin', 'onelogin/saml2'],
    include_package_data=True,
    package_data={
            'onelogin/saml2/schemas': ['*.xsd'],
    },
    package_dir={
        '': 'src',
    },
    test_suite='tests',
    install_requires=[
        'dm.xmlsec.binding==1.3.7',
        'isodate>=0.5.0',
        'defusedxml>=0.4.1',
    ],
    extras_require={
        'test': (
            'coverage>=3.6',
            'freezegun==0.3.5',
            'pylint==1.9.1',
            'pep8==1.5.7',
            'pyflakes==0.8.1',
            'coveralls==1.1',
        ),
    },
    keywords='saml saml2 xmlsec django flask',
)
<commit_msg>setup.py: flake8 is a superset of pep8 and pyflakes<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License

from setuptools import setup

setup(
    name='python-saml',
    version='2.4.2',
    description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
    ],
    author='OneLogin',
    author_email='support@onelogin.com',
    license='MIT',
    url='https://github.com/onelogin/python-saml',
    packages=['onelogin', 'onelogin/saml2'],
    include_package_data=True,
    package_data={
            'onelogin/saml2/schemas': ['*.xsd'],
    },
    package_dir={
        '': 'src',
    },
    test_suite='tests',
    install_requires=[
        'dm.xmlsec.binding==1.3.7',
        'isodate>=0.5.0',
        'defusedxml>=0.4.1',
    ],
    extras_require={
        'test': (
            'coverage>=3.6',
            'freezegun==0.3.5',
            'pylint==1.9.1',
            'flake8==3.6.0',
            'coveralls==1.1',
        ),
    },
    keywords='saml saml2 xmlsec django flask',
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
""" Setup to allow pip installs of pok-eco module """

from setuptools import setup

setup(
    name='pok-eco',
    version='0.2.1',
    description='POK-ECO Integrations ',
    author='METID - Politecnico di Milano',
    url='http://www.metid.polimi.it',
    license='AGPL',
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Framework :: Django',
    ],
    packages=['oai', 'ecoapi', 'xapi'],
    dependency_links=[
        "https://github.com/RusticiSoftware/TinCanPython.git@0.0.5#egg=tincan",
        "https://github.com/infrae/pyoai/archive/2.4.4.zip#egg=pyoai==2.4.4",
    ],
    install_requires=[
        "Django >= 1.4, < 1.5",
        "django-celery==3.1.16",
        "tincan==0.0.5",
        "pyoai==2.4.4"
    ]
)
<commit_msg>Define new version<commit_after>#!/usr/bin/env python
""" Setup to allow pip installs of pok-eco module """

from setuptools import setup

setup(
    name='pok-eco',
    version='0.2.2',
    description='POK-ECO Integrations ',
    author='METID - Politecnico di Milano',
    url='http://www.metid.polimi.it',
    license='AGPL',
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Framework :: Django',
    ],
    packages=['oai', 'ecoapi', 'xapi'],
    dependency_links=[
        "https://github.com/RusticiSoftware/TinCanPython.git@0.0.5#egg=tincan",
        "https://github.com/infrae/pyoai/archive/2.4.4.zip#egg=pyoai==2.4.4",
    ],
    install_requires=[
        "django==1.8.7",
        "django-celery==3.1.16",
        "tincan==0.0.5",
        "pyoai==2.4.4"
    ]
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
# License: 3-clause BSD
__revision__ = "$Id: $" # for the SVN Id
import sys
import os
from setuptools import setup, find_packages
import glob

_MAJOR               = 0
_MINOR               = 6
_MICRO               = 4
version              = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release              = '%d.%d' % (_MAJOR, _MINOR)

#version += ".post1"

metainfo = {
    'authors': {"main": ("yourname", "email@whatever.org")},
    'version': version,
    'license' : 'new BSD',
    'download_url' : ['http://pypi.python.org/pypi/sequana'],
    'url' : ["http://github.com/sequana/"],
    'description': "A set of standalone application and pipelines dedicated to NGS (new generation sequencing) analysis" ,
    'platforms' : ['Linux', 'Unix', 'MacOsX', 'Windows'],
    'keywords' : [''],
    'classifiers' : [
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: BSD License',
          'Operating System :: OS Independent',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3.5',
          'Programming Language :: Python :: 3.6',
          'Topic :: Software Development :: Libraries :: Python Modules',
          'Topic :: Scientific/Engineering :: Bio-Informatics',
          'Topic :: Scientific/Engineering :: Information Analysis',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Physics']
    }

packages = find_packages()
packages = [this for this in packages if this.startswith('test.') is False]
packages = [this for this in packages if this not in ['test']]

# load a common list of requirements
# - mock is for the test only
# - qtconsole is required by Sequanix
requirements = open("requirements.txt").read().split()

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
    # pillow, sphinx, numpydoc are  for the doc only
    extra_packages = ["pillow", "numpydoc", "sphinx"]
    requirements += extra_packages

if sys.version_info.major == 2 or on_rtd:
    requirements = [x for x in requirements
                    if x.startswith("snakemake") is False]

setup(
    name             = "sequana",
    version          = version,
    maintainer       = metainfo['authors']['main'][0],
    maintainer_email = metainfo['authors']['main'][1],
    author           = metainfo['authors']['main'][0],
    author_email     = metainfo['authors']['main'][1],
    long_description = open("README.rst").read(),
    keywords         = metainfo['keywords'],
    description      = metainfo['description'],
    license          = metainfo['license'],
    platforms        = metainfo['platforms'],
    url              = metainfo['url'],
    download_url     = metainfo['download_url'],
    classifiers      = metainfo['classifiers'],

    # package installation
    packages = packages,

    # pillow, sphinx-gallery and numpydoc are  for the doc only
    # mock is for the test only qtconsole is required by Sequanix
    install_requires = requirements,

    # specific packages for testing
    tests_require = open('requirements_dev.txt').read().split(),

    # here below '': pattern means include that pattern in all packages
    # so '' :['README.rst'] will include all README.rst recursively
    # required to use python setup.py install

    # This is recursive include of data files
    exclude_package_data = {"": ["__pycache__"]},
    package_data = {
        '': ['Snakefile*', '*html', 'README.rst', "requirements*txt",
             'config*.yaml', '*.css', "*.js",
             "snpEff.config*", "*.fa", "*.rules"],
        'sequana.rules' : ['*/*.rules', "*/*/*.rules"],
        'sequana.pipelines' : ['*/*'],
        'sequana.resources.data' : ['*.*'],  # use *.* for files and not ./adapters
        'sequana.resources.data.adapters' : ['*'],
        'sequana.resources.images' : ['*'],
        'sequana.resources.testing' : ['*'],
        'sequana.resources.busco' : ['*'],
        'sequana.multiqc' : ['*yaml'],
        },

    # these files do not need to be added in MANIFEST.in since there are python
    # packages that will be copied from sequana/ into sequana/
    # Note, however, that e.g. ./pipelines must be added

    zip_safe=False,
    entry_points = {
        'console_scripts':[
           'sequana_gui=sequana.gui.sequana_gui:main',
           'sequanix=sequana.gui.sequana_gui:main',
           'fastq_head=sequana.scripts.fastq_head:main',
           'fastq_count=sequana.scripts.fastq_count:main',
           'sequana_fastq_head=sequana.scripts.fastq_head:main',
           'sequana_fastq_count=sequana.scripts.fastq_count:main',
           'sequana=sequana.scripts.main:main',
           'sequana_taxonomy=sequana.scripts.taxonomy:main',
           'sequana_coverage=sequana.scripts.coverage:main',
           'sequana_summary=sequana.scripts.summary:main',
           'sequana_mapping=sequana.scripts.mapping:main',
           'sequana_compressor=sequana.scripts.compressor:main',
           'sequana_report=sequana.scripts.reports:main',
           'sequana_vcf_filter=sequana.scripts.vcf_filter:main',
        ],
        'sequana.module':[
            'sequana_coverage=sequana.modules_report.coverage:CoverageModule',
            'sequana_variant_calling=sequana.modules_report.variant_calling:VariantCallingModule',
            'sequana_summary=sequana.modules_report.summary:SummaryModule',
        ],
        "multiqc.modules.v1": [
            "sequana_pacbio_qc=sequana.multiqc.pacbio_qc:MultiqcModule",
            "sequana_quality_control=sequana.multiqc.quality_control:MultiqcModule",
            "sequana_coverage=sequana.multiqc.coverage:MultiqcModule",
            "sequana_isoseq=sequana.multiqc.isoseq:MultiqcModule",
        ],
        'multiqc.hooks.v1': [
            'before_config = sequana.multiqc:multiqc_sequana_config',
]
    },
)
<commit_msg>increase version<commit_after># -*- coding: utf-8 -*-
# License: 3-clause BSD
__revision__ = "$Id: $" # for the SVN Id
import sys
import os
from setuptools import setup, find_packages
import glob

_MAJOR               = 0
_MINOR               = 6
_MICRO               = 5
version              = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release              = '%d.%d' % (_MAJOR, _MINOR)

#version += ".post1"

metainfo = {
    'authors': {"main": ("yourname", "email@whatever.org")},
    'version': version,
    'license' : 'new BSD',
    'download_url' : ['http://pypi.python.org/pypi/sequana'],
    'url' : ["http://github.com/sequana/"],
    'description': "A set of standalone application and pipelines dedicated to NGS (new generation sequencing) analysis" ,
    'platforms' : ['Linux', 'Unix', 'MacOsX', 'Windows'],
    'keywords' : [''],
    'classifiers' : [
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: BSD License',
          'Operating System :: OS Independent',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3.5',
          'Programming Language :: Python :: 3.6',
          'Topic :: Software Development :: Libraries :: Python Modules',
          'Topic :: Scientific/Engineering :: Bio-Informatics',
          'Topic :: Scientific/Engineering :: Information Analysis',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Physics']
    }

packages = find_packages()
packages = [this for this in packages if this.startswith('test.') is False]
packages = [this for this in packages if this not in ['test']]

# load a common list of requirements
# - mock is for the test only
# - qtconsole is required by Sequanix
requirements = open("requirements.txt").read().split()

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
    # pillow, sphinx, numpydoc are  for the doc only
    extra_packages = ["pillow", "numpydoc", "sphinx"]
    requirements += extra_packages

if sys.version_info.major == 2 or on_rtd:
    requirements = [x for x in requirements
                    if x.startswith("snakemake") is False]

setup(
    name             = "sequana",
    version          = version,
    maintainer       = metainfo['authors']['main'][0],
    maintainer_email = metainfo['authors']['main'][1],
    author           = metainfo['authors']['main'][0],
    author_email     = metainfo['authors']['main'][1],
    long_description = open("README.rst").read(),
    keywords         = metainfo['keywords'],
    description      = metainfo['description'],
    license          = metainfo['license'],
    platforms        = metainfo['platforms'],
    url              = metainfo['url'],
    download_url     = metainfo['download_url'],
    classifiers      = metainfo['classifiers'],

    # package installation
    packages = packages,

    # pillow, sphinx-gallery and numpydoc are  for the doc only
    # mock is for the test only qtconsole is required by Sequanix
    install_requires = requirements,

    # specific packages for testing
    tests_require = open('requirements_dev.txt').read().split(),

    # here below '': pattern means include that pattern in all packages
    # so '' :['README.rst'] will include all README.rst recursively
    # required to use python setup.py install

    # This is recursive include of data files
    exclude_package_data = {"": ["__pycache__"]},
    package_data = {
        '': ['Snakefile*', '*html', 'README.rst', "requirements*txt",
             'config*.yaml', '*.css', "*.js",
             "snpEff.config*", "*.fa", "*.rules"],
        'sequana.rules' : ['*/*.rules', "*/*/*.rules"],
        'sequana.pipelines' : ['*/*'],
        'sequana.resources.data' : ['*.*'],  # use *.* for files and not ./adapters
        'sequana.resources.data.adapters' : ['*'],
        'sequana.resources.images' : ['*'],
        'sequana.resources.testing' : ['*'],
        'sequana.resources.busco' : ['*'],
        'sequana.multiqc' : ['*yaml'],
        },

    # these files do not need to be added in MANIFEST.in since there are python
    # packages that will be copied from sequana/ into sequana/
    # Note, however, that e.g. ./pipelines must be added

    zip_safe=False,
    entry_points = {
        'console_scripts':[
           'sequana_gui=sequana.gui.sequana_gui:main',
           'sequanix=sequana.gui.sequana_gui:main',
           'fastq_head=sequana.scripts.fastq_head:main',
           'fastq_count=sequana.scripts.fastq_count:main',
           'sequana_fastq_head=sequana.scripts.fastq_head:main',
           'sequana_fastq_count=sequana.scripts.fastq_count:main',
           'sequana=sequana.scripts.main:main',
           'sequana_taxonomy=sequana.scripts.taxonomy:main',
           'sequana_coverage=sequana.scripts.coverage:main',
           'sequana_summary=sequana.scripts.summary:main',
           'sequana_mapping=sequana.scripts.mapping:main',
           'sequana_compressor=sequana.scripts.compressor:main',
           'sequana_report=sequana.scripts.reports:main',
           'sequana_vcf_filter=sequana.scripts.vcf_filter:main',
        ],
        'sequana.module':[
            'sequana_coverage=sequana.modules_report.coverage:CoverageModule',
            'sequana_variant_calling=sequana.modules_report.variant_calling:VariantCallingModule',
            'sequana_summary=sequana.modules_report.summary:SummaryModule',
        ],
        "multiqc.modules.v1": [
            "sequana_pacbio_qc=sequana.multiqc.pacbio_qc:MultiqcModule",
            "sequana_quality_control=sequana.multiqc.quality_control:MultiqcModule",
            "sequana_coverage=sequana.multiqc.coverage:MultiqcModule",
            "sequana_isoseq=sequana.multiqc.isoseq:MultiqcModule",
        ],
        'multiqc.hooks.v1': [
            'before_config = sequana.multiqc:multiqc_sequana_config',
        ]
    },

)
<|endoftext|>


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

from distutils.core import setup

setup(
	name = "valet",
	author = "Adam Compton",
	author_email = "comptona@gmail.com",
	version = "0.1",
	license = "BSD-2-Clause",
	url = "https://github.com/handyman5/valet",
	download_url = "https://github.com/handyman5/valet/tarball/master",
	description = "valet is a script that turns any directory into a simple wiki, complete with wikitext rendering and automatically committing changes to version control.",
        install_requires = ['bottle'],
	scripts = ['valet']
)<commit_msg>Bumping setup.py to version 0.2 to indicate Windows platform support<commit_after>#!/usr/bin/env python
#coding: utf-8

from distutils.core import setup

setup(
	name = "valet",
	author = "Adam Compton",
	author_email = "comptona@gmail.com",
	version = "0.2",
	license = "BSD-2-Clause",
	url = "https://github.com/handyman5/valet",
	download_url = "https://github.com/handyman5/valet/tarball/master",
	description = "valet is a script that turns any directory into a simple wiki, complete with wikitext rendering and automatically committing changes to version control.",
        install_requires = ['bottle'],
	scripts = ['valet']
)<|endoftext|>


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

# avoid ImportError
sys.path.insert(0, 'netjsonconfig')
from version import get_version
sys.path.remove('netjsonconfig')

if sys.argv[-1] == 'setup.py':
    print("To install, run 'python setup.py install'\n")

if sys.argv[-1] == 'publish':
    import os
    os.system("python setup.py sdist bdist_wheel upload -s")
    args = {'version': get_version()}
    print("You probably want to also tag the version now:")
    print("  git tag -a %(version)s -m 'version %(version)s'" % args)
    print("  git push --tags")
    sys.exit()

def get_install_requires():
    """
    parse requirements.txt, ignore links, exclude comments
    """
    requirements = []
    for line in open('requirements.txt').readlines():
        # skip to next iteration if comment or empty line
        if line.startswith('#') or line == '' or line.startswith('http') or line.startswith('git'):
            continue
        # add line to requirements
        requirements.append(line.replace('\n', ''))
    # add py2-ipaddress if python2
    if sys.version_info.major < 3:
        requirements.append('py2-ipaddress')
    return requirements

setup(
    name='netjsonconfig',
    version=get_version(),
    description="Netjsonconfig is a python library that converts NetJSON DeviceConfiguration objects into real router configurations that can be installed on systems like OpenWRT or OpenWisp Firmware.",
    long_description=open('README.rst').read(),
    author='Federico Capoano (nemesisdesign)',
    author_email='f.capoano@cineca.it',
    license='GPL3',
    url='https://github.com/openwisp/netjsonconfig',
    download_url='https://github.com/openwisp/netjsonconfig/releases',
    packages=find_packages(exclude=['tests', 'tests.*', 'docs', 'docs.*']),
    zip_safe=False,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: System :: Networking',
    ],
    install_requires=get_install_requires(),
    test_suite='nose.collector',
    scripts=['bin/netjsonconfig'],
)
<commit_msg>Updated setup.py<commit_after>#!/usr/bin/env python
import sys
from setuptools import setup, find_packages

# avoid ImportError
sys.path.insert(0, 'netjsonconfig')
from version import get_version
sys.path.remove('netjsonconfig')

if sys.argv[-1] == 'setup.py':
    print("To install, run 'python setup.py install'\n")

if sys.argv[-1] == 'publish':
    import os
    os.system("python setup.py sdist bdist_wheel upload -s")
    args = {'version': get_version()}
    print("You probably want to also tag the version now:")
    print("  git tag -a %(version)s -m 'version %(version)s'" % args)
    print("  git push --tags")
    sys.exit()

def get_install_requires():
    """
    parse requirements.txt, ignore links, exclude comments
    """
    requirements = []
    for line in open('requirements.txt').readlines():
        # skip to next iteration if comment or empty line
        if line.startswith('#') or line == '' or line.startswith('http') or line.startswith('git'):
            continue
        # add line to requirements
        requirements.append(line.replace('\n', ''))
    # add py2-ipaddress if python2
    if sys.version_info.major < 3:
        requirements.append('py2-ipaddress')
    return requirements

setup(
    name='netjsonconfig',
    version=get_version(),
    description="Netjsonconfig is a python library that converts NetJSON DeviceConfiguration objects into real router configurations that can be installed on systems like OpenWRT or OpenWisp Firmware.",
    long_description=open('README.rst').read(),
    author='Federico Capoano (nemesisdesign)',
    author_email='f.capoano@cineca.it',
    license='GPL3',
    url='http://netjsonconfig.openwisp.org',
    download_url='https://github.com/openwisp/netjsonconfig/releases',
    keywords=['openwrt', 'openwisp', 'netjson', 'networking'],
    packages=find_packages(exclude=['tests', 'tests.*', 'docs', 'docs.*']),
    zip_safe=False,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: System :: Networking',
    ],
    install_requires=get_install_requires(),
    test_suite='nose.collector',
    scripts=['bin/netjsonconfig'],
)
<|endoftext|>


<commit_before>import platform
import sys
from config import *

try:
    from setuptools import setup, find_packages

    # required to build the cython extensions
    from distutils.extension import Extension

except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

# Extra arguments to pass to the setup function
extra_args = {}

# Prereqs of the build. Won't get installed when deploying the egg.
setup_requires = [
]

# Prereqs of the install. Will install when deploying the egg.
install_requires=[
]

if sys.platform == 'win32':
    import py2exe
    install_requires.extend([
        'tornado==2.1',
        'pywin32==217',
        'wmi==1.4.9',
        'simplejson==2.6.1'
    ])

    class Target(object):
        def __init__(self, **kw):
            self.__dict__.update(kw)
            self.version = get_version()
            self.company_name = 'Datadog, Inc.'
            self.copyright = 'Copyright 2012 Datadog, Inc.'
            self.cmdline_style = 'pywin32'

    agent_svc = Target(name='Datadog Agent', modules='win32.agent')
    forwarder_svc = Target(name='Datadog Forwarder', modules='win32.forwarder')
    dogstatsd_svc = Target(name='DogstatsD', modules='win32.dogstatsd_win32')

    extra_args = {
        'options': {
            'py2exe': {
                'includes': 'win32service,win32serviceutil,win32event,simplejson',
                'optimize': 2,
                'compressed': 1,
                'bundle_files': 1,
            },
        },
        'service': [agent_svc, forwarder_svc, dogstatsd_svc],
        'zipfile': None
    }

setup(
    name='datadog-agent',
    version=get_version(),
    description="DevOps' best friend",
    author='DataDog',
    author_email='dev@datadoghq.com',
    url='http://www.datadoghq.com',
    install_requires=install_requires,
    setup_requires=setup_requires,
    packages=find_packages(exclude=['ez_setup']),
    include_package_data=True,
    test_suite='nose.collector',
    zip_safe=False,
    **extra_args
)
<commit_msg>Require more libraries so more checks can work on win32<commit_after>import platform
import sys
from config import *

try:
    from setuptools import setup, find_packages

    # required to build the cython extensions
    from distutils.extension import Extension

except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

# Extra arguments to pass to the setup function
extra_args = {}

# Prereqs of the build. Won't get installed when deploying the egg.
setup_requires = [
]

# Prereqs of the install. Will install when deploying the egg.
install_requires=[
]

if sys.platform == 'win32':
    import py2exe
    install_requires.extend([
        'tornado==2.1',
        'pywin32==217',
        'wmi==1.4.9',
        'simplejson==2.6.1',
        'msql-python==1.2.3',
        'pymongo==2.3',
        'psycopg2==2.4.5',
        'python-memcache==1.48',
        'redis==2.6.2',
        'elementtree'
    ])

    class Target(object):
        def __init__(self, **kw):
            self.__dict__.update(kw)
            self.version = get_version()
            self.company_name = 'Datadog, Inc.'
            self.copyright = 'Copyright 2012 Datadog, Inc.'
            self.cmdline_style = 'pywin32'

    agent_svc = Target(name='Datadog Agent', modules='win32.agent')
    forwarder_svc = Target(name='Datadog Forwarder', modules='win32.forwarder')
    dogstatsd_svc = Target(name='DogstatsD', modules='win32.dogstatsd_win32')

    extra_args = {
        'options': {
            'py2exe': {
                'includes': 'win32service,win32serviceutil,win32event,simplejson',
                'optimize': 2,
                'compressed': 1,
                'bundle_files': 1,
            },
        },
        'service': [agent_svc, forwarder_svc, dogstatsd_svc],
        'zipfile': None
    }

setup(
    name='datadog-agent',
    version=get_version(),
    description="DevOps' best friend",
    author='DataDog',
    author_email='dev@datadoghq.com',
    url='http://www.datadoghq.com',
    install_requires=install_requires,
    setup_requires=setup_requires,
    packages=find_packages(exclude=['ez_setup']),
    include_package_data=True,
    test_suite='nose.collector',
    zip_safe=False,
    **extra_args
)
<|endoftext|>


<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2018 qsuscs, TobiX
# Should still run with Python 2.7...

from __future__ import print_function, unicode_literals

import os
import sys
from glob import glob

os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0

for f in glob('dot.*'):
    dst = os.path.expanduser(
        '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-"))
    src = os.path.join(os.getcwd(), f)
    src_rel = os.path.relpath(src, os.path.dirname(dst))

    try:
        os.makedirs(os.path.dirname(dst))
    except OSError:
        pass

    try:
        os.symlink(src_rel, dst)
    except OSError:
        # Broken symbolic links do not "exist"
        if not os.path.exists(dst) or not os.path.samefile(src, dst):
            print(dst + " exists and does not link do " + src)
            exit = 1

sys.exit(exit)
<commit_msg>Neater error message<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...

from __future__ import print_function, unicode_literals

import os
import sys
from glob import glob

os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0

for f in glob('dot.*'):
    dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
    dst = os.path.expanduser(dst_home)
    src = os.path.join(os.getcwd(), f)
    src_rel = os.path.relpath(src, os.path.dirname(dst))

    try:
        os.makedirs(os.path.dirname(dst))
    except OSError:
        pass

    try:
        os.symlink(src_rel, dst)
    except OSError:
        # Broken symbolic links do not "exist"
        if not os.path.exists(dst) or not os.path.samefile(src, dst):
            print('"{}" exists and does not link to "{}".'.format(dst_home, f))
            exit = 1

sys.exit(exit)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
"""setup.py -- setup file for Matrioshka deployment mother brain.
"""
from setuptools import setup

setup(
    name = "matrioshka",
    packages = ['matrioshka'],
    install_requires = [
        'Fabric',
        'boto',
        ],

    zip_safe = False,

    version = "0.1",
    description = ".",
    author = "David Eyk",
    author_email = "david.eyk@gmail.com",
    url = "http://github.com/eykd/matrioshka",
    #download_url = "http://github.com/eykd/matrioshka",
    long_description = open('README.md').read(),
    )
<commit_msg>Added paved as a requirement in setup.py<commit_after># -*- coding: utf-8 -*-
"""setup.py -- setup file for Matrioshka deployment mother brain.
"""
from setuptools import setup

setup(
    name = "matrioshka",
    packages = ['matrioshka'],
    install_requires = [
        'Fabric',
        'boto',
        'Paved',
        ],

    zip_safe = False,

    version = "0.1",
    description = ".",
    author = "David Eyk",
    author_email = "david.eyk@gmail.com",
    url = "http://github.com/eykd/matrioshka",
    #download_url = "http://github.com/eykd/matrioshka",
    long_description = open('README.md').read(),
    )
<|endoftext|>


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

from honcho import __version__

requirements = []
export_requirements = []

if sys.version_info[:2] < (2, 7):
    requirements.append('argparse')
    requirements.append('ordereddict')

if (3, 0) <= sys.version_info[:2] < (3, 3):
    export_requirements = ['jinja2>=2.6,<2.7']
else:
    export_requirements = ['jinja2>=2.7,<2.8']

HERE = os.path.dirname(__file__)
try:
    long_description = open(os.path.join(HERE, 'README.rst')).read()
except:
    long_description = None

setup(
    name='honcho',
    version=__version__,
    packages=find_packages(exclude=['honcho.test*']),
    include_package_data=True,

    # metadata for upload to PyPI
    author='Nick Stenning',
    author_email='nick@whiteink.com',
    url='https://github.com/nickstenning/honcho',
    description='Honcho: a python clone of Foreman. For managing Procfile-based applications.',
    long_description=long_description,
    license='MIT',
    keywords='sysadmin process procfile',
    classifiers=[
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3'
    ],
    install_requires=requirements,
    extras_require={
        'export': export_requirements,
    },
    entry_points={
        'console_scripts': [
            'honcho=honcho.command:main'
        ],
        'honcho_exporters': [
            'upstart=honcho.export.upstart:Export',
            'supervisord=honcho.export.supervisord:Export',
        ],
    }
)
<commit_msg>Use PEP426 environment markers for conditional require<commit_after>import os
import sys
from setuptools import setup, find_packages

from honcho import __version__

HERE = os.path.dirname(__file__)
try:
    long_description = open(os.path.join(HERE, 'README.rst')).read()
except:
    long_description = None

setup(
    name='honcho',
    version=__version__,
    packages=find_packages(exclude=['honcho.test*']),
    include_package_data=True,

    # metadata for upload to PyPI
    author='Nick Stenning',
    author_email='nick@whiteink.com',
    url='https://github.com/nickstenning/honcho',
    description='Honcho: a python clone of Foreman. For managing Procfile-based applications.',
    long_description=long_description,
    license='MIT',
    keywords='sysadmin process procfile',
    classifiers=[
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3'
    ],
    install_requires=[],
    extras_require={
        ':python_version=="2.6"': ['argparse', 'ordereddict'],
        'export:python_version=="3.0"': ['jinja2>=2.6,<2.7'],
        'export:python_version=="3.1"': ['jinja2>=2.6,<2.7'],
        'export:python_version=="3.2"': ['jinja2>=2.6,<2.7'],
        'export': ['jinja2>=2.7,<2.8'],
    },
    entry_points={
        'console_scripts': [
            'honcho=honcho.command:main'
        ],
        'honcho_exporters': [
            'upstart=honcho.export.upstart:Export',
            'supervisord=honcho.export.supervisord:Export',
        ],
    }
)
<|endoftext|>


<commit_before>import re
from setuptools import setup, find_packages

EXTRAS_REQUIRE = {
    "marshmallow": ["marshmallow>=3.13.0"],
    "yaml": ["PyYAML>=3.10"],
    "validation": ["prance[osv]>=0.11"],
    "lint": [
        "flake8==4.0.1",
        "flake8-bugbear==22.4.25",
        "pre-commit~=2.4",
        "mypy==0.950",
        "types-PyYAML",
    ],
    "docs": [
        "marshmallow>=3.13.0",
        "pyyaml==6.0",
        "sphinx==5.0.0",
        "sphinx-issues==3.0.1",
        "sphinx-rtd-theme==1.0.0",
    ],
}
EXTRAS_REQUIRE["tests"] = (
    EXTRAS_REQUIRE["yaml"]
    + EXTRAS_REQUIRE["validation"]
    + ["marshmallow>=3.13.0", "pytest", "mock"]
)
EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"]

def find_version(fname):
    """Attempts to find the version number in the file names fname.
    Raises RuntimeError if not found.
    """
    version = ""
    with open(fname) as fp:
        reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
        for line in fp:
            m = reg.match(line)
            if m:
                version = m.group(1)
                break
    if not version:
        raise RuntimeError("Cannot find version information.")
    return version

def read(fname):
    with open(fname) as fp:
        content = fp.read()
    return content

setup(
    name="apispec",
    version=find_version("src/apispec/__init__.py"),
    description="A pluggable API specification generator. Currently supports the "
    "OpenAPI Specification (f.k.a. the Swagger specification).",
    long_description=read("README.rst"),
    author="Steven Loria",
    author_email="sloria1@gmail.com",
    url="https://github.com/marshmallow-code/apispec",
    packages=find_packages("src"),
    package_dir={"": "src"},
    include_package_data=True,
    extras_require=EXTRAS_REQUIRE,
    license="MIT",
    zip_safe=False,
    keywords="apispec swagger openapi specification oas documentation spec rest api",
    python_requires=">=3.7",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3 :: Only",
    ],
    test_suite="tests",
    project_urls={
        "Funding": "https://opencollective.com/marshmallow",
        "Issues": "https://github.com/marshmallow-code/apispec/issues",
        "Tidelift": "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi",  # noqa: B950,E501
    },
)
<commit_msg>Bump mypy from 0.950 to 0.960<commit_after>import re
from setuptools import setup, find_packages

EXTRAS_REQUIRE = {
    "marshmallow": ["marshmallow>=3.13.0"],
    "yaml": ["PyYAML>=3.10"],
    "validation": ["prance[osv]>=0.11"],
    "lint": [
        "flake8==4.0.1",
        "flake8-bugbear==22.4.25",
        "pre-commit~=2.4",
        "mypy==0.960",
        "types-PyYAML",
    ],
    "docs": [
        "marshmallow>=3.13.0",
        "pyyaml==6.0",
        "sphinx==5.0.0",
        "sphinx-issues==3.0.1",
        "sphinx-rtd-theme==1.0.0",
    ],
}
EXTRAS_REQUIRE["tests"] = (
    EXTRAS_REQUIRE["yaml"]
    + EXTRAS_REQUIRE["validation"]
    + ["marshmallow>=3.13.0", "pytest", "mock"]
)
EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["lint"] + ["tox"]

def find_version(fname):
    """Attempts to find the version number in the file names fname.
    Raises RuntimeError if not found.
    """
    version = ""
    with open(fname) as fp:
        reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
        for line in fp:
            m = reg.match(line)
            if m:
                version = m.group(1)
                break
    if not version:
        raise RuntimeError("Cannot find version information.")
    return version

def read(fname):
    with open(fname) as fp:
        content = fp.read()
    return content

setup(
    name="apispec",
    version=find_version("src/apispec/__init__.py"),
    description="A pluggable API specification generator. Currently supports the "
    "OpenAPI Specification (f.k.a. the Swagger specification).",
    long_description=read("README.rst"),
    author="Steven Loria",
    author_email="sloria1@gmail.com",
    url="https://github.com/marshmallow-code/apispec",
    packages=find_packages("src"),
    package_dir={"": "src"},
    include_package_data=True,
    extras_require=EXTRAS_REQUIRE,
    license="MIT",
    zip_safe=False,
    keywords="apispec swagger openapi specification oas documentation spec rest api",
    python_requires=">=3.7",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3 :: Only",
    ],
    test_suite="tests",
    project_urls={
        "Funding": "https://opencollective.com/marshmallow",
        "Issues": "https://github.com/marshmallow-code/apispec/issues",
        "Tidelift": "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi",  # noqa: B950,E501
    },
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# encoding: utf-8
from setuptools import setup

# read long_description from README.rst
long_description = None
try:
    long_description = open('README.rst').read()
    long_description += '\n' + open('CHANGES.rst').read()
except IOError:
    pass

try:
    from inspect import signature, Signature, Parameter, BoundArguments
except ImportError:     # python2
    install_requires = ['funcsigs']
else:                   # python3
    install_requires = []

# invoke distutils
setup(
    name='black-magic',
    version='0.0.6',
    description='Decorator utility that operates on black magic',
    long_description=long_description,
    author='Thomas Gläßle',
    author_email='t_glaessle@gmx.de',
    url='https://github.com/coldfix/black-magic',
    license='Public Domain',
    packages=['black_magic'],
    install_requires=install_requires,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Topic :: Software Development',
        'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
    ],
    test_suite='nose.collector',
    tests_require='nose',
)

<commit_msg>Bump 0.0.7: partial functools.partial support<commit_after>#!/usr/bin/env python
# encoding: utf-8
from setuptools import setup

# read long_description from README.rst
long_description = None
try:
    long_description = open('README.rst').read()
    long_description += '\n' + open('CHANGES.rst').read()
except IOError:
    pass

try:
    from inspect import signature, Signature, Parameter, BoundArguments
except ImportError:     # python2
    install_requires = ['funcsigs']
else:                   # python3
    install_requires = []

# invoke distutils
setup(
    name='black-magic',
    version='0.0.7',
    description='Decorator utility that operates on black magic',
    long_description=long_description,
    author='Thomas Gläßle',
    author_email='t_glaessle@gmx.de',
    url='https://github.com/coldfix/black-magic',
    license='Public domain',
    packages=['black_magic'],
    install_requires=install_requires,
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Topic :: Software Development',
        'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
    ],
    test_suite='nose.collector',
    tests_require='nose',
)

<|endoftext|>


<commit_before>import sys, os
from setuptools import setup, Extension, find_packages

import numpy

kws = {}
if not int(os.getenv( 'DISABLE_INSTALL_REQUIRES','0' )):
    kws['install_requires'] = [
        'numpy>=1.0.4',
        ]

setup(name="motmot.imops",
      description="image format conversion (e.g. between MONO8, YUV422, and RGB)",
      long_description = """
This is a subpackage of the motmot family of digital image utilities.
""",
      version="0.5.2",
      license="BSD",
      maintainer="Andrew Straw",
      maintainer_email="strawman@astraw.com",
      url="http://code.astraw.com/projects/motmot",
      packages = find_packages(),
      namespace_packages = ['motmot'],
      ext_modules=[Extension(name="motmot.imops.imops",
                             sources=['src/imops.pyx','src/color_convert.c',],
                             include_dirs=[numpy.get_include()],
                             ),
                   ],
      zip_safe = True,
      **kws)
<commit_msg>update url<commit_after>import sys, os
from setuptools import setup, Extension, find_packages

import numpy

kws = {}
if not int(os.getenv( 'DISABLE_INSTALL_REQUIRES','0' )):
    kws['install_requires'] = [
        'numpy>=1.0.4',
        ]

setup(name="motmot.imops",
      description="image format conversion (e.g. between MONO8, YUV422, and RGB)",
      long_description = """
This is a subpackage of the motmot family of digital image utilities.
""",
      version="0.5.2",
      license="BSD",
      maintainer="Andrew Straw",
      maintainer_email="strawman@astraw.com",
      url="http://code.astraw.com/projects/motmot/imops.html",
      packages = find_packages(),
      namespace_packages = ['motmot'],
      ext_modules=[Extension(name="motmot.imops.imops",
                             sources=['src/imops.pyx','src/color_convert.c',],
                             include_dirs=[numpy.get_include()],
                             ),
                   ],
      zip_safe = True,
      **kws)
<|endoftext|>


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

# Use 'distribute', a fork of 'setuptools'.
# This seems to be the recommended tool until 'distutils2' is completed.
# See: http://pypi.python.org/pypi/distribute

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

# Find the version from the package metadata.

import os
import re

package_version = re.search(
    "__version__ = '([^']+)'",
    open(os.path.join('spyral', '__init__.py')).read()).group(1)

# Resources
# - package_data is what to install. MANIFEST.in is what to bundle.
#   The distribute documentation says it can determine what data files to
#   include without the need of MANIFEST.in but I had no luck with that.
# - We find the bundled resource files at runtime using the pkg_resources
#   module from setuptools. Thus, setuptools is also a dependency.

# Dependencies
# - While Pygame is listed as a dependency, you should install it separately to
#   avoid issues with libpng and others.
#   See: http://www.pygame.org/install.html

setup(
    name='spyral',
    version=package_version,
    author='Platipy Project',
    author_email='platipy@platipy.org',
    install_requires=['setuptools', 'pygame>=1.8', 'parsley', 'greenlet'],
    packages=['spyral'],
    description='A Python library for game development',
    long_description=open('README.rst', 'r').read(),
    keywords="pygame game engine",
    license='LGPLv2',
    url='https://github.com/platipy/spyral',
    include_package_data=True,
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: Education',
        'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 2 :: Only',
        'Topic :: Games/Entertainment',
        'Topic :: Multimedia',
        'Topic :: Software Development',
        'Topic :: Software Development :: Libraries :: pygame',
    ]
)
<commit_msg>Removed pygame dependency for pip<commit_after>#!/usr/bin/env python

# Use 'distribute', a fork of 'setuptools'.
# This seems to be the recommended tool until 'distutils2' is completed.
# See: http://pypi.python.org/pypi/distribute

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

# Find the version from the package metadata.

import os
import re

package_version = re.search(
    "__version__ = '([^']+)'",
    open(os.path.join('spyral', '__init__.py')).read()).group(1)

# Resources
# - package_data is what to install. MANIFEST.in is what to bundle.
#   The distribute documentation says it can determine what data files to
#   include without the need of MANIFEST.in but I had no luck with that.
# - We find the bundled resource files at runtime using the pkg_resources
#   module from setuptools. Thus, setuptools is also a dependency.

# Dependencies
# - While Pygame is listed as a dependency, you should install it separately to
#   avoid issues with libpng and others.
#   See: http://www.pygame.org/install.html

setup(
    name='spyral',
    version=package_version,
    author='Platipy Project',
    author_email='platipy@platipy.org',
    install_requires=['setuptools', 'parsley', 'greenlet'],
    packages=['spyral'],
    description='A Python library for game development',
    long_description=open('README.rst', 'r').read(),
    keywords="pygame game engine",
    license='LGPLv2',
    url='https://github.com/platipy/spyral',
    include_package_data=True,
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Intended Audience :: Education',
        'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 2 :: Only',
        'Topic :: Games/Entertainment',
        'Topic :: Multimedia',
        'Topic :: Software Development',
        'Topic :: Software Development :: Libraries :: pygame',
    ]
)
<|endoftext|>


<commit_before>import os
import sys

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

from pagarme.config import __version__

if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist upload')
    sys.exit()

readme = open('README.md').read().strip()
requirements = ['requests', 'rsa']

setup(
    name='pagarme.py',
    version=__version__,
    description='Pagar.me Python API wrapper',
    long_description=readme,
    author='Michael Coelho',
    author_email='michael.tcoelho@gmail.com',
    url='https://github.com/michaeltcoelho/pagarme.py',
    packages=[
        'pagarme'
    ],
    package_dir={'pagarme': 'pagarme'},
    include_package_data=True,
    install_requires=requirements,
    install_requires=requirements,
    license='MIT License',
    test_suite='runtests',
    zip_safe=False,
    keywords='pagarme, payment, gateway, api, wrapper',
    classifiers=[
        'Development Status :: 1 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
)
<commit_msg>fix setup<commit_after>import os
import sys

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

from pagarme.config import __version__

if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist upload')
    sys.exit()

readme = open('README.md').read().strip()
requirements = ['requests', 'rsa']

setup(
    name='pagarme.py',
    version=__version__,
    description='Pagar.me Python API wrapper',
    long_description=readme,
    author='Michael Coelho',
    author_email='michael.tcoelho@gmail.com',
    url='https://github.com/michaeltcoelho/pagarme.py',
    packages=[
        'pagarme'
    ],
    package_dir={'pagarme': 'pagarme'},
    include_package_data=True,
    install_requires=requirements,
    license='MIT License',
    test_suite='runtests',
    zip_safe=False,
    keywords='pagarme, payment, gateway, api, wrapper',
    classifiers=[
        'Development Status :: 1 - Alpha',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
)
<|endoftext|>