<commit_before>import boto3
from botocore.client import Config

from srgutil.interfaces import IMozLogging, IClock
import json
import threading
import time

class LazyJSONLoader:
    def __init__(self, ctx, s3_bucket, s3_key, ttl=14400):
        self._ctx = ctx
        self.logger = self._ctx[IMozLogging].get_logger('taar')
        self._clock = self._ctx[IClock]

        self._s3_bucket = s3_bucket
        self._s3_key = s3_key
        self._ttl = int(ttl)
        self._expiry_time = 0

        self._key_str = "{}|{}".format(self._s3_bucket, self._s3_key)

        self._cached_copy = None
        msg = "Cache expiry of {} is set to TTL of {} seconds".format(self._key_str, self._ttl)
        self.logger.info(msg)

        self._lock = threading.RLock()

        self.logger.info("{} loader is initialized".format(self._key_str))

    def has_expired(self):
        return self._clock.time() > self._expiry_time

    def get(self):
        """
        Return the JSON defined at the S3 location in the constructor.

        The get method will reload the S3 object after the TTL has
        expired.
        Fetch the JSON object from cache or S3 if necessary
        """
        if not self.has_expired() and self._cached_copy is not None:
            return self._cached_copy, False

        return self._refresh_cache(), True

    def _refresh_cache(self):
        with self._lock:
            # If some requests get stale data while the S3 bucket is
            # being reloaded - it's not the end of the world.
            #
            # Likewise when the TTL expires, it's possible for
            # multiple threads to concurrently lock and update the
            # cache.  Again - not world ending.
            #
            # Immediately update the expiry time as we don't want other
            # threads to wait on the lock while we update the
            # cached_copy
            #
            self._expiry_time = self._clock.time() + self._ttl

            raw_data = None
            raw_bytes = None
            try:
                # We need to force a data reload from S3
                config = Config(connect_timeout=10, retries={'max_attempts': 3})
                s3 = boto3.resource('s3', config=config)

                start_load = time.time()
                raw_bytes = (
                    s3
                    .Object(self._s3_bucket, self._s3_key)
                    .get()['Body']
                    .read()
                )
                end_load = time.time()
                load_time = (end_load-start_load)
                msg = "Loaded JSON from S3: {}. Byte count: {:d}.  Time to Load: {:0.3f}"
                msg_params = self._key_str, len(raw_bytes), load_time
                self.logger.info(msg.format(*msg_params))

                raw_data = (
                    raw_bytes.decode('utf-8')
                )

                # It is possible to have corrupted files in S3, so
                # protect against that.
                try:
                    self._cached_copy = json.loads(raw_data)
                except ValueError:
                    # In the event of an error, we want to try to reload
                    # the data so force the expiry to 0, but leave the
                    # existing cached data alone so we can still service
                    # requests.
                    self._expiry_time = 0

                    self.logger.error("Cannot parse JSON resource from S3", extra={
                        "bucket": self._s3_bucket,
                        "key": self._s3_key})

                return self._cached_copy
            except Exception:
                # In the event of an error, we want to try to reload
                # the data so force the expiry to 0, but leave the
                # existing cached data alone so we can still service
                # requests.
                self._expiry_time = 0

                self.logger.exception("Failed to download from S3", extra={
                    "bucket": self._s3_bucket,
                    "key": self._s3_key})
                return self._cached_copy
<commit_msg>flake8 fix<commit_after>import boto3
from botocore.client import Config

from srgutil.interfaces import IMozLogging, IClock
import json
import threading
import time

class LazyJSONLoader:
    def __init__(self, ctx, s3_bucket, s3_key, ttl=14400):
        self._ctx = ctx
        self.logger = self._ctx[IMozLogging].get_logger('taar')
        self._clock = self._ctx[IClock]

        self._s3_bucket = s3_bucket
        self._s3_key = s3_key
        self._ttl = int(ttl)
        self._expiry_time = 0

        self._key_str = "{}|{}".format(self._s3_bucket, self._s3_key)

        self._cached_copy = None
        msg = "Cache expiry of {} is set to TTL of {} seconds".format(self._key_str, self._ttl)
        self.logger.info(msg)

        self._lock = threading.RLock()

        self.logger.info("{} loader is initialized".format(self._key_str))

    def has_expired(self):
        return self._clock.time() > self._expiry_time

    def get(self):
        """
        Return the JSON defined at the S3 location in the constructor.

        The get method will reload the S3 object after the TTL has
        expired.
        Fetch the JSON object from cache or S3 if necessary
        """
        if not self.has_expired() and self._cached_copy is not None:
            return self._cached_copy, False

        return self._refresh_cache(), True

    def _refresh_cache(self):
        with self._lock:
            # If some requests get stale data while the S3 bucket is
            # being reloaded - it's not the end of the world.
            #
            # Likewise when the TTL expires, it's possible for
            # multiple threads to concurrently lock and update the
            # cache.  Again - not world ending.
            #
            # Immediately update the expiry time as we don't want other
            # threads to wait on the lock while we update the
            # cached_copy
            #
            self._expiry_time = self._clock.time() + self._ttl

            raw_data = None
            raw_bytes = None
            try:
                # We need to force a data reload from S3
                config = Config(connect_timeout=10, retries={'max_attempts': 3})
                s3 = boto3.resource('s3', config=config)

                start_load = time.time()
                raw_bytes = (
                    s3
                    .Object(self._s3_bucket, self._s3_key)
                    .get()['Body']
                    .read()
                )
                end_load = time.time()
                load_time = (end_load - start_load)
                msg = "Loaded JSON from S3: {}. Byte count: {:d}.  Time to Load: {:0.3f}"
                msg_params = self._key_str, len(raw_bytes), load_time
                self.logger.info(msg.format(*msg_params))

                raw_data = (
                    raw_bytes.decode('utf-8')
                )

                # It is possible to have corrupted files in S3, so
                # protect against that.
                try:
                    self._cached_copy = json.loads(raw_data)
                except ValueError:
                    # In the event of an error, we want to try to reload
                    # the data so force the expiry to 0, but leave the
                    # existing cached data alone so we can still service
                    # requests.
                    self._expiry_time = 0

                    self.logger.error("Cannot parse JSON resource from S3", extra={
                        "bucket": self._s3_bucket,
                        "key": self._s3_key})

                return self._cached_copy
            except Exception:
                # In the event of an error, we want to try to reload
                # the data so force the expiry to 0, but leave the
                # existing cached data alone so we can still service
                # requests.
                self._expiry_time = 0

                self.logger.exception("Failed to download from S3", extra={
                    "bucket": self._s3_bucket,
                    "key": self._s3_key})
                return self._cached_copy
<|endoftext|>


<commit_before>"""MDTraj: a python library for loading, saving, and manipulating molecular dynamics trajectories.

MDTraj provides an easy to use python interface for manipulating MD trajectories.
It supports the reading and writing of molecular dynamics trajectories
in a variety of formats, including full support for PDB, DCD, XTC, TRR, binpos,
AMBER NetCDF, AMBER mdcrd and MDTraj HDF5. The package also provides a command line script
for converting trajectories between supported formats.
"""

from __future__ import print_function
DOCLINES = __doc__.split("\n")

import os
import sys
import shutil
import tempfile
import subprocess
from distutils.ccompiler import new_compiler
try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension

try:
    import numpy
except ImportError:
    print('Building and running mdtraj requires numpy', file=sys.stderr)
    sys.exit(1)

try:
    import Cython
    if Cython.__version__ < '0.18':
        raise ImportError
    from Cython.Distutils import build_ext
    setup_kwargs = {'cmdclass': {'build_ext': build_ext}}
except ImportError:
    print('Building from source requires cython >= 0.18', file=sys.stderr)
    exit(1)

try:
    sys.argv.remove('--no-install-deps')
    no_install_deps = True
except ValueError:
    no_install_deps = False

if 'setuptools' in sys.modules:
    setup_kwargs['zip_safe'] = False
    if not no_install_deps:
        setup_kwargs['install_requires'] = ['pandas>=0.9.0']
    setup_kwargs['entry_points'] = {'console_scripts':
              ['mdconvert = mdtraj.scripts.mdconvert:entry_point',
               'mdinspect = mdtraj.scripts.mdinspect:entry_point']}
else:
    setup_kwargs['scripts'] = ['scripts/mdconvert.py', 'scripts/mdinspect.py']

##########################
VERSION = "0.8.0"
ISRELEASED = True
__version__ = VERSION
##########################

CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Programming Language :: C
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

def find_packages():
    """Find all of mdtraj's python packages.
    Adapted from IPython's setupbase.py. Copyright IPython
    contributors, licensed under the BSD license.
    """
    packages = ['mdtraj.scripts']
    for dir,subdirs,files in os.walk('MDTraj'):
        package = dir.replace(os.path.sep, '.')
        if '__init__.py' not in files:
            # not a package
            continue
        packages.append(package.replace('MDTraj', 'mdtraj'))
    return packages

################################################################################
# Writing version control information to the module
################################################################################

def git_version():
    # Return the git revision as a string
    # copied from numpy setup.py
    def _minimal_ext_cmd(cmd):
        # construct minimal environment
        env = {}
        for k in ['SYSTEMROOT', 'PATH']:
            v = os.environ.get(k)
            if v is not None:
                env[k] = v
        # LANGUAGE is used on win32
        env['LANGUAGE'] = 'C'
        env['LANG'] = 'C'
        env['LC_ALL'] = 'C'
        out = subprocess.Popen(
            cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
        return out

    try:
        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
        GIT_REVISION = out.strip().decode('ascii')
    except OSError:
        GIT_REVISION = 'Unknown'

    return GIT_REVISION

def write_version_py(filename='MDTraj/version.py'):
    cnt = """
# THIS FILE IS GENERATED FROM MDTRAJ SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s

if not release:
    version = full_version
"""
    # Adding the git rev number needs to be done inside write_version_py(),
    # otherwise the import of numpy.version messes up the build under Python 3.
    FULLVERSION = VERSION
    if os.path.exists('.git'):
        GIT_REVISION = git_version()
    else:
        GIT_REVISION = 'Unknown'

    if not ISRELEASED:
        FULLVERSION += '.dev-' + GIT_REVISION[:7]

    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION,
                       'full_version': FULLVERSION,
                       'git_revision': GIT_REVISION,
                       'isrelease': str(ISRELEASED)})
    finally:
        a.close()

################################################################################
# Detection of compiler capabilities
################################################################################

def hasfunction(cc, funcname, include=None, extra_postargs=None):
    # From http://stackoverflow.com/questions/
    #            7018879/disabling-output-when-compiling-with-distutils
    tmpdir = tempfile.mkdtemp(prefix='hasfunction-')
    devnull = oldstderr = None
    try:
        try:
            fname = os.path.join(tmpdir, 'funcname.c')
            f = open(fname, 'w')
            if include is not None:
                f.write('#include %s\n' % include)
            f.write('int main(void) {\n')
            f.write('    %s;\n' % funcname)
            f.write('}\n')
            f.close()
            devnull = open(os.devnull, 'w')
            oldstderr = os.dup(sys.stderr.fileno())
            os.dup2(devnull.fileno(), sys.stderr.fileno())
            objects = cc.compile([fname], output_dir=tmpdir,
                                 extra_postargs=extra_postargs)
            cc.link_executable(objects, os.path.join(tmpdir, 'a.out'))
        except Exception as e:
            return False
        return True
    finally:
        if oldstderr is not None:
            os.dup2(oldstderr, sys.stderr.fileno())
        if devnull is not None:
            devnull.close()
        shutil.rmtree(tmpdir)

def detect_openmp():
    "Does this compiler support OpenMP parallelization?"
    compiler = new_compiler()
    print('Attempting to autodetect OpenMP support...', end=' ')
    hasopenmp = hasfunction(compiler, 'omp_get_num_threads()')
    needs_gomp = hasopenmp
    if not hasopenmp:
        compiler.add_library('gomp')
        hasopenmp = hasfunction(compiler, 'omp_get_num_threads()')
        needs_gomp = hasopenmp
    print
    if hasopenmp:
        print('Compiler supports OpenMP')
    else:
        print('Did not detect OpenMP support; parallel RMSD disabled')
    return hasopenmp, needs_gomp

def detect_sse3():
    "Does this compiler support SSE3 intrinsics?"
    compiler = new_compiler()
    return hasfunction(compiler, '__m128 v; _mm_hadd_ps(v,v)',
                       include='<pmmintrin.h>',
                       extra_postargs=['-msse3'])

def detect_sse41():
    "Does this compiler support SSE4.1 intrinsics?"
    compiler = new_compiler()
    return hasfunction(compiler, '__m128 v; _mm_round_ps(v,0x00)',
                       include='<smmintrin.h>',
                       extra_postargs=['-msse4'])

################################################################################
# Declaration of the compiled extension modules (cython + c)
################################################################################

xtc = Extension('mdtraj.formats.xtc',
                sources=['MDTraj/formats/xtc/src/xdrfile.c',
                         'MDTraj/formats/xtc/src/xdrfile_xtc.c',
                         'MDTraj/formats/xtc/xtc.pyx'],
                include_dirs=['MDTraj/formats/xtc/include/',
                              'MDTraj/formats/xtc/', numpy.get_include()])

trr = Extension('mdtraj.formats.trr',
                sources=['MDTraj/formats/xtc/src/xdrfile.c',
                         'MDTraj/formats/xtc/src/xdrfile_trr.c',
                         'MDTraj/formats/xtc/trr.pyx'],
                include_dirs=['MDTraj/formats/xtc/include/',
                              'MDTraj/formats/xtc/', numpy.get_include()])

dcd = Extension('mdtraj.formats.dcd',
                sources=['MDTraj/formats/dcd/src/dcdplugin.c',
                         'MDTraj/formats/dcd/dcd.pyx'],
                include_dirs=["MDTraj/formats/dcd/include/",
                              'MDTraj/formats/dcd/', numpy.get_include()])

binpos = Extension('mdtraj.formats.binpos',
                   sources=['MDTraj/formats/binpos/src/binposplugin.c',
                            'MDTraj/formats/binpos/binpos.pyx'],
                   include_dirs=['MDTraj/formats/binpos/include/',
                                 'MDTraj/formats/binpos/', numpy.get_include()])

def rmsd_extension():
    openmp_enabled, needs_gomp = detect_openmp()
    compiler_args = ['-msse2' if not detect_sse3() else '-mssse3',
                     '-O3', '-funroll-loops']
    if new_compiler().compiler_type == 'msvc':
        compiler_args.append('/arch:SSE2')

    if openmp_enabled:
        compiler_args.append('-fopenmp')
    compiler_libraries = ['gomp'] if needs_gomp else []
    #compiler_defs = [('USE_OPENMP', None)] if openmp_enabled else []

    rmsd = Extension('mdtraj._rmsd',
                     sources=[
                         'MDTraj/rmsd/src/theobald_rmsd.c',
                         'MDTraj/rmsd/src/rotation.c',
                         'MDTraj/rmsd/src/center.c',
                         'MDTraj/rmsd/_rmsd.pyx'],
                     include_dirs=[
                         'MDTraj/rmsd/include', numpy.get_include()],
                     extra_compile_args=compiler_args,
                     #define_macros=compiler_defs,
                     libraries=compiler_libraries)
    return rmsd

def geometry():
    if not detect_sse3():
        return None

    extra_compile_args = ['-mssse3']
    define_macros = []
    if detect_sse41():
        define_macros.append(('__SSE4__', 1))
        define_macros.append(('__SSE4_1__', 1))
        extra_compile_args.append('-msse4')

    return Extension('mdtraj.geometry._geometry',
                     sources=['MDTraj/geometry/src/geometry.c',
                              'MDTraj/geometry/src/sasa.c',
                              'MDTraj/geometry/src/_geometry.pyx'],
                     include_dirs=['MDTraj/geometry/include', numpy.get_include()],
                     define_macros=define_macros,
                     extra_compile_args=extra_compile_args)

extensions = [xtc, trr, dcd, binpos, rmsd_extension()]
ext = geometry()
if ext is not None:
    extensions.append(ext)

write_version_py()
setup(name='mdtraj',
      author='Robert McGibbon',
      author_email='rmcgibbo@gmail.com',
      description=DOCLINES[0],
      long_description="\n".join(DOCLINES[2:]),
      version=__version__,
      license='LGPLv2.1+',
      url='http://rmcgibbo.github.io/mdtraj',
      platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
      classifiers=CLASSIFIERS.splitlines(),
      packages=find_packages(),
      package_dir={'mdtraj': 'MDTraj', 'mdtraj.scripts': 'scripts'},
      ext_modules=extensions,
      package_data={'mdtraj.formats.pdb': ['data/*'],
                    'mdtraj.testing': ['reference/*']},
      **setup_kwargs)
<commit_msg>Update setup.py after release to 0.8.1-dev<commit_after>"""MDTraj: a python library for loading, saving, and manipulating molecular dynamics trajectories.

MDTraj provides an easy to use python interface for manipulating MD trajectories.
It supports the reading and writing of molecular dynamics trajectories
in a variety of formats, including full support for PDB, DCD, XTC, TRR, binpos,
AMBER NetCDF, AMBER mdcrd and MDTraj HDF5. The package also provides a command line script
for converting trajectories between supported formats.
"""

from __future__ import print_function
DOCLINES = __doc__.split("\n")

import os
import sys
import shutil
import tempfile
import subprocess
from distutils.ccompiler import new_compiler
try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension

try:
    import numpy
except ImportError:
    print('Building and running mdtraj requires numpy', file=sys.stderr)
    sys.exit(1)

try:
    import Cython
    if Cython.__version__ < '0.18':
        raise ImportError
    from Cython.Distutils import build_ext
    setup_kwargs = {'cmdclass': {'build_ext': build_ext}}
except ImportError:
    print('Building from source requires cython >= 0.18', file=sys.stderr)
    exit(1)

try:
    sys.argv.remove('--no-install-deps')
    no_install_deps = True
except ValueError:
    no_install_deps = False

if 'setuptools' in sys.modules:
    setup_kwargs['zip_safe'] = False
    if not no_install_deps:
        setup_kwargs['install_requires'] = ['pandas>=0.9.0']
    setup_kwargs['entry_points'] = {'console_scripts':
              ['mdconvert = mdtraj.scripts.mdconvert:entry_point',
               'mdinspect = mdtraj.scripts.mdinspect:entry_point']}
else:
    setup_kwargs['scripts'] = ['scripts/mdconvert.py', 'scripts/mdinspect.py']

##########################
VERSION = "0.8.1"
ISRELEASED = False
__version__ = VERSION
##########################

CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Programming Language :: C
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""

def find_packages():
    """Find all of mdtraj's python packages.
    Adapted from IPython's setupbase.py. Copyright IPython
    contributors, licensed under the BSD license.
    """
    packages = ['mdtraj.scripts']
    for dir,subdirs,files in os.walk('MDTraj'):
        package = dir.replace(os.path.sep, '.')
        if '__init__.py' not in files:
            # not a package
            continue
        packages.append(package.replace('MDTraj', 'mdtraj'))
    return packages

################################################################################
# Writing version control information to the module
################################################################################

def git_version():
    # Return the git revision as a string
    # copied from numpy setup.py
    def _minimal_ext_cmd(cmd):
        # construct minimal environment
        env = {}
        for k in ['SYSTEMROOT', 'PATH']:
            v = os.environ.get(k)
            if v is not None:
                env[k] = v
        # LANGUAGE is used on win32
        env['LANGUAGE'] = 'C'
        env['LANG'] = 'C'
        env['LC_ALL'] = 'C'
        out = subprocess.Popen(
            cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
        return out

    try:
        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
        GIT_REVISION = out.strip().decode('ascii')
    except OSError:
        GIT_REVISION = 'Unknown'

    return GIT_REVISION

def write_version_py(filename='MDTraj/version.py'):
    cnt = """
# THIS FILE IS GENERATED FROM MDTRAJ SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s

if not release:
    version = full_version
"""
    # Adding the git rev number needs to be done inside write_version_py(),
    # otherwise the import of numpy.version messes up the build under Python 3.
    FULLVERSION = VERSION
    if os.path.exists('.git'):
        GIT_REVISION = git_version()
    else:
        GIT_REVISION = 'Unknown'

    if not ISRELEASED:
        FULLVERSION += '.dev-' + GIT_REVISION[:7]

    a = open(filename, 'w')
    try:
        a.write(cnt % {'version': VERSION,
                       'full_version': FULLVERSION,
                       'git_revision': GIT_REVISION,
                       'isrelease': str(ISRELEASED)})
    finally:
        a.close()

################################################################################
# Detection of compiler capabilities
################################################################################

def hasfunction(cc, funcname, include=None, extra_postargs=None):
    # From http://stackoverflow.com/questions/
    #            7018879/disabling-output-when-compiling-with-distutils
    tmpdir = tempfile.mkdtemp(prefix='hasfunction-')
    devnull = oldstderr = None
    try:
        try:
            fname = os.path.join(tmpdir, 'funcname.c')
            f = open(fname, 'w')
            if include is not None:
                f.write('#include %s\n' % include)
            f.write('int main(void) {\n')
            f.write('    %s;\n' % funcname)
            f.write('}\n')
            f.close()
            devnull = open(os.devnull, 'w')
            oldstderr = os.dup(sys.stderr.fileno())
            os.dup2(devnull.fileno(), sys.stderr.fileno())
            objects = cc.compile([fname], output_dir=tmpdir,
                                 extra_postargs=extra_postargs)
            cc.link_executable(objects, os.path.join(tmpdir, 'a.out'))
        except Exception as e:
            return False
        return True
    finally:
        if oldstderr is not None:
            os.dup2(oldstderr, sys.stderr.fileno())
        if devnull is not None:
            devnull.close()
        shutil.rmtree(tmpdir)

def detect_openmp():
    "Does this compiler support OpenMP parallelization?"
    compiler = new_compiler()
    print('Attempting to autodetect OpenMP support...', end=' ')
    hasopenmp = hasfunction(compiler, 'omp_get_num_threads()')
    needs_gomp = hasopenmp
    if not hasopenmp:
        compiler.add_library('gomp')
        hasopenmp = hasfunction(compiler, 'omp_get_num_threads()')
        needs_gomp = hasopenmp
    print
    if hasopenmp:
        print('Compiler supports OpenMP')
    else:
        print('Did not detect OpenMP support; parallel RMSD disabled')
    return hasopenmp, needs_gomp

def detect_sse3():
    "Does this compiler support SSE3 intrinsics?"
    compiler = new_compiler()
    return hasfunction(compiler, '__m128 v; _mm_hadd_ps(v,v)',
                       include='<pmmintrin.h>',
                       extra_postargs=['-msse3'])

def detect_sse41():
    "Does this compiler support SSE4.1 intrinsics?"
    compiler = new_compiler()
    return hasfunction(compiler, '__m128 v; _mm_round_ps(v,0x00)',
                       include='<smmintrin.h>',
                       extra_postargs=['-msse4'])

################################################################################
# Declaration of the compiled extension modules (cython + c)
################################################################################

xtc = Extension('mdtraj.formats.xtc',
                sources=['MDTraj/formats/xtc/src/xdrfile.c',
                         'MDTraj/formats/xtc/src/xdrfile_xtc.c',
                         'MDTraj/formats/xtc/xtc.pyx'],
                include_dirs=['MDTraj/formats/xtc/include/',
                              'MDTraj/formats/xtc/', numpy.get_include()])

trr = Extension('mdtraj.formats.trr',
                sources=['MDTraj/formats/xtc/src/xdrfile.c',
                         'MDTraj/formats/xtc/src/xdrfile_trr.c',
                         'MDTraj/formats/xtc/trr.pyx'],
                include_dirs=['MDTraj/formats/xtc/include/',
                              'MDTraj/formats/xtc/', numpy.get_include()])

dcd = Extension('mdtraj.formats.dcd',
                sources=['MDTraj/formats/dcd/src/dcdplugin.c',
                         'MDTraj/formats/dcd/dcd.pyx'],
                include_dirs=["MDTraj/formats/dcd/include/",
                              'MDTraj/formats/dcd/', numpy.get_include()])

binpos = Extension('mdtraj.formats.binpos',
                   sources=['MDTraj/formats/binpos/src/binposplugin.c',
                            'MDTraj/formats/binpos/binpos.pyx'],
                   include_dirs=['MDTraj/formats/binpos/include/',
                                 'MDTraj/formats/binpos/', numpy.get_include()])

def rmsd_extension():
    openmp_enabled, needs_gomp = detect_openmp()
    compiler_args = ['-msse2' if not detect_sse3() else '-mssse3',
                     '-O3', '-funroll-loops']
    if new_compiler().compiler_type == 'msvc':
        compiler_args.append('/arch:SSE2')

    if openmp_enabled:
        compiler_args.append('-fopenmp')
    compiler_libraries = ['gomp'] if needs_gomp else []
    #compiler_defs = [('USE_OPENMP', None)] if openmp_enabled else []

    rmsd = Extension('mdtraj._rmsd',
                     sources=[
                         'MDTraj/rmsd/src/theobald_rmsd.c',
                         'MDTraj/rmsd/src/rotation.c',
                         'MDTraj/rmsd/src/center.c',
                         'MDTraj/rmsd/_rmsd.pyx'],
                     include_dirs=[
                         'MDTraj/rmsd/include', numpy.get_include()],
                     extra_compile_args=compiler_args,
                     #define_macros=compiler_defs,
                     libraries=compiler_libraries)
    return rmsd

def geometry():
    if not detect_sse3():
        return None

    extra_compile_args = ['-mssse3']
    define_macros = []
    if detect_sse41():
        define_macros.append(('__SSE4__', 1))
        define_macros.append(('__SSE4_1__', 1))
        extra_compile_args.append('-msse4')

    return Extension('mdtraj.geometry._geometry',
                     sources=['MDTraj/geometry/src/geometry.c',
                              'MDTraj/geometry/src/sasa.c',
                              'MDTraj/geometry/src/_geometry.pyx'],
                     include_dirs=['MDTraj/geometry/include', numpy.get_include()],
                     define_macros=define_macros,
                     extra_compile_args=extra_compile_args)

extensions = [xtc, trr, dcd, binpos, rmsd_extension()]
ext = geometry()
if ext is not None:
    extensions.append(ext)

write_version_py()
setup(name='mdtraj',
      author='Robert McGibbon',
      author_email='rmcgibbo@gmail.com',
      description=DOCLINES[0],
      long_description="\n".join(DOCLINES[2:]),
      version=__version__,
      license='LGPLv2.1+',
      url='http://rmcgibbo.github.io/mdtraj',
      platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
      classifiers=CLASSIFIERS.splitlines(),
      packages=find_packages(),
      package_dir={'mdtraj': 'MDTraj', 'mdtraj.scripts': 'scripts'},
      ext_modules=extensions,
      package_data={'mdtraj.formats.pdb': ['data/*'],
                    'mdtraj.testing': ['reference/*']},
      **setup_kwargs)
<|endoftext|>


<commit_before>from setuptools import setup
from setuptools import find_packages

def readme():
    with open('README.md', encoding='utf-8') as file:
        return file.read()

def license():
    with open('LICENSE.txt', encoding='utf-8') as file:
        return file.read()

setup(
    name='nalaf',
    version='0.5.2',
    description='Natural Language Framework, for NER and RE',
    long_description=readme(),
    classifiers=[
        'Natural Language :: English',
        'Programming Language :: Python :: 3.5',
        'Topic :: Text Processing :: Linguistic'
    ],
    keywords='nlp ner re natural langauge crf svm extraction entities relationships framework',
    url='https://github.com/Rostlab/nalaf',
    author='Aleksandar Bojchevski, Carsten Uhlig, Juan Miguel Cejuela',
    author_email='i@juanmi.rocks',
    license=license(),
    packages=find_packages(exclude=['tests']),
    install_requires=[
        # ML
        'numpy == 1.11.2',
        'scipy == 0.18.1',  # or 0.19.0
        'scikit-learn == 0.18.1',
        'spacy == 1.2.0',
        'nltk == 3.2.1',
        'gensim == 0.13.3',
        'python-crfsuite == 0.8.4',

        # Other
        'beautifulsoup4 >= 4.5.1',
        'requests >= 2.8.1',
        'progress >= 1.2',
        'hdfs == 2.1.0'
    ],
    include_package_data=True,
    zip_safe=False,
    test_suite='nose.collector',
    setup_requires=['nose>=1.0'],
)
<commit_msg>bump 0.5.4 🏖<commit_after>from setuptools import setup
from setuptools import find_packages

def readme():
    with open('README.md', encoding='utf-8') as file:
        return file.read()

def license():
    with open('LICENSE.txt', encoding='utf-8') as file:
        return file.read()

setup(
    name='nalaf',
    version='0.5.4',
    description='Natural Language Framework, for NER and RE',
    long_description=readme(),
    classifiers=[
        'Natural Language :: English',
        'Programming Language :: Python :: 3.5',
        'Topic :: Text Processing :: Linguistic'
    ],
    keywords='nlp ner re natural langauge crf svm extraction entities relationships framework',
    url='https://github.com/Rostlab/nalaf',
    author='Aleksandar Bojchevski, Carsten Uhlig, Juan Miguel Cejuela',
    author_email='i@juanmi.rocks',
    license=license(),
    packages=find_packages(exclude=['tests']),
    install_requires=[
        # ML
        'numpy == 1.11.2',
        'scipy == 0.18.1',  # or 0.19.0
        'scikit-learn == 0.18.1',
        'spacy == 1.2.0',
        'nltk == 3.2.1',
        'gensim == 0.13.3',
        'python-crfsuite == 0.8.4',

        # Other
        'beautifulsoup4 >= 4.5.1',
        'requests >= 2.8.1',
        'progress >= 1.2',
        'hdfs == 2.1.0'
    ],
    include_package_data=True,
    zip_safe=False,
    test_suite='nose.collector',
    setup_requires=['nose>=1.0'],
)
<|endoftext|>


<commit_before>__author__ = 'seanfitz'

from setuptools import setup

setup(
    name = "adapt-parser",
    version = "0.3.1",
    author = "Sean Fitzgerald",
    author_email = "sean@fitzgeralds.me",
    description = ("A text-to-intent parsing framework."),
    license = ("LGPL-3"),
    keywords = "natural language processing",
    url = "https://github.com/MycroftAI/adapt",
    packages = ["adapt", "adapt.tools", "adapt.tools.text"],

    install_requires = [
        "pyee==5.0.0",
        "six==1.10.0"
    ]
)
<commit_msg>Update version number<commit_after>__author__ = 'seanfitz'

from setuptools import setup

setup(
    name = "adapt-parser",
    version = "0.3.2",
    author = "Sean Fitzgerald",
    author_email = "sean@fitzgeralds.me",
    description = ("A text-to-intent parsing framework."),
    license = ("LGPL-3"),
    keywords = "natural language processing",
    url = "https://github.com/MycroftAI/adapt",
    packages = ["adapt", "adapt.tools", "adapt.tools.text"],

    install_requires = [
        "pyee==5.0.0",
        "six==1.10.0"
    ]
)
<|endoftext|>


<commit_before>from distutils.core import setup

setup(
    name='geonition_utils',
    version='4.1.1',
    author='Kristoffer Snabb',
    url='https://github.com/geonition/django_geonition_utils',
    packages=['geonition_utils'],
    install_requires=['django',
                      'pymongo'],
)
<commit_msg>increased version number in setup file<commit_after>from distutils.core import setup

setup(
    name='geonition_utils',
    version='4.0.2',
    author='Kristoffer Snabb',
    url='https://github.com/geonition/django_geonition_utils',
    packages=['geonition_utils'],
    install_requires=['django',
                      'pymongo'],
)
<|endoftext|>


<commit_before># This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from __future__ import absolute_import, division, print_function

import os
import platform
import subprocess
import sys
from distutils.command.build import build

import pkg_resources

from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools.command.test import test

base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "src")

# When executing the setup.py, we need to be able to import ourselves, this
# means that we need to add the src/ directory to the sys.path.
sys.path.insert(0, src_dir)

about = {}
with open(os.path.join(src_dir, "cryptography", "__about__.py")) as f:
    exec(f.read(), about)

VECTORS_DEPENDENCY = "cryptography_vectors=={0}".format(about['__version__'])

requirements = [
    "idna",
    "pyasn1",
    "six>=1.4.1",
    "setuptools"
]

if sys.version_info < (3, 4):
    requirements.append("enum34")

if sys.version_info < (3, 3):
    requirements.append("ipaddress")

if platform.python_implementation() != "PyPy":
    requirements.append("cffi>=0.8")

# If you add a new dep here you probably need to add it in the tox.ini as well
test_requirements = [
    "pytest",
    "pretend",
    "iso8601",
]

# If there's no vectors locally that probably means we are in a tarball and
# need to go and get the matching vectors package from PyPi
if not os.path.exists(os.path.join(base_dir, "vectors/setup.py")):
    test_requirements.append(VECTORS_DEPENDENCY)

def cc_is_available():
    return sys.platform == "darwin" and list(map(
        int, platform.mac_ver()[0].split("."))) >= [10, 8, 0]

backends = [
    "openssl = cryptography.hazmat.backends.openssl:backend"
]

if cc_is_available():
    backends.append(
        "commoncrypto = cryptography.hazmat.backends.commoncrypto:backend",
    )

def get_ext_modules():
    from cryptography.hazmat.bindings.commoncrypto.binding import (
        Binding as CommonCryptoBinding
    )
    from cryptography.hazmat.bindings.openssl.binding import (
        Binding as OpenSSLBinding
    )
    from cryptography.hazmat.primitives import constant_time, padding

    ext_modules = [
        OpenSSLBinding.ffi.verifier.get_extension(),
        constant_time._ffi.verifier.get_extension(),
        padding._ffi.verifier.get_extension()
    ]
    if cc_is_available():
        ext_modules.append(CommonCryptoBinding.ffi.verifier.get_extension())
    return ext_modules

class CFFIBuild(build):
    """
    This class exists, instead of just providing ``ext_modules=[...]`` directly
    in ``setup()`` because importing cryptography requires we have several
    packages installed first.

    By doing the imports here we ensure that packages listed in
    ``setup_requires`` are already installed.
    """

    def finalize_options(self):
        self.distribution.ext_modules = get_ext_modules()
        build.finalize_options(self)

class CFFIInstall(install):
    """
    As a consequence of CFFIBuild and it's late addition of ext_modules, we
    need the equivalent for the ``install`` command to install into platlib
    install-dir rather than purelib.
    """

    def finalize_options(self):
        self.distribution.ext_modules = get_ext_modules()
        install.finalize_options(self)

class PyTest(test):
    def finalize_options(self):
        test.finalize_options(self)
        self.test_args = []
        self.test_suite = True

        # This means there's a vectors/ folder with the package in here.
        # cd into it, install the vectors package and then refresh sys.path
        if VECTORS_DEPENDENCY not in test_requirements:
            subprocess.check_call(
                [sys.executable, "setup.py", "install"], cwd="vectors"
            )
            pkg_resources.get_distribution("cryptography_vectors").activate()

    def run_tests(self):
        # Import here because in module scope the eggs are not loaded.
        import pytest
        test_args = [os.path.join(base_dir, "tests")]
        errno = pytest.main(test_args)
        sys.exit(errno)

def keywords_with_side_effects(argv):
    """
    Get a dictionary with setup keywords that (can) have side effects.

    :param argv: A list of strings with command line arguments.
    :returns: A dictionary with keyword arguments for the ``setup()`` function.

    This setup.py script uses the setuptools 'setup_requires' feature because
    this is required by the cffi package to compile extension modules. The
    purpose of ``keywords_with_side_effects()`` is to avoid triggering the cffi
    build process as a result of setup.py invocations that don't need the cffi
    module to be built (setup.py serves the dual purpose of exposing package
    metadata).

    All of the options listed by ``python setup.py --help`` that print
    information should be recognized here. The commands ``clean``,
    ``egg_info``, ``register``, ``sdist`` and ``upload`` are also recognized.
    Any combination of these options and commands is also supported.

    This function was originally based on the `setup.py script`_ of SciPy (see
    also the discussion in `pip issue #25`_).

    .. _pip issue #25: https://github.com/pypa/pip/issues/25
    .. _setup.py script: https://github.com/scipy/scipy/blob/master/setup.py
    """
    no_setup_requires_arguments = (
        '-h', '--help',
        '-n', '--dry-run',
        '-q', '--quiet',
        '-v', '--verbose',
        '-V', '--version',
        '--author',
        '--author-email',
        '--classifiers',
        '--contact',
        '--contact-email',
        '--description',
        '--egg-base',
        '--fullname',
        '--help-commands',
        '--keywords',
        '--licence',
        '--license',
        '--long-description',
        '--maintainer',
        '--maintainer-email',
        '--name',
        '--no-user-cfg',
        '--obsoletes',
        '--platforms',
        '--provides',
        '--requires',
        '--url',
        'clean',
        'egg_info',
        'register',
        'sdist',
        'upload',
    )

    def is_short_option(argument):
        """Check whether a command line argument is a short option."""
        return len(argument) >= 2 and argument[0] == '-' and argument[1] != '-'

    def expand_short_options(argument):
        """Expand combined short options into canonical short options."""
        return ('-' + char for char in argument[1:])

    def argument_without_setup_requirements(argv, i):
        """Check whether a command line argument needs setup requirements."""
        if argv[i] in no_setup_requires_arguments:
            # Simple case: An argument which is either an option or a command
            # which doesn't need setup requirements.
            return True
        elif (is_short_option(argv[i]) and
              all(option in no_setup_requires_arguments
                  for option in expand_short_options(argv[i]))):
            # Not so simple case: Combined short options none of which need
            # setup requirements.
            return True
        elif argv[i - 1:i] == ['--egg-base']:
            # Tricky case: --egg-info takes an argument which should not make
            # us use setup_requires (defeating the purpose of this code).
            return True
        else:
            return False

    if all(argument_without_setup_requirements(argv, i)
           for i in range(1, len(argv))):
        return {
            "cmdclass": {
                "build": DummyCFFIBuild,
                "install": DummyCFFIInstall,
                "test": DummyPyTest,
            }
        }
    else:
        return {
            "setup_requires": requirements,
            "cmdclass": {
                "build": CFFIBuild,
                "install": CFFIInstall,
                "test": PyTest,
            }
        }

setup_requires_error = ("Requested setup command that needs 'setup_requires' "
                        "while command line arguments implied a side effect "
                        "free command or option.")

class DummyCFFIBuild(build):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py build`` as
    one of the 'side effect free' commands or options.
    """

    def run(self):
        raise RuntimeError(setup_requires_error)

class DummyCFFIInstall(install):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py install``
    as one of the 'side effect free' commands or options.
    """

    def run(self):
        raise RuntimeError(setup_requires_error)

class DummyPyTest(test):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py test`` as
    one of the 'side effect free' commands or options.
    """

    def run_tests(self):
        raise RuntimeError(setup_requires_error)

with open(os.path.join(base_dir, "README.rst")) as f:
    long_description = f.read()

setup(
    name=about["__title__"],
    version=about["__version__"],

    description=about["__summary__"],
    long_description=long_description,
    license=about["__license__"],
    url=about["__uri__"],

    author=about["__author__"],
    author_email=about["__email__"],

    classifiers=[
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "License :: OSI Approved :: BSD License",
        "Natural Language :: English",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Operating System :: POSIX :: BSD",
        "Operating System :: POSIX :: Linux",
        "Operating System :: Microsoft :: Windows",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Security :: Cryptography",
    ],

    package_dir={"": "src"},
    packages=find_packages(where="src", exclude=["tests", "tests.*"]),
    include_package_data=True,

    install_requires=requirements,
    tests_require=test_requirements,

    # for cffi
    zip_safe=False,
    ext_package="cryptography",
    entry_points={
        "cryptography.backends": backends,
    },
    **keywords_with_side_effects(sys.argv)
)
<commit_msg>require idna 2.0 or better because it's better<commit_after># This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from __future__ import absolute_import, division, print_function

import os
import platform
import subprocess
import sys
from distutils.command.build import build

import pkg_resources

from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools.command.test import test

base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "src")

# When executing the setup.py, we need to be able to import ourselves, this
# means that we need to add the src/ directory to the sys.path.
sys.path.insert(0, src_dir)

about = {}
with open(os.path.join(src_dir, "cryptography", "__about__.py")) as f:
    exec(f.read(), about)

VECTORS_DEPENDENCY = "cryptography_vectors=={0}".format(about['__version__'])

requirements = [
    "idna>=2.0",
    "pyasn1",
    "six>=1.4.1",
    "setuptools"
]

if sys.version_info < (3, 4):
    requirements.append("enum34")

if sys.version_info < (3, 3):
    requirements.append("ipaddress")

if platform.python_implementation() != "PyPy":
    requirements.append("cffi>=0.8")

# If you add a new dep here you probably need to add it in the tox.ini as well
test_requirements = [
    "pytest",
    "pretend",
    "iso8601",
]

# If there's no vectors locally that probably means we are in a tarball and
# need to go and get the matching vectors package from PyPi
if not os.path.exists(os.path.join(base_dir, "vectors/setup.py")):
    test_requirements.append(VECTORS_DEPENDENCY)

def cc_is_available():
    return sys.platform == "darwin" and list(map(
        int, platform.mac_ver()[0].split("."))) >= [10, 8, 0]

backends = [
    "openssl = cryptography.hazmat.backends.openssl:backend"
]

if cc_is_available():
    backends.append(
        "commoncrypto = cryptography.hazmat.backends.commoncrypto:backend",
    )

def get_ext_modules():
    from cryptography.hazmat.bindings.commoncrypto.binding import (
        Binding as CommonCryptoBinding
    )
    from cryptography.hazmat.bindings.openssl.binding import (
        Binding as OpenSSLBinding
    )
    from cryptography.hazmat.primitives import constant_time, padding

    ext_modules = [
        OpenSSLBinding.ffi.verifier.get_extension(),
        constant_time._ffi.verifier.get_extension(),
        padding._ffi.verifier.get_extension()
    ]
    if cc_is_available():
        ext_modules.append(CommonCryptoBinding.ffi.verifier.get_extension())
    return ext_modules

class CFFIBuild(build):
    """
    This class exists, instead of just providing ``ext_modules=[...]`` directly
    in ``setup()`` because importing cryptography requires we have several
    packages installed first.

    By doing the imports here we ensure that packages listed in
    ``setup_requires`` are already installed.
    """

    def finalize_options(self):
        self.distribution.ext_modules = get_ext_modules()
        build.finalize_options(self)

class CFFIInstall(install):
    """
    As a consequence of CFFIBuild and it's late addition of ext_modules, we
    need the equivalent for the ``install`` command to install into platlib
    install-dir rather than purelib.
    """

    def finalize_options(self):
        self.distribution.ext_modules = get_ext_modules()
        install.finalize_options(self)

class PyTest(test):
    def finalize_options(self):
        test.finalize_options(self)
        self.test_args = []
        self.test_suite = True

        # This means there's a vectors/ folder with the package in here.
        # cd into it, install the vectors package and then refresh sys.path
        if VECTORS_DEPENDENCY not in test_requirements:
            subprocess.check_call(
                [sys.executable, "setup.py", "install"], cwd="vectors"
            )
            pkg_resources.get_distribution("cryptography_vectors").activate()

    def run_tests(self):
        # Import here because in module scope the eggs are not loaded.
        import pytest
        test_args = [os.path.join(base_dir, "tests")]
        errno = pytest.main(test_args)
        sys.exit(errno)

def keywords_with_side_effects(argv):
    """
    Get a dictionary with setup keywords that (can) have side effects.

    :param argv: A list of strings with command line arguments.
    :returns: A dictionary with keyword arguments for the ``setup()`` function.

    This setup.py script uses the setuptools 'setup_requires' feature because
    this is required by the cffi package to compile extension modules. The
    purpose of ``keywords_with_side_effects()`` is to avoid triggering the cffi
    build process as a result of setup.py invocations that don't need the cffi
    module to be built (setup.py serves the dual purpose of exposing package
    metadata).

    All of the options listed by ``python setup.py --help`` that print
    information should be recognized here. The commands ``clean``,
    ``egg_info``, ``register``, ``sdist`` and ``upload`` are also recognized.
    Any combination of these options and commands is also supported.

    This function was originally based on the `setup.py script`_ of SciPy (see
    also the discussion in `pip issue #25`_).

    .. _pip issue #25: https://github.com/pypa/pip/issues/25
    .. _setup.py script: https://github.com/scipy/scipy/blob/master/setup.py
    """
    no_setup_requires_arguments = (
        '-h', '--help',
        '-n', '--dry-run',
        '-q', '--quiet',
        '-v', '--verbose',
        '-V', '--version',
        '--author',
        '--author-email',
        '--classifiers',
        '--contact',
        '--contact-email',
        '--description',
        '--egg-base',
        '--fullname',
        '--help-commands',
        '--keywords',
        '--licence',
        '--license',
        '--long-description',
        '--maintainer',
        '--maintainer-email',
        '--name',
        '--no-user-cfg',
        '--obsoletes',
        '--platforms',
        '--provides',
        '--requires',
        '--url',
        'clean',
        'egg_info',
        'register',
        'sdist',
        'upload',
    )

    def is_short_option(argument):
        """Check whether a command line argument is a short option."""
        return len(argument) >= 2 and argument[0] == '-' and argument[1] != '-'

    def expand_short_options(argument):
        """Expand combined short options into canonical short options."""
        return ('-' + char for char in argument[1:])

    def argument_without_setup_requirements(argv, i):
        """Check whether a command line argument needs setup requirements."""
        if argv[i] in no_setup_requires_arguments:
            # Simple case: An argument which is either an option or a command
            # which doesn't need setup requirements.
            return True
        elif (is_short_option(argv[i]) and
              all(option in no_setup_requires_arguments
                  for option in expand_short_options(argv[i]))):
            # Not so simple case: Combined short options none of which need
            # setup requirements.
            return True
        elif argv[i - 1:i] == ['--egg-base']:
            # Tricky case: --egg-info takes an argument which should not make
            # us use setup_requires (defeating the purpose of this code).
            return True
        else:
            return False

    if all(argument_without_setup_requirements(argv, i)
           for i in range(1, len(argv))):
        return {
            "cmdclass": {
                "build": DummyCFFIBuild,
                "install": DummyCFFIInstall,
                "test": DummyPyTest,
            }
        }
    else:
        return {
            "setup_requires": requirements,
            "cmdclass": {
                "build": CFFIBuild,
                "install": CFFIInstall,
                "test": PyTest,
            }
        }

setup_requires_error = ("Requested setup command that needs 'setup_requires' "
                        "while command line arguments implied a side effect "
                        "free command or option.")

class DummyCFFIBuild(build):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py build`` as
    one of the 'side effect free' commands or options.
    """

    def run(self):
        raise RuntimeError(setup_requires_error)

class DummyCFFIInstall(install):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py install``
    as one of the 'side effect free' commands or options.
    """

    def run(self):
        raise RuntimeError(setup_requires_error)

class DummyPyTest(test):
    """
    This class makes it very obvious when ``keywords_with_side_effects()`` has
    incorrectly interpreted the command line arguments to ``setup.py test`` as
    one of the 'side effect free' commands or options.
    """

    def run_tests(self):
        raise RuntimeError(setup_requires_error)

with open(os.path.join(base_dir, "README.rst")) as f:
    long_description = f.read()

setup(
    name=about["__title__"],
    version=about["__version__"],

    description=about["__summary__"],
    long_description=long_description,
    license=about["__license__"],
    url=about["__uri__"],

    author=about["__author__"],
    author_email=about["__email__"],

    classifiers=[
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "License :: OSI Approved :: BSD License",
        "Natural Language :: English",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Operating System :: POSIX :: BSD",
        "Operating System :: POSIX :: Linux",
        "Operating System :: Microsoft :: Windows",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Security :: Cryptography",
    ],

    package_dir={"": "src"},
    packages=find_packages(where="src", exclude=["tests", "tests.*"]),
    include_package_data=True,

    install_requires=requirements,
    tests_require=test_requirements,

    # for cffi
    zip_safe=False,
    ext_package="cryptography",
    entry_points={
        "cryptography.backends": backends,
    },
    **keywords_with_side_effects(sys.argv)
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name="pyfluka",
    version="prototype",
    packages=find_packages(),
    scripts=["analysistest/run.py"],

    # Project uses reStructuredText, so ensure that the docutils get
    # installed or upgraded on the target machine
    install_requires=['numpy>=1.0',
                      'matplotlib>=1.3.1',
                      'networkx>=1.11',
                      'PyYAML>=3.11',
                      'tabulate>=0.7.5',
                      'pint>=0.7.2'
                      'yamlordereddictloader>=0.1.0'],

    package_data={

    },

    # metadata for upload to PyPI
    author="Marcus Matthias Morgenstern",
    author_email="marcus.matthias.morgenstern@cern.ch",
    description="pyfluka package",
    license="MIT",
    keywords="FLUKA MC data analysis physics radiation protection",
    url="https://github.com/morgenst/pyfluka"
)<commit_msg>fix typo in pint<commit_after>from setuptools import setup, find_packages

setup(
    name="pyfluka",
    version="prototype",
    packages=find_packages(),
    scripts=["analysistest/run.py"],

    # Project uses reStructuredText, so ensure that the docutils get
    # installed or upgraded on the target machine
    install_requires=['numpy>=1.0',
                      'matplotlib>=1.3.1',
                      'networkx>=1.11',
                      'PyYAML>=3.11',
                      'tabulate>=0.7.5',
                      'pint>=0.6',
                      'yamlordereddictloader>=0.1.0'],

    package_data={

    },

    # metadata for upload to PyPI
    author="Marcus Matthias Morgenstern",
    author_email="marcus.matthias.morgenstern@cern.ch",
    description="pyfluka package",
    license="MIT",
    keywords="FLUKA MC data analysis physics radiation protection",
    url="https://github.com/morgenst/pyfluka"
)<|endoftext|>


<commit_before>from setuptools import setup
import os

file_dir = os.path.dirname(__file__)
if file_dir: os.chdir(file_dir)

packages = []
for dirpath, dirnames, filenames in os.walk('mapit'):
    if '__init__.py' in filenames:
        packages.append(dirpath.replace('/', '.'))

setup(
    name='django-mapit',
    version='1.0.0pr2',
    description='A web service for mapping postcodes and points to current or past administrative area information and polygons.',
    long_description=open('README').read(), # TODO: Put this into ReST format
    author='mySociety',
    author_email='mapit@mysociety.org',
    url='https://github.com/mysociety/mapit',
    license='LICENSE.txt',

    # TODO: Use find_packages from setuptools
    packages=packages,

    # TODO: Use include_package_data=True from setuptools
    package_data={
        'mapit': [
            'templates/mapit/*.html',
            'templates/*/mapit/*.html',
            'static/mapit/*',
            'fixtures/*.json',
            'sql/*.sql',
    ] },

    install_requires=[ 'distribute', 'memcache', 'gdal', 'django', 'yaml', 'psycopg2', 'south' ],

    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Topic :: Database :: Front-Ends',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Scientific/Engineering :: GIS',
    ],

    zip_safe=False, # So that easy_install doesn't make an egg
)
<commit_msg>Correct entries in install_requires<commit_after>from setuptools import setup
import os

file_dir = os.path.dirname(__file__)
if file_dir: os.chdir(file_dir)

packages = []
for dirpath, dirnames, filenames in os.walk('mapit'):
    if '__init__.py' in filenames:
        packages.append(dirpath.replace('/', '.'))

setup(
    name='django-mapit',
    version='1.0.0pr2',
    description='A web service for mapping postcodes and points to current or past administrative area information and polygons.',
    long_description=open('README').read(), # TODO: Put this into ReST format
    author='mySociety',
    author_email='mapit@mysociety.org',
    url='https://github.com/mysociety/mapit',
    license='LICENSE.txt',

    # TODO: Use find_packages from setuptools
    packages=packages,

    # TODO: Use include_package_data=True from setuptools
    package_data={
        'mapit': [
            'templates/mapit/*.html',
            'templates/*/mapit/*.html',
            'static/mapit/*',
            'fixtures/*.json',
            'sql/*.sql',
    ] },

    install_requires=[ 'distribute', 'python-memcached', 'Django', 'PyYAML', 'psycopg2', 'South', 'GDAL' ],

    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'License :: OSI Approved :: GNU Affero General Public License v3',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Topic :: Database :: Front-Ends',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Scientific/Engineering :: GIS',
    ],

    zip_safe=False, # So that easy_install doesn't make an egg
)
<|endoftext|>


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

from distutils.core import setup

version = '0.0.1'

setup(
    name='hyperloglog',
    version=version,
    maintainer='Vasily Evseenko',
    maintainer_email='svpcom@gmail.com',
    packages=['hyperloglog', 'hyperloglog.test'],
    license='LGPL',
    long_description=open('README.rst').read(),
)
<commit_msg>Fix description<commit_after>#!/usr/bin/env python

from distutils.core import setup

version = '0.0.2'

setup(
    name='hyperloglog',
    version=version,
    maintainer='Vasily Evseenko',
    maintainer_email='svpcom@gmail.com',
    packages=['hyperloglog', 'hyperloglog.test'],
    license='LGPL',
    long_description=\
"""
Python implementation of the Hyper LogLog cardinality counter
algorithms.

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.76.4286
""",
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='django_cradmin',
    description='A role based admin UI for Django that produces a user friendly and beautiful UI.',
    version='1.0.0b51',
    url='https://github.com/appressoas/django_cradmin',
    author='Espen Angell Kristiansen, Tor Johansen, Vegard Angell, Magne Westlie',
    author_email='post@appresso.no',
    license='BSD',
    packages=find_packages(
        exclude=[
            'ez_setup',
            'tasks'
        ]),
    zip_safe=False,
    include_package_data=True,
    install_requires=[
        'setuptools',
        'django-crispy-forms',
        'Django',
        'django-multiupload',
        'Jinja2',
        'pytz',
        'future',
        'html2text',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved',
        'Operating System :: OS Independent',
        'Programming Language :: Python'
    ]
)
<commit_msg>Released 1.0.1b1.<commit_after>from setuptools import setup, find_packages

setup(
    name='django_cradmin',
    description='A role based admin UI for Django that produces a user friendly and beautiful UI.',
    version='1.0.1b1',
    url='https://github.com/appressoas/django_cradmin',
    author='Espen Angell Kristiansen, Tor Johansen, Vegard Angell, Magne Westlie',
    author_email='post@appresso.no',
    license='BSD',
    packages=find_packages(
        exclude=[
            'ez_setup',
            'tasks'
        ]),
    zip_safe=False,
    include_package_data=True,
    install_requires=[
        'setuptools',
        'django-crispy-forms',
        'Django',
        'django-multiupload',
        'Jinja2',
        'pytz',
        'future',
        'html2text',
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved',
        'Operating System :: OS Independent',
        'Programming Language :: Python'
    ]
)
<|endoftext|>


<commit_before># Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import setuptools
import sys

from quantum.openstack.common import setup

requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()

if sys.platform == 'win32':
    requires.append('pywin32')
    requires.append('wmi')
    requires.remove('pyudev')

Name = 'quantum'
Url = "https://launchpad.net/quantum"
Version = setup.get_version(Name, '2013.2')
License = 'Apache License 2.0'
Author = 'OpenStack'
AuthorEmail = 'openstack-dev@lists.openstack.org'
Maintainer = ''
Summary = 'Quantum (virtual network service)'
ShortDescription = Summary
Description = Summary

EagerResources = [
    'quantum',
]

config_path = 'etc/quantum/'
init_path = 'etc/init.d'
rootwrap_path = 'etc/quantum/rootwrap.d'
ovs_plugin_config_path = 'etc/quantum/plugins/openvswitch'
bigswitch_plugin_config_path = 'etc/quantum/plugins/bigswitch'
brocade_plugin_config_path = 'etc/quantum/plugins/brocade'
cisco_plugin_config_path = 'etc/quantum/plugins/cisco'
linuxbridge_plugin_config_path = 'etc/quantum/plugins/linuxbridge'
nvp_plugin_config_path = 'etc/quantum/plugins/nicira'
ryu_plugin_config_path = 'etc/quantum/plugins/ryu'
meta_plugin_config_path = 'etc/quantum/plugins/metaplugin'
nec_plugin_config_path = 'etc/quantum/plugins/nec'
hyperv_plugin_config_path = 'etc/quantum/plugins/hyperv'
plumgrid_plugin_config_path = 'etc/quantum/plugins/plumgrid'
midonet_plugin_config_path = 'etc/quantum/plugins/midonet'

if sys.platform == 'win32':
    # Windows doesn't have an "/etc" directory equivalent
    DataFiles = []

    ConsoleScripts = [
        'quantum-hyperv-agent = '
        'quantum.plugins.hyperv.agent.hyperv_quantum_agent:main',
        'quantum-server = quantum.server:main',
        'quantum-db-manage = quantum.db.migration.cli:main',
    ]

    ProjectScripts = []
else:
    DataFiles = [
        (config_path,
            ['etc/quantum.conf',
             'etc/rootwrap.conf',
             'etc/api-paste.ini',
             'etc/policy.json',
             'etc/dhcp_agent.ini',
             'etc/l3_agent.ini',
             'etc/metadata_agent.ini',
             'etc/lbaas_agent.ini']),
        (rootwrap_path,
            ['etc/quantum/rootwrap.d/dhcp.filters',
             'etc/quantum/rootwrap.d/iptables-firewall.filters',
             'etc/quantum/rootwrap.d/l3.filters',
             'etc/quantum/rootwrap.d/linuxbridge-plugin.filters',
             'etc/quantum/rootwrap.d/nec-plugin.filters',
             'etc/quantum/rootwrap.d/openvswitch-plugin.filters',
             'etc/quantum/rootwrap.d/ryu-plugin.filters',
             'etc/quantum/rootwrap.d/lbaas-haproxy.filters']),
        (init_path, ['etc/init.d/quantum-server']),
        (ovs_plugin_config_path,
            ['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini']),
        (cisco_plugin_config_path,
            ['etc/quantum/plugins/cisco/cisco_plugins.ini']),
        (bigswitch_plugin_config_path,
            ['etc/quantum/plugins/bigswitch/restproxy.ini']),
        (brocade_plugin_config_path,
            ['etc/quantum/plugins/brocade/brocade.ini']),
        (linuxbridge_plugin_config_path,
            ['etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini']),
        (nvp_plugin_config_path,
            ['etc/quantum/plugins/nicira/nvp.ini']),
        (ryu_plugin_config_path, ['etc/quantum/plugins/ryu/ryu.ini']),
        (meta_plugin_config_path,
            ['etc/quantum/plugins/metaplugin/metaplugin.ini']),
        (nec_plugin_config_path, ['etc/quantum/plugins/nec/nec.ini']),
        (hyperv_plugin_config_path,
            ['etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini']),
        (plumgrid_plugin_config_path,
            ['etc/quantum/plugins/plumgrid/plumgrid.ini']),
        (midonet_plugin_config_path,
            ['etc/quantum/plugins/midonet/midonet.ini']),
    ]

    ConsoleScripts = [
        'quantum-dhcp-agent = quantum.agent.dhcp_agent:main',
        'quantum-dhcp-agent-dnsmasq-lease-update ='
        'quantum.agent.linux.dhcp:Dnsmasq.lease_update',
        'quantum-netns-cleanup = quantum.agent.netns_cleanup_util:main',
        'quantum-l3-agent = quantum.agent.l3_agent:main',
        'quantum-linuxbridge-agent ='
        'quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent:main',
        'quantum-metadata-agent ='
        'quantum.agent.metadata.agent:main',
        'quantum-ns-metadata-proxy ='
        'quantum.agent.metadata.namespace_proxy:main',
        'quantum-openvswitch-agent ='
        'quantum.plugins.openvswitch.agent.ovs_quantum_agent:main',
        'quantum-ryu-agent = '
        'quantum.plugins.ryu.agent.ryu_quantum_agent:main',
        'quantum-nec-agent = '
        'quantum.plugins.nec.agent.nec_quantum_agent:main',
        'quantum-server = quantum.server:main',
        'quantum-debug = quantum.debug.shell:main',
        'quantum-ovs-cleanup = quantum.agent.ovs_cleanup_util:main',
        'quantum-db-manage = quantum.db.migration.cli:main',
        ('quantum-lbaas-agent = '
         'quantum.plugins.services.agent_loadbalancer.agent:main'),
        ('quantum-check-nvp-config = '
         'quantum.plugins.nicira.nicira_nvp_plugin.check_nvp_config:main'),
    ]

    ProjectScripts = [
        'bin/quantum-rootwrap',
    ]

setuptools.setup(
    name=Name,
    version=Version,
    url=Url,
    author=Author,
    author_email=AuthorEmail,
    description=ShortDescription,
    long_description=Description,
    license=License,
    classifiers=[
        'Environment :: OpenStack',
        'Intended Audience :: System Administrators',
        'Intended Audience :: Information Technology',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
    ],
    scripts=ProjectScripts,
    install_requires=requires,
    dependency_links=depend_links,
    include_package_data=True,
    setup_requires=['setuptools_git>=0.4'],
    packages=setuptools.find_packages('.'),
    cmdclass=setup.get_cmdclass(),
    data_files=DataFiles,
    eager_resources=EagerResources,
    entry_points={'console_scripts': ConsoleScripts},
)
<commit_msg>Shorten the path of the nicira nvp plugin.<commit_after># Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import setuptools
import sys

from quantum.openstack.common import setup

requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()

if sys.platform == 'win32':
    requires.append('pywin32')
    requires.append('wmi')
    requires.remove('pyudev')

Name = 'quantum'
Url = "https://launchpad.net/quantum"
Version = setup.get_version(Name, '2013.2')
License = 'Apache License 2.0'
Author = 'OpenStack'
AuthorEmail = 'openstack-dev@lists.openstack.org'
Maintainer = ''
Summary = 'Quantum (virtual network service)'
ShortDescription = Summary
Description = Summary

EagerResources = [
    'quantum',
]

config_path = 'etc/quantum/'
init_path = 'etc/init.d'
rootwrap_path = 'etc/quantum/rootwrap.d'
ovs_plugin_config_path = 'etc/quantum/plugins/openvswitch'
bigswitch_plugin_config_path = 'etc/quantum/plugins/bigswitch'
brocade_plugin_config_path = 'etc/quantum/plugins/brocade'
cisco_plugin_config_path = 'etc/quantum/plugins/cisco'
linuxbridge_plugin_config_path = 'etc/quantum/plugins/linuxbridge'
nvp_plugin_config_path = 'etc/quantum/plugins/nicira'
ryu_plugin_config_path = 'etc/quantum/plugins/ryu'
meta_plugin_config_path = 'etc/quantum/plugins/metaplugin'
nec_plugin_config_path = 'etc/quantum/plugins/nec'
hyperv_plugin_config_path = 'etc/quantum/plugins/hyperv'
plumgrid_plugin_config_path = 'etc/quantum/plugins/plumgrid'
midonet_plugin_config_path = 'etc/quantum/plugins/midonet'

if sys.platform == 'win32':
    # Windows doesn't have an "/etc" directory equivalent
    DataFiles = []

    ConsoleScripts = [
        'quantum-hyperv-agent = '
        'quantum.plugins.hyperv.agent.hyperv_quantum_agent:main',
        'quantum-server = quantum.server:main',
        'quantum-db-manage = quantum.db.migration.cli:main',
    ]

    ProjectScripts = []
else:
    DataFiles = [
        (config_path,
            ['etc/quantum.conf',
             'etc/rootwrap.conf',
             'etc/api-paste.ini',
             'etc/policy.json',
             'etc/dhcp_agent.ini',
             'etc/l3_agent.ini',
             'etc/metadata_agent.ini',
             'etc/lbaas_agent.ini']),
        (rootwrap_path,
            ['etc/quantum/rootwrap.d/dhcp.filters',
             'etc/quantum/rootwrap.d/iptables-firewall.filters',
             'etc/quantum/rootwrap.d/l3.filters',
             'etc/quantum/rootwrap.d/linuxbridge-plugin.filters',
             'etc/quantum/rootwrap.d/nec-plugin.filters',
             'etc/quantum/rootwrap.d/openvswitch-plugin.filters',
             'etc/quantum/rootwrap.d/ryu-plugin.filters',
             'etc/quantum/rootwrap.d/lbaas-haproxy.filters']),
        (init_path, ['etc/init.d/quantum-server']),
        (ovs_plugin_config_path,
            ['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini']),
        (cisco_plugin_config_path,
            ['etc/quantum/plugins/cisco/cisco_plugins.ini']),
        (bigswitch_plugin_config_path,
            ['etc/quantum/plugins/bigswitch/restproxy.ini']),
        (brocade_plugin_config_path,
            ['etc/quantum/plugins/brocade/brocade.ini']),
        (linuxbridge_plugin_config_path,
            ['etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini']),
        (nvp_plugin_config_path,
            ['etc/quantum/plugins/nicira/nvp.ini']),
        (ryu_plugin_config_path, ['etc/quantum/plugins/ryu/ryu.ini']),
        (meta_plugin_config_path,
            ['etc/quantum/plugins/metaplugin/metaplugin.ini']),
        (nec_plugin_config_path, ['etc/quantum/plugins/nec/nec.ini']),
        (hyperv_plugin_config_path,
            ['etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini']),
        (plumgrid_plugin_config_path,
            ['etc/quantum/plugins/plumgrid/plumgrid.ini']),
        (midonet_plugin_config_path,
            ['etc/quantum/plugins/midonet/midonet.ini']),
    ]

    ConsoleScripts = [
        'quantum-dhcp-agent = quantum.agent.dhcp_agent:main',
        'quantum-dhcp-agent-dnsmasq-lease-update ='
        'quantum.agent.linux.dhcp:Dnsmasq.lease_update',
        'quantum-netns-cleanup = quantum.agent.netns_cleanup_util:main',
        'quantum-l3-agent = quantum.agent.l3_agent:main',
        'quantum-linuxbridge-agent ='
        'quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent:main',
        'quantum-metadata-agent ='
        'quantum.agent.metadata.agent:main',
        'quantum-ns-metadata-proxy ='
        'quantum.agent.metadata.namespace_proxy:main',
        'quantum-openvswitch-agent ='
        'quantum.plugins.openvswitch.agent.ovs_quantum_agent:main',
        'quantum-ryu-agent = '
        'quantum.plugins.ryu.agent.ryu_quantum_agent:main',
        'quantum-nec-agent = '
        'quantum.plugins.nec.agent.nec_quantum_agent:main',
        'quantum-server = quantum.server:main',
        'quantum-debug = quantum.debug.shell:main',
        'quantum-ovs-cleanup = quantum.agent.ovs_cleanup_util:main',
        'quantum-db-manage = quantum.db.migration.cli:main',
        ('quantum-lbaas-agent = '
         'quantum.plugins.services.agent_loadbalancer.agent:main'),
        ('quantum-check-nvp-config = '
         'quantum.plugins.nicira.check_nvp_config:main'),
    ]

    ProjectScripts = [
        'bin/quantum-rootwrap',
    ]

setuptools.setup(
    name=Name,
    version=Version,
    url=Url,
    author=Author,
    author_email=AuthorEmail,
    description=ShortDescription,
    long_description=Description,
    license=License,
    classifiers=[
        'Environment :: OpenStack',
        'Intended Audience :: System Administrators',
        'Intended Audience :: Information Technology',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
    ],
    scripts=ProjectScripts,
    install_requires=requires,
    dependency_links=depend_links,
    include_package_data=True,
    setup_requires=['setuptools_git>=0.4'],
    packages=setuptools.find_packages('.'),
    cmdclass=setup.get_cmdclass(),
    data_files=DataFiles,
    eager_resources=EagerResources,
    entry_points={'console_scripts': ConsoleScripts},
)
<|endoftext|>


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

from __future__ import unicode_literals
from setuptools import setup, find_packages
from os.path import dirname, join

def main():
    base_dir = dirname(__file__)
    setup(
        name='flaky',
        version='1.0.0',
        description='Plugin for nose or py.test that automatically reruns flaky tests.',
        long_description=open(join(base_dir, 'README.rst')).read(),
        author='Box',
        author_email='oss@box.com',
        url='https://github.com/box/flaky',
        license=open(join(base_dir, 'LICENSE')).read(),
        packages=find_packages(exclude=['test']),
        test_suite='test',
        tests_require=['pytest', 'nose'],
        zip_safe=False,
        entry_points={
            'nose.plugins.0.10': [
                'flaky = flaky.flaky_nose_plugin:FlakyPlugin'
            ],
            'pytest11': [
                'flaky = flaky.flaky_pytest_plugin'
            ]
        },
        keywords='nose pytest plugin flaky tests rerun retry',
    )

if __name__ == '__main__':
    main()
<commit_msg>Add classifiers to setup.py<commit_after># -*- coding: utf-8 -*-

from __future__ import unicode_literals
from setuptools import setup, find_packages
from os.path import dirname, join

CLASSIFIERS = [
    'Development Status :: 4 - Beta',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: Apache Software License',
    'Topic :: Software Development :: Testing',
    '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',
    'Operating System :: OS Independent',
    'Operating System :: POSIX',
    'Operating System :: Microsoft :: Windows',
    'Operating System :: MacOS :: MacOS X',
]

def main():
    base_dir = dirname(__file__)
    setup(
        name='flaky',
        version='1.0.0',
        description='Plugin for nose or py.test that automatically reruns flaky tests.',
        long_description=open(join(base_dir, 'README.rst')).read(),
        author='Box',
        author_email='oss@box.com',
        url='https://github.com/box/flaky',
        license=open(join(base_dir, 'LICENSE')).read(),
        packages=find_packages(exclude=['test']),
        test_suite='test',
        tests_require=['pytest', 'nose'],
        zip_safe=False,
        entry_points={
            'nose.plugins.0.10': [
                'flaky = flaky.flaky_nose_plugin:FlakyPlugin'
            ],
            'pytest11': [
                'flaky = flaky.flaky_pytest_plugin'
            ]
        },
        keywords='nose pytest plugin flaky tests rerun retry',
        classifiers=CLASSIFIERS,
    )

if __name__ == '__main__':
    main()
<|endoftext|>


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

from setuptools import setup, find_packages

setup(
    name='django-slack',
    url="https://chris-lamb.co.uk/projects/django-slack",
    version='5.16.2',
    description="Provides easy-to-use integration between Django projects and "
    "the Slack group chat and IM tool.",
    author="Chris Lamb",
    author_email="chris@chris-lamb.co.uk",
    license="BSD-3-Clause",
    packages=find_packages(),
    include_package_data=True,
    python_requires=">=3.6",
    install_requires=('Django>=2', 'requests'),
)
<commit_msg>incrementing version number to enable easier pip upgrading with this fix<commit_after>#!/usr/bin/env python3

from setuptools import setup, find_packages

setup(
    name='django-slack',
    url="https://chris-lamb.co.uk/projects/django-slack",
    version='5.16.3',
    description="Provides easy-to-use integration between Django projects and "
    "the Slack group chat and IM tool.",
    author="Chris Lamb",
    author_email="chris@chris-lamb.co.uk",
    license="BSD-3-Clause",
    packages=find_packages(),
    include_package_data=True,
    python_requires=">=3.6",
    install_requires=('Django>=2', 'requests'),
)
<|endoftext|>


<commit_before>from distutils.core import setup
from setuptools import find_packages
from elsapy.__init__ import version

setup(
    name = 'elsapy',
    version = version,
    description = "A Python module for use with Elsevier's APIs: Scopus, ScienceDirect, others - see https://api.elsevier.com",
    long_description = "See https://github.com/ElsevierDev/elsapy for the latest information / background to this project."
    author = 'Elsevier, Inc.',
    author_email = 'integrationsupport@elsevier.com',
    url = 'https://github.com/ElsevierDev/elsapy',
    license = 'License :: OSI Approved :: BSD License',
    download_url = 'https://www.github.com/ElsevierDev/elsapy/archive/0.4.6.tar.gz',
    keywords = ['elsevier api', 'sciencedirect api', 'scopus api'], # arbitrary keywords
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 3',
    ],
    packages = find_packages(exclude=['contrib', 'docs', 'tests*']),
    install_requires = ['requests']
)<commit_msg>add a comma after long_description in setup.py<commit_after>from distutils.core import setup
from setuptools import find_packages
from elsapy.__init__ import version

setup(
    name = 'elsapy',
    version = version,
    description = "A Python module for use with Elsevier's APIs: Scopus, ScienceDirect, others - see https://api.elsevier.com",
    long_description = "See https://github.com/ElsevierDev/elsapy for the latest information / background to this project.",
    author = 'Elsevier, Inc.',
    author_email = 'integrationsupport@elsevier.com',
    url = 'https://github.com/ElsevierDev/elsapy',
    license = 'License :: OSI Approved :: BSD License',
    download_url = 'https://www.github.com/ElsevierDev/elsapy/archive/0.4.6.tar.gz',
    keywords = ['elsevier api', 'sciencedirect api', 'scopus api'], # arbitrary keywords
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 3',
    ],
    packages = find_packages(exclude=['contrib', 'docs', 'tests*']),
    install_requires = ['requests']
)
<|endoftext|>


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

import os
from setuptools import find_packages, setup

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
    name='pdje',
    version='0.1',
    packages=find_packages(),
    include_package_data=True,
    license='Apache License 2.0',
    description='A simple Django app to control an email system',
    long_description=README,
    url='https://0xdc.io/',
    author='Daniel Cordero',
    author_email='me@0xdc.io',
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: Apache License 2.0',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP',
    ],
    install_requires=[
        'passlib',
    ],
)
<commit_msg>Bump version<commit_after>#!/usr/bin/env python

import os
from setuptools import find_packages, setup

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
    name='pdje',
    version='0.2',
    packages=find_packages(),
    include_package_data=True,
    license='Apache License 2.0',
    description='A simple Django app to control an email system',
    long_description=README,
    url='https://0xdc.io/',
    author='Daniel Cordero',
    author_email='me@0xdc.io',
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: Apache License 2.0',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP',
    ],
    install_requires=[
        'passlib',
    ],
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*
from setuptools.command.install import install
from setuptools import find_packages
from setuptools import setup
from sys import version_info, stderr, exit
import codecs
import sys
import os

def read(*parts):
    # intentionally *not* adding an encoding option to open
    # see here: https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
    return codecs.open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *parts), 'r').read()

setup(name="strictyaml",
      version=read('VERSION').replace('\n', ''),
      description="Strict, typed YAML parser",
      long_description=read('README.rst'),
      classifiers=[
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Topic :: Text Processing :: Markup',
          'Topic :: Software Development :: Libraries',
          'Natural Language :: English',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.1',
          'Programming Language :: Python :: 3.2',
          'Programming Language :: Python :: 3.3',
          'Programming Language :: Python :: 3.4',
          'Programming Language :: Python :: 3.5',
      ],
      keywords='yaml',
      author='Colm O\'Connor',
      author_email='colm.oconnor.github@gmail.com',
      url='http://hitchdev.com/strictyaml',
      license='MIT',
      install_requires=["ruamel.yaml>=0.14.2", "python-dateutil>=2.6.0", ],
      packages=find_packages(exclude=["tests", "docs", ]),
      package_data={},
      zip_safe=False,
      include_package_data=True,
)
<commit_msg>MISC : Read correct README.<commit_after># -*- coding: utf-8 -*
from setuptools.command.install import install
from setuptools import find_packages
from setuptools import setup
from sys import version_info, stderr, exit
import codecs
import sys
import os

def read(*parts):
    # intentionally *not* adding an encoding option to open
    # see here: https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
    return codecs.open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *parts), 'r').read()

setup(name="strictyaml",
      version=read('VERSION').replace('\n', ''),
      description="Strict, typed YAML parser",
      long_description=read('README.md'),
      classifiers=[
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'License :: OSI Approved :: MIT License',
          'Topic :: Text Processing :: Markup',
          'Topic :: Software Development :: Libraries',
          'Natural Language :: English',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 2.6',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.1',
          'Programming Language :: Python :: 3.2',
          'Programming Language :: Python :: 3.3',
          'Programming Language :: Python :: 3.4',
          'Programming Language :: Python :: 3.5',
      ],
      keywords='yaml',
      author='Colm O\'Connor',
      author_email='colm.oconnor.github@gmail.com',
      url='http://hitchdev.com/strictyaml',
      license='MIT',
      install_requires=["ruamel.yaml>=0.14.2", "python-dateutil>=2.6.0", ],
      packages=find_packages(exclude=["tests", "docs", ]),
      package_data={},
      zip_safe=False,
      include_package_data=True,
)
<|endoftext|>


<commit_before>from __future__ import print_function
import sys
import os

try:
    from setuptools import setup, find_packages
except ImportError:
    print("Distribute is required for install:")
    print("    http://python-distribute.org/distribute_setup.py")
    sys.exit(1)

# Not supported for Python versions < 2.6
if sys.version_info <= (2, 6):
    print("Python 2.6 or greater is required.")
    sys.exit(1)

REQUIRES = [
    'six >= 1.7.0',
    'prettytable >= 0.7.0',
    'click',
    'requests',
]

if sys.version_info < (2, 7):
    REQUIRES.append('importlib')

DESCRIPTION = "A library for SoftLayer's API"

if os.path.exists('README.rst'):
    with open('README.rst', 'r', 'utf-8') as readme_file:
        LONG_DESCRIPTION = readme_file.read()
else:
    LONG_DESCRIPTION = DESCRIPTION

setup(
    name='SoftLayer',
    version='4.0.2',
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    author='SoftLayer Technologies, Inc.',
    author_email='sldn@softlayer.com',
    packages=find_packages(exclude=["SoftLayer.tests"]),
    license='MIT',
    zip_safe=False,
    url='http://github.com/softlayer/softlayer-python',
    entry_points={
        'console_scripts': [
            'slcli = SoftLayer.CLI.core:main',
            'sl = SoftLayer.CLI.deprecated:main',
        ],
    },
    test_suite='nose.collector',
    install_requires=REQUIRES,
    keywords=['softlayer', 'cloud'],
    classifiers=[
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
)
<commit_msg>Adds missing codec import<commit_after>from __future__ import print_function
import sys
import os

from codecs import open

try:
    from setuptools import setup, find_packages
except ImportError:
    print("Distribute is required for install:")
    print("    http://python-distribute.org/distribute_setup.py")
    sys.exit(1)

# Not supported for Python versions < 2.6
if sys.version_info <= (2, 6):
    print("Python 2.6 or greater is required.")
    sys.exit(1)

REQUIRES = [
    'six >= 1.7.0',
    'prettytable >= 0.7.0',
    'click',
    'requests',
]

if sys.version_info < (2, 7):
    REQUIRES.append('importlib')

DESCRIPTION = "A library for SoftLayer's API"

if os.path.exists('README.rst'):
    with open('README.rst', 'r', 'utf-8') as readme_file:
        LONG_DESCRIPTION = readme_file.read()
else:
    LONG_DESCRIPTION = DESCRIPTION

setup(
    name='SoftLayer',
    version='4.0.2',
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    author='SoftLayer Technologies, Inc.',
    author_email='sldn@softlayer.com',
    packages=find_packages(exclude=["SoftLayer.tests"]),
    license='MIT',
    zip_safe=False,
    url='http://github.com/softlayer/softlayer-python',
    entry_points={
        'console_scripts': [
            'slcli = SoftLayer.CLI.core:main',
            'sl = SoftLayer.CLI.deprecated:main',
        ],
    },
    test_suite='nose.collector',
    install_requires=REQUIRES,
    keywords=['softlayer', 'cloud'],
    classifiers=[
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
)
<|endoftext|>


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

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

# Get the long description from the relevant file
with codecs.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    # Application name:
    name="expfactory",

    # Version number (initial):
    version="1.0.2",

    # Application author details:
    author="poldracklab",
    author_email="vsochat@stanford.edu",

    # Packages
    packages=find_packages(),

    # Data files
    include_package_data=True,
    zip_safe=False,

    # Details
    url="http://www.github.com/expfactory",

    license="LICENSE.txt",
    description="Python module for managing experiment factory javascript experiment files, a psiturk battery, and virtual machines to host the compilation of these things.",
    long_description=long_description,
    keywords='psiturk behavior neuroscience experiment factory',

    install_requires = ['numpy','Flask','gitpython'],

    entry_points = {
        'console_scripts': [
            'expfactory=expfactory.scripts:main',
        ],
    },

)
<commit_msg>adding flask-restful to setup.py for pip installation<commit_after>from setuptools import setup, find_packages
import codecs
import os

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

# Get the long description from the relevant file
with codecs.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    # Application name:
    name="expfactory",

    # Version number (initial):
    version="1.0.2",

    # Application author details:
    author="poldracklab",
    author_email="vsochat@stanford.edu",

    # Packages
    packages=find_packages(),

    # Data files
    include_package_data=True,
    zip_safe=False,

    # Details
    url="http://www.github.com/expfactory",

    license="LICENSE.txt",
    description="Python module for managing experiment factory javascript experiment files, a psiturk battery, and virtual machines to host the compilation of these things.",
    long_description=long_description,
    keywords='psiturk behavior neuroscience experiment factory',

    install_requires = ['numpy','Flask','gitpython','flask-restful'],

    entry_points = {
        'console_scripts': [
            'expfactory=expfactory.scripts:main',
        ],
    },

)
<|endoftext|>