<commit_before>import os
import platform
import re
import sys
import warnings

if sys.version_info[:3] < (3, 6, 2):
    raise RuntimeError("Python version >= 3.6.2 required.")

# Hack to silence atexit traceback in some Python versions
try:
    import multiprocessing  # noqa: F401
except ImportError:
    pass

from setuptools import setup

if sys.version_info[:2] < (3, 10):
    from distutils.cmd import Command
    from distutils.command.build_ext import build_ext
    from distutils.core import Extension
else:
    from setuptools import Command
    from setuptools.command.build_ext import build_ext
    from setuptools.extension import Extension

_HAVE_SPHINX = True
try:
    from sphinx.cmd import build as sphinx
except ImportError:
    try:
        import sphinx
    except ImportError:
        _HAVE_SPHINX = False

version = "4.2.0.dev0"

f = open("README.rst")
try:
    try:
        readme_content = f.read()
    except BaseException:
        readme_content = ""
finally:
    f.close()

# PYTHON-654 - Clang doesn't support -mno-fused-madd but the pythons Apple
# ships are built with it. This is a problem starting with Xcode 5.1
# since clang 3.4 errors out when it encounters unrecognized compiler
# flags. This hack removes -mno-fused-madd from the CFLAGS automatically
# generated by distutils for Apple provided pythons, allowing C extension
# builds to complete without error. The inspiration comes from older
# versions of distutils.sysconfig.get_config_vars.
if sys.platform == "darwin" and "clang" in platform.python_compiler().lower():
    from distutils.sysconfig import get_config_vars

    res = get_config_vars()
    for key in ("CFLAGS", "PY_CFLAGS"):
        if key in res:
            flags = res[key]
            flags = re.sub("-mno-fused-madd", "", flags)
            res[key] = flags

class test(Command):
    description = "run the tests"

    user_options = [
        ("test-module=", "m", "Discover tests in specified module"),
        ("test-suite=", "s", "Test suite to run (e.g. 'some_module.test_suite')"),
        ("failfast", "f", "Stop running tests on first failure or error"),
        ("xunit-output=", "x", "Generate a results directory with XUnit XML format"),
    ]

    def initialize_options(self):
        self.test_module = None
        self.test_suite = None
        self.failfast = False
        self.xunit_output = None

    def finalize_options(self):
        if self.test_suite is None and self.test_module is None:
            self.test_module = "test"
        elif self.test_module is not None and self.test_suite is not None:
            raise Exception("You may specify a module or suite, but not both")

    def run(self):
        # Installing required packages, running egg_info and build_ext are
        # part of normal operation for setuptools.command.test.test
        if self.distribution.install_requires:
            self.distribution.fetch_build_eggs(self.distribution.install_requires)
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)
        if self.xunit_output:
            self.distribution.fetch_build_eggs(["unittest-xml-reporting"])
        self.run_command("egg_info")
        build_ext_cmd = self.reinitialize_command("build_ext")
        build_ext_cmd.inplace = 1
        self.run_command("build_ext")

        # Construct a TextTestRunner directly from the unittest imported from
        # test, which creates a TestResult that supports the 'addSkip' method.
        # setuptools will by default create a TextTestRunner that uses the old
        # TestResult class.
        from test import PymongoTestRunner, test_cases, unittest

        if self.test_suite is None:
            all_tests = unittest.defaultTestLoader.discover(self.test_module)
            suite = unittest.TestSuite()
            suite.addTests(sorted(test_cases(all_tests), key=lambda x: x.__module__))
        else:
            suite = unittest.defaultTestLoader.loadTestsFromName(self.test_suite)
        if self.xunit_output:
            from test import PymongoXMLTestRunner

            runner = PymongoXMLTestRunner(
                verbosity=2, failfast=self.failfast, output=self.xunit_output
            )
        else:
            runner = PymongoTestRunner(verbosity=2, failfast=self.failfast)
        result = runner.run(suite)
        sys.exit(not result.wasSuccessful())

class doc(Command):

    description = "generate or test documentation"

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

    boolean_options = ["test"]

    def initialize_options(self):
        self.test = False

    def finalize_options(self):
        pass

    def run(self):

        if not _HAVE_SPHINX:
            raise RuntimeError("You must install Sphinx to build or test the documentation.")

        if self.test:
            path = os.path.join(os.path.abspath("."), "doc", "_build", "doctest")
            mode = "doctest"
        else:
            path = os.path.join(os.path.abspath("."), "doc", "_build", version)
            mode = "html"

            try:
                os.makedirs(path)
            except BaseException:
                pass

        sphinx_args = ["-E", "-b", mode, "doc", path]

        # sphinx.main calls sys.exit when sphinx.build_main exists.
        # Call build_main directly so we can check status and print
        # the full path to the built docs.
        if hasattr(sphinx, "build_main"):
            status = sphinx.build_main(sphinx_args)
        else:
            status = sphinx.main(sphinx_args)

        if status:
            raise RuntimeError("documentation step '%s' failed" % (mode,))

        sys.stdout.write(
            "\nDocumentation step '%s' performed, results here:\n   %s/\n" % (mode, path)
        )

class custom_build_ext(build_ext):
    """Allow C extension building to fail.

    The C extension speeds up BSON encoding, but is not essential.
    """

    warning_message = """
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for PyMongo to run,
although they do result in significant speed improvements.
%s

Please see the installation docs for solutions to build issues:

https://pymongo.readthedocs.io/en/stable/installation.html

Here are some hints for popular operating systems:

If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.

Debian and Ubuntu users should issue the following command:

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

Users of Red Hat based distributions (RHEL, CentOS, Amazon Linux,
Oracle Linux, Fedora, etc.) should issue the following command:

    $ sudo yum install gcc python-devel

If you are seeing this message on Microsoft Windows please install
PyMongo using pip. Modern versions of pip will install PyMongo
from binary wheels available on pypi. If you must install from
source read the documentation here:

https://pymongo.readthedocs.io/en/stable/installation.html#installing-from-source-on-windows

If you are seeing this message on macOS / OSX please install PyMongo
using pip. Modern versions of pip will install PyMongo from binary
wheels available on pypi. If wheels are not available for your version
of macOS / OSX, or you must install from source read the documentation
here:

https://pymongo.readthedocs.io/en/stable/installation.html#osx
********************************************************************
"""

    def run(self):
        try:
            build_ext.run(self)
        except Exception:
            e = sys.exc_info()[1]
            sys.stdout.write("%s\n" % str(e))
            warnings.warn(
                self.warning_message
                % (
                    "Extension modules",
                    "There was an issue with your platform configuration - see above.",
                )
            )

    def build_extension(self, ext):
        name = ext.name
        try:
            build_ext.build_extension(self, ext)
        except Exception:
            e = sys.exc_info()[1]
            sys.stdout.write("%s\n" % str(e))
            warnings.warn(
                self.warning_message
                % (
                    "The %s extension module" % (name,),
                    "The output above this warning shows how the compilation failed.",
                )
            )

ext_modules = [
    Extension(
        "bson._cbson",
        include_dirs=["bson"],
        sources=[
            "bson/_cbsonmodule.c",
            "bson/time64.c",
            "bson/buffer.c",
            "bson/encoding_helpers.c",
        ],
    ),
    Extension(
        "pymongo._cmessage",
        include_dirs=["bson"],
        sources=["pymongo/_cmessagemodule.c", "bson/buffer.c"],
    ),
]

# PyOpenSSL 17.0.0 introduced support for OCSP. 17.1.0 introduced
# a related feature we need. 17.2.0 fixes a bug
# in set_default_verify_paths we should really avoid.
# service_identity 18.1.0 introduced support for IP addr matching.
pyopenssl_reqs = ["pyopenssl>=17.2.0", "requests<3.0.0", "service_identity>=18.1.0"]
if sys.platform in ("win32", "darwin"):
    # Fallback to certifi on Windows if we can't load CA certs from the system
    # store and just use certifi on macOS.
    # https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.set_default_verify_paths
    pyopenssl_reqs.append("certifi")

extras_require = {
    "encryption": ["pymongocrypt>=1.2.0,<2.0.0"],
    "ocsp": pyopenssl_reqs,
    "snappy": ["python-snappy"],
    "zstd": ["zstandard"],
    "aws": ["pymongo-auth-aws<2.0.0"],
    "srv": ["dnspython>=1.16.0,<3.0.0"],
}

# GSSAPI extras
if sys.platform == "win32":
    extras_require["gssapi"] = ["winkerberos>=0.5.0"]
else:
    extras_require["gssapi"] = ["pykerberos"]

extra_opts = {
    "packages": ["bson", "pymongo", "gridfs"],
    "package_data": {
        "bson": ["py.typed"],
        "pymongo": ["py.typed"],
        "gridfs": ["py.typed"],
    },
}

if "--no_ext" in sys.argv:
    sys.argv.remove("--no_ext")
elif sys.platform.startswith("java") or sys.platform == "cli" or "PyPy" in sys.version:
    sys.stdout.write(
        """
*****************************************************\n
The optional C extensions are currently not supported\n
by this python implementation.\n
*****************************************************\n
"""
    )
else:
    extra_opts["ext_modules"] = ext_modules

setup(
    name="pymongo",
    version=version,
    description="Python driver for MongoDB <http://www.mongodb.org>",
    long_description=readme_content,
    author="The MongoDB Python Team",
    url="http://github.com/mongodb/mongo-python-driver",
    keywords=["mongo", "mongodb", "pymongo", "gridfs", "bson"],
    install_requires=[],
    license="Apache License, Version 2.0",
    python_requires=">=3.6.2",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3 :: Only",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Database",
        "Typing :: Typed",
    ],
    cmdclass={"build_ext": custom_build_ext, "doc": doc, "test": test},
    extras_require=extras_require,
    **extra_opts
)
<commit_msg>PYTHON-3216 Include codec_options.pyi in release distributions (#923)<commit_after>import os
import platform
import re
import sys
import warnings

if sys.version_info[:3] < (3, 6, 2):
    raise RuntimeError("Python version >= 3.6.2 required.")

# Hack to silence atexit traceback in some Python versions
try:
    import multiprocessing  # noqa: F401
except ImportError:
    pass

from setuptools import setup

if sys.version_info[:2] < (3, 10):
    from distutils.cmd import Command
    from distutils.command.build_ext import build_ext
    from distutils.core import Extension
else:
    from setuptools import Command
    from setuptools.command.build_ext import build_ext
    from setuptools.extension import Extension

_HAVE_SPHINX = True
try:
    from sphinx.cmd import build as sphinx
except ImportError:
    try:
        import sphinx
    except ImportError:
        _HAVE_SPHINX = False

version = "4.2.0.dev0"

f = open("README.rst")
try:
    try:
        readme_content = f.read()
    except BaseException:
        readme_content = ""
finally:
    f.close()

# PYTHON-654 - Clang doesn't support -mno-fused-madd but the pythons Apple
# ships are built with it. This is a problem starting with Xcode 5.1
# since clang 3.4 errors out when it encounters unrecognized compiler
# flags. This hack removes -mno-fused-madd from the CFLAGS automatically
# generated by distutils for Apple provided pythons, allowing C extension
# builds to complete without error. The inspiration comes from older
# versions of distutils.sysconfig.get_config_vars.
if sys.platform == "darwin" and "clang" in platform.python_compiler().lower():
    from distutils.sysconfig import get_config_vars

    res = get_config_vars()
    for key in ("CFLAGS", "PY_CFLAGS"):
        if key in res:
            flags = res[key]
            flags = re.sub("-mno-fused-madd", "", flags)
            res[key] = flags

class test(Command):
    description = "run the tests"

    user_options = [
        ("test-module=", "m", "Discover tests in specified module"),
        ("test-suite=", "s", "Test suite to run (e.g. 'some_module.test_suite')"),
        ("failfast", "f", "Stop running tests on first failure or error"),
        ("xunit-output=", "x", "Generate a results directory with XUnit XML format"),
    ]

    def initialize_options(self):
        self.test_module = None
        self.test_suite = None
        self.failfast = False
        self.xunit_output = None

    def finalize_options(self):
        if self.test_suite is None and self.test_module is None:
            self.test_module = "test"
        elif self.test_module is not None and self.test_suite is not None:
            raise Exception("You may specify a module or suite, but not both")

    def run(self):
        # Installing required packages, running egg_info and build_ext are
        # part of normal operation for setuptools.command.test.test
        if self.distribution.install_requires:
            self.distribution.fetch_build_eggs(self.distribution.install_requires)
        if self.distribution.tests_require:
            self.distribution.fetch_build_eggs(self.distribution.tests_require)
        if self.xunit_output:
            self.distribution.fetch_build_eggs(["unittest-xml-reporting"])
        self.run_command("egg_info")
        build_ext_cmd = self.reinitialize_command("build_ext")
        build_ext_cmd.inplace = 1
        self.run_command("build_ext")

        # Construct a TextTestRunner directly from the unittest imported from
        # test, which creates a TestResult that supports the 'addSkip' method.
        # setuptools will by default create a TextTestRunner that uses the old
        # TestResult class.
        from test import PymongoTestRunner, test_cases, unittest

        if self.test_suite is None:
            all_tests = unittest.defaultTestLoader.discover(self.test_module)
            suite = unittest.TestSuite()
            suite.addTests(sorted(test_cases(all_tests), key=lambda x: x.__module__))
        else:
            suite = unittest.defaultTestLoader.loadTestsFromName(self.test_suite)
        if self.xunit_output:
            from test import PymongoXMLTestRunner

            runner = PymongoXMLTestRunner(
                verbosity=2, failfast=self.failfast, output=self.xunit_output
            )
        else:
            runner = PymongoTestRunner(verbosity=2, failfast=self.failfast)
        result = runner.run(suite)
        sys.exit(not result.wasSuccessful())

class doc(Command):

    description = "generate or test documentation"

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

    boolean_options = ["test"]

    def initialize_options(self):
        self.test = False

    def finalize_options(self):
        pass

    def run(self):

        if not _HAVE_SPHINX:
            raise RuntimeError("You must install Sphinx to build or test the documentation.")

        if self.test:
            path = os.path.join(os.path.abspath("."), "doc", "_build", "doctest")
            mode = "doctest"
        else:
            path = os.path.join(os.path.abspath("."), "doc", "_build", version)
            mode = "html"

            try:
                os.makedirs(path)
            except BaseException:
                pass

        sphinx_args = ["-E", "-b", mode, "doc", path]

        # sphinx.main calls sys.exit when sphinx.build_main exists.
        # Call build_main directly so we can check status and print
        # the full path to the built docs.
        if hasattr(sphinx, "build_main"):
            status = sphinx.build_main(sphinx_args)
        else:
            status = sphinx.main(sphinx_args)

        if status:
            raise RuntimeError("documentation step '%s' failed" % (mode,))

        sys.stdout.write(
            "\nDocumentation step '%s' performed, results here:\n   %s/\n" % (mode, path)
        )

class custom_build_ext(build_ext):
    """Allow C extension building to fail.

    The C extension speeds up BSON encoding, but is not essential.
    """

    warning_message = """
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for PyMongo to run,
although they do result in significant speed improvements.
%s

Please see the installation docs for solutions to build issues:

https://pymongo.readthedocs.io/en/stable/installation.html

Here are some hints for popular operating systems:

If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.

Debian and Ubuntu users should issue the following command:

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

Users of Red Hat based distributions (RHEL, CentOS, Amazon Linux,
Oracle Linux, Fedora, etc.) should issue the following command:

    $ sudo yum install gcc python-devel

If you are seeing this message on Microsoft Windows please install
PyMongo using pip. Modern versions of pip will install PyMongo
from binary wheels available on pypi. If you must install from
source read the documentation here:

https://pymongo.readthedocs.io/en/stable/installation.html#installing-from-source-on-windows

If you are seeing this message on macOS / OSX please install PyMongo
using pip. Modern versions of pip will install PyMongo from binary
wheels available on pypi. If wheels are not available for your version
of macOS / OSX, or you must install from source read the documentation
here:

https://pymongo.readthedocs.io/en/stable/installation.html#osx
********************************************************************
"""

    def run(self):
        try:
            build_ext.run(self)
        except Exception:
            e = sys.exc_info()[1]
            sys.stdout.write("%s\n" % str(e))
            warnings.warn(
                self.warning_message
                % (
                    "Extension modules",
                    "There was an issue with your platform configuration - see above.",
                )
            )

    def build_extension(self, ext):
        name = ext.name
        try:
            build_ext.build_extension(self, ext)
        except Exception:
            e = sys.exc_info()[1]
            sys.stdout.write("%s\n" % str(e))
            warnings.warn(
                self.warning_message
                % (
                    "The %s extension module" % (name,),
                    "The output above this warning shows how the compilation failed.",
                )
            )

ext_modules = [
    Extension(
        "bson._cbson",
        include_dirs=["bson"],
        sources=[
            "bson/_cbsonmodule.c",
            "bson/time64.c",
            "bson/buffer.c",
            "bson/encoding_helpers.c",
        ],
    ),
    Extension(
        "pymongo._cmessage",
        include_dirs=["bson"],
        sources=["pymongo/_cmessagemodule.c", "bson/buffer.c"],
    ),
]

# PyOpenSSL 17.0.0 introduced support for OCSP. 17.1.0 introduced
# a related feature we need. 17.2.0 fixes a bug
# in set_default_verify_paths we should really avoid.
# service_identity 18.1.0 introduced support for IP addr matching.
pyopenssl_reqs = ["pyopenssl>=17.2.0", "requests<3.0.0", "service_identity>=18.1.0"]
if sys.platform in ("win32", "darwin"):
    # Fallback to certifi on Windows if we can't load CA certs from the system
    # store and just use certifi on macOS.
    # https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.set_default_verify_paths
    pyopenssl_reqs.append("certifi")

extras_require = {
    "encryption": ["pymongocrypt>=1.2.0,<2.0.0"],
    "ocsp": pyopenssl_reqs,
    "snappy": ["python-snappy"],
    "zstd": ["zstandard"],
    "aws": ["pymongo-auth-aws<2.0.0"],
    "srv": ["dnspython>=1.16.0,<3.0.0"],
}

# GSSAPI extras
if sys.platform == "win32":
    extras_require["gssapi"] = ["winkerberos>=0.5.0"]
else:
    extras_require["gssapi"] = ["pykerberos"]

extra_opts = {}

if "--no_ext" in sys.argv:
    sys.argv.remove("--no_ext")
elif sys.platform.startswith("java") or sys.platform == "cli" or "PyPy" in sys.version:
    sys.stdout.write(
        """
*****************************************************\n
The optional C extensions are currently not supported\n
by this python implementation.\n
*****************************************************\n
"""
    )
else:
    extra_opts["ext_modules"] = ext_modules

setup(
    name="pymongo",
    version=version,
    description="Python driver for MongoDB <http://www.mongodb.org>",
    long_description=readme_content,
    author="The MongoDB Python Team",
    url="http://github.com/mongodb/mongo-python-driver",
    keywords=["mongo", "mongodb", "pymongo", "gridfs", "bson"],
    install_requires=[],
    license="Apache License, Version 2.0",
    python_requires=">=3.6.2",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3 :: Only",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Database",
        "Typing :: Typed",
    ],
    cmdclass={"build_ext": custom_build_ext, "doc": doc, "test": test},
    extras_require=extras_require,
    packages=["bson", "pymongo", "gridfs"],
    package_data={
        "bson": ["py.typed", "*.pyi"],
        "pymongo": ["py.typed", "*.pyi"],
        "gridfs": ["py.typed", "*.pyi"],
    },
    **extra_opts
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
import io
import platform
import sys
from distutils.command.build import build

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

CFFI_DEPENDENCY = "cffi>=1.1"
SIX_DEPENDENCY = "six>=1.4.1"

CFFI_MODULES = [
    "src/build_bcrypt.py:ffi",
]

# Manually extract the __about__
__about__ = {}
with open("src/bcrypt/__about__.py") as fp:
    exec(fp.read(), __about__)

if platform.python_implementation() == "PyPy":
    if sys.pypy_version_info < (2, 6):
        raise RuntimeError(
            "bcrypt is not compatible with PyPy < 2.6. Please upgrade PyPy to "
            "use this library."
        )

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

    def run_tests(self):
        import pytest
        errno = pytest.main(self.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": [CFFI_DEPENDENCY],
            "cmdclass": {
                "test": PyTest,
            },
            "cffi_modules": CFFI_MODULES,
        }

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)

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

    description=__about__["__summary__"],
    long_description=io.open("README.rst", encoding='utf-8').read(),
    url=__about__["__uri__"],
    license=__about__["__license__"],

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

    install_requires=[
        CFFI_DEPENDENCY,
        SIX_DEPENDENCY,
    ],
    extras_require={
        "tests": [
            "pytest>=3.2.1,!=3.3.0",
        ],
    },
    tests_require=[
        "pytest>=3.2.1,!=3.3.0",
    ],

    package_dir={"": "src"},
    packages=[
        "bcrypt",
    ],

    zip_safe=False,

    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
    ],

    ext_package="bcrypt",

    **keywords_with_side_effects(sys.argv)
)
<commit_msg>Pass python_requires argument to setuptools (#154)<commit_after>#!/usr/bin/env python
import io
import platform
import sys
from distutils.command.build import build

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

CFFI_DEPENDENCY = "cffi>=1.1"
SIX_DEPENDENCY = "six>=1.4.1"

CFFI_MODULES = [
    "src/build_bcrypt.py:ffi",
]

# Manually extract the __about__
__about__ = {}
with open("src/bcrypt/__about__.py") as fp:
    exec(fp.read(), __about__)

if platform.python_implementation() == "PyPy":
    if sys.pypy_version_info < (2, 6):
        raise RuntimeError(
            "bcrypt is not compatible with PyPy < 2.6. Please upgrade PyPy to "
            "use this library."
        )

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

    def run_tests(self):
        import pytest
        errno = pytest.main(self.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": [CFFI_DEPENDENCY],
            "cmdclass": {
                "test": PyTest,
            },
            "cffi_modules": CFFI_MODULES,
        }

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)

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

    description=__about__["__summary__"],
    long_description=io.open("README.rst", encoding='utf-8').read(),
    url=__about__["__uri__"],
    license=__about__["__license__"],

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

    python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
    install_requires=[
        CFFI_DEPENDENCY,
        SIX_DEPENDENCY,
    ],
    extras_require={
        "tests": [
            "pytest>=3.2.1,!=3.3.0",
        ],
    },
    tests_require=[
        "pytest>=3.2.1,!=3.3.0",
    ],

    package_dir={"": "src"},
    packages=[
        "bcrypt",
    ],

    zip_safe=False,

    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
    ],

    ext_package="bcrypt",

    **keywords_with_side_effects(sys.argv)
)
<|endoftext|>


<commit_before>import os
from setuptools import setup, find_packages

version = "1.2.1"

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name = "django-macaddress",
    version = version,
    url = 'http://github.com/tubaman/django-macaddress',
    license = 'BSD',
    description = "MAC address model and form fields for Django apps.",
    long_description = read('README.rst'),
    author = 'Ryan Nowakowski',
    author_email = 'tubaman@fattuba.com',
    maintainer = 'Arun K. R.',
    maintainer_email = 'the1.arun@gmail.com',
    packages = ['macaddress'],
    install_requires = ['netaddr'],
    tests_require = ['django'],

    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
    ]
)
<commit_msg>increasing minor version number with a fix which effects django-debug-toolbar integration<commit_after>import os
from setuptools import setup, find_packages

version = "1.2.2"

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name = "django-macaddress",
    version = version,
    url = 'http://github.com/tubaman/django-macaddress',
    license = 'BSD',
    description = "MAC address model and form fields for Django apps.",
    long_description = read('README.rst'),
    author = 'Ryan Nowakowski',
    author_email = 'tubaman@fattuba.com',
    maintainer = 'Arun K. R.',
    maintainer_email = 'the1.arun@gmail.com',
    packages = ['macaddress'],
    install_requires = ['netaddr'],
    tests_require = ['django'],

    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
    ]
)
<|endoftext|>


<commit_before>from distutils.core import setup
setup(
    name='instabot',
    packages=['instabot', 'instabot.bot', 'instabot.api'],
    version='0.3.3.16',
    description='Cool Instagram bot scripts and API python wrapper.',
    author='Daniil Okhlopkov',
    author_email='ohld@icloud.com',
    url='https://github.com/instagrambot/instabot',
    download_url='https://github.com/ohld/instabot/tarball/0.3.3.16',
    keywords=['instagram', 'bot', 'api', 'wrapper'],
    classifiers=[],
    install_requires=['tqdm', 'requests-toolbelt', 'requests', 'requests', 'pep8', 'pyflakes', 'schedule'],
)
<commit_msg>update version and remove unnecessary packages<commit_after>from distutils.core import setup
setup(
    name='instabot',
    packages=['instabot', 'instabot.bot', 'instabot.api'],
    version='0.3.3.18',
    description='Cool Instagram bot scripts and API python wrapper.',
    author='Daniil Okhlopkov',
    author_email='ohld@icloud.com',
    url='https://github.com/instagrambot/instabot',
    download_url='https://github.com/ohld/instabot/tarball/0.3.3.18',
    keywords=['instagram', 'bot', 'api', 'wrapper'],
    classifiers=[],
    install_requires=['tqdm', 'requests-toolbelt', 'requests', 'schedule'],
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# coding: utf8

from __future__ import with_statement
from setuptools import setup, find_packages

# Figure out the version; this could be done by importing the
# module, though that requires dependencies to be already installed,
# which may not be the case when processing a pip requirements
# file, for example.
def parse_version(assignee):
    import os
    import re

    here = os.path.dirname(os.path.abspath(__file__))
    version_re = re.compile(
        r'%s = (\(.*?\))' % assignee)
    with open(os.path.join(here, 'skin', '__init__.py')) as fp:
        for line in fp:
            match = version_re.search(line)
            if match:
                version = eval(match.group(1))
                return ".".join(map(str, version))
        else:
            raise Exception("cannot find version")

setup(
    name='django-skin',
    version=parse_version('__version__'),
    packages=find_packages(),
    url='https://github.com/dwatkinsweb/django-skin',
    license='MIT',
    author='David Watkins',
    author_email='dwatkinsweb@gmail.com',
    description='Add template skins to django.',
    platforms='any',
    install_requires=[
        'Django==1.6'
    ],
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    test_suite='nose.collector',
    tests_require=[
        'nose',
        'mock'
    ],
)
<commit_msg>clean up setup.py file<commit_after>#!/usr/bin/env python
# coding: utf8

from setuptools import setup

setup(
    name='django-skin',
    version='0.1dev',
    packages=['skin', ],
    url='https://github.com/dwatkinsweb/django-skin',
    license='MIT',
    author='David Watkins',
    author_email='dwatkinsweb@gmail.com',
    description='Add template skins to django.',
    platforms='any',
    install_requires=[
        'Django==1.6'
    ],
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    test_suite='nose.collector',
    tests_require=[
        'nose',
        'mock'
    ],
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
#   This Python module is part of the PyRate software package.
#
#   Copyright 2017 Geoscience Australia
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
from setuptools import setup
from setuptools.command.test import test as TestCommand
from subprocess import check_output
import sys

python_version = sys.version_info
__version__ = "0.3.0_3"

# Get requirements (and dev requirements for testing) from requirements
#  txt files. Also ensure we are using correct GDAL version.
with open('requirements.txt') as f:
    requirements = f.read().splitlines()
with open('requirements-test.txt') as f:
    test_requirements = f.read().splitlines()
with open('requirements-dev.txt') as f:
    dev_requirements = f.read().splitlines()
GDAL_VERSION = check_output(["gdal-config", "--version"]).decode(
    encoding="utf-8").split('\n')[0]
requirements = [r + f'=={GDAL_VERSION}' if r == 'GDAL'
                else r for r in requirements]
setup_requirements = [r for r in requirements if "numpy==" in r]

class PyTest(TestCommand, object):
    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

    def initialize_options(self):
        super(PyTest, self).initialize_options()
        self.pytest_args = []

    def finalize_options(self):
        super(PyTest, self).finalize_options()
        self.test_suite = True
        self.test_args = []

    def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest
        exit(pytest.main(self.pytest_args))

readme = open('README.rst').read()

doclink = """

Please see the full documentation at http://geoscienceaustralia.github.io/PyRate/."""

# history = open('docs/history.rst').read().replace('.. :changelog:', '')

setup(
    name='Py-Rate',
    version=__version__,
    description='A Python tool for estimating velocity and time-series '
                'from Interferometric Synthetic Aperture Radar (InSAR) data.',
    long_description=doclink,
    author='Geoscience Australia InSAR team',
    author_email='insar@ga.gov.au',
    url='https://github.com/GeoscienceAustralia/PyRate',
    packages=['pyrate', 'pyrate.core'],
    package_dir={'PyRate': 'pyrate'},
    include_package_data=True,
    entry_points={
          'console_scripts': [
              'pyrate = pyrate.__main__:main'
          ]
      },
    setup_requires=setup_requirements,
    install_requires=requirements,
    extras_require={
        'dev': dev_requirements
    },
    tests_require=test_requirements,
    license="Apache Software License 2.0",
    zip_safe=False,
    keywords='PyRate, Python, InSAR, Geodesy, Remote Sensing, '
             'Image Processing',
    classifiers=[
        'Development Status :: 4 - Beta',
        "Operating System :: POSIX",
        "License :: OSI Approved :: Apache Software License",
        "Natural Language :: English",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Intended Audience :: Science/Research",
        "Intended Audience :: Developers",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Scientific/Engineering :: Information Analysis"
    ],
    cmdclass={
        'test': PyTest,
    }
)
<commit_msg>Increment version number<commit_after>#!/usr/bin/env python
#   This Python module is part of the PyRate software package.
#
#   Copyright 2017 Geoscience Australia
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
from setuptools import setup
from setuptools.command.test import test as TestCommand
from subprocess import check_output
import sys

python_version = sys.version_info
__version__ = "0.4.0"

# Get requirements (and dev requirements for testing) from requirements
#  txt files. Also ensure we are using correct GDAL version.
with open('requirements.txt') as f:
    requirements = f.read().splitlines()
with open('requirements-test.txt') as f:
    test_requirements = f.read().splitlines()
with open('requirements-dev.txt') as f:
    dev_requirements = f.read().splitlines()
GDAL_VERSION = check_output(["gdal-config", "--version"]).decode(
    encoding="utf-8").split('\n')[0]
requirements = [r + f'=={GDAL_VERSION}' if r == 'GDAL'
                else r for r in requirements]
setup_requirements = [r for r in requirements if "numpy==" in r]

class PyTest(TestCommand, object):
    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

    def initialize_options(self):
        super(PyTest, self).initialize_options()
        self.pytest_args = []

    def finalize_options(self):
        super(PyTest, self).finalize_options()
        self.test_suite = True
        self.test_args = []

    def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import pytest
        exit(pytest.main(self.pytest_args))

readme = open('README.rst').read()

doclink = """

Please see the full documentation at http://geoscienceaustralia.github.io/PyRate/."""

# history = open('docs/history.rst').read().replace('.. :changelog:', '')

setup(
    name='Py-Rate',
    version=__version__,
    description='A Python tool for estimating velocity and time-series '
                'from Interferometric Synthetic Aperture Radar (InSAR) data.',
    long_description=doclink,
    author='Geoscience Australia InSAR team',
    author_email='insar@ga.gov.au',
    url='https://github.com/GeoscienceAustralia/PyRate',
    packages=['pyrate', 'pyrate.core'],
    package_dir={'PyRate': 'pyrate'},
    include_package_data=True,
    entry_points={
          'console_scripts': [
              'pyrate = pyrate.__main__:main'
          ]
      },
    setup_requires=setup_requirements,
    install_requires=requirements,
    extras_require={
        'dev': dev_requirements
    },
    tests_require=test_requirements,
    license="Apache Software License 2.0",
    zip_safe=False,
    keywords='PyRate, Python, InSAR, Geodesy, Remote Sensing, '
             'Image Processing',
    classifiers=[
        'Development Status :: 4 - Beta',
        "Operating System :: POSIX",
        "License :: OSI Approved :: Apache Software License",
        "Natural Language :: English",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Intended Audience :: Science/Research",
        "Intended Audience :: Developers",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Scientific/Engineering :: Information Analysis"
    ],
    cmdclass={
        'test': PyTest,
    }
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science

author: Scott Wales <scott.wales@unimelb.edu.au>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from setuptools import setup

requirements = [
        'SQLAlchemy',
        'xray',
        ]

# Don't install dependencies when making docs
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
    requirements = []

setup(
        name             = 'ARCCSSive',
        version          = '0.1.0',
        url              = 'https://github.com/coecms/ARCCSSive',
        packages         = ['ARCCSSive', 'ARCCSSive.CMIP5'],
        install_requires = requirements,
        )
<commit_msg>Try with requirements<commit_after>#!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science

author: Scott Wales <scott.wales@unimelb.edu.au>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from setuptools import setup

requirements = [
        'SQLAlchemy',
        ]

# Don't install dependencies when making docs
# import os
# on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# if on_rtd:
#     requirements = []

setup(
        name             = 'ARCCSSive',
        version          = '0.1.0',
        url              = 'https://github.com/coecms/ARCCSSive',
        packages         = ['ARCCSSive', 'ARCCSSive.CMIP5'],
        install_requires = requirements,
        )
<|endoftext|>


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

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()

requires = [
    'ott.data',
    'ott.utils',
    'ott.geocoder',
    'ott.otp_client',

    'sqlalchemy == 0.8.6',
    'geoalchemy>=0.6',
    'gtfsdb',
    'psycopg2',

    'CherryPy',
    'pyramid',
    'waitress',
    'pyramid_tm',
    'zope.sqlalchemy',
]

extras_require = dict(
    dev=[
      'linesman'
    ],
)

#
# eggs that you need if you're running a version of python lower than 2.7
#
if sys.version_info[:2] < (2, 7):
    requires.extend(['argparse>=1.2.1', 'unittest2>=0.5.1'])

setup(
    name='ott.services',
    version='0.1.0',
    description='Open Transit Tools - Web API / Controller',
    long_description=README + '\n\n' + CHANGES,
    classifiers=[
        "Programming Language :: Python",
        "Framework :: Pyramid",
        "Topic :: Internet :: WWW/HTTP",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
    ],
    author="Open Transit Tools",
    author_email="info@opentransittools.org",

    dependency_links = [
        'git+https://github.com/OpenTransitTools/otp_client_py.git#egg=ott.otp_client-0.1.0',
        'git+https://github.com/OpenTransitTools/geocoder.git#egg=ott.geocoder-0.1.0',
        'git+https://github.com/OpenTransitTools/utils.git#egg=ott.utils-0.1.0',
        'git+https://github.com/OpenTransitTools/data.git#egg=ott.data-0.1.0',
        'hg+https://code.google.com/p/gtfsdb/#egg=gtfsdb-0.1.6',
    ],

    license="Mozilla-derived (http://opentransittools.com)",
    url='http://opentransittools.com',
    keywords='ott, otp, services, transit',
    packages=find_packages(),
    include_package_data=True,
    zip_safe=False,
    install_requires=requires,
    extras_require=extras_require,
    tests_require=requires,
    test_suite="ott.services.tests",
    entry_points="""\
        [paste.app_factory]
        main = ott.services.pyramid.app:main
    """,
)
<commit_msg>add stress testing to pyramd app<commit_after>import os
import sys
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()

requires = [
    'ott.data',
    'ott.utils',
    'ott.geocoder',
    'ott.otp_client',

    'sqlalchemy == 0.8.6',
    'geoalchemy>=0.6',
    'gtfsdb',
    'psycopg2',

    'CherryPy',
    'pyramid',
    'waitress',
    'pyramid_tm',
    'zope.sqlalchemy',
]

extras_require = dict(
    dev=[
      'linesman' if os.name != 'nt' else ''
    ],
)

#
# eggs that you need if you're running a version of python lower than 2.7
#
if sys.version_info[:2] < (2, 7):
    requires.extend(['argparse>=1.2.1', 'unittest2>=0.5.1'])

setup(
    name='ott.services',
    version='0.1.0',
    description='Open Transit Tools - Web API / Controller',
    long_description=README + '\n\n' + CHANGES,
    classifiers=[
        "Programming Language :: Python",
        "Framework :: Pyramid",
        "Topic :: Internet :: WWW/HTTP",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
    ],
    author="Open Transit Tools",
    author_email="info@opentransittools.org",

    dependency_links = [
        'git+https://github.com/OpenTransitTools/otp_client_py.git#egg=ott.otp_client-0.1.0',
        'git+https://github.com/OpenTransitTools/geocoder.git#egg=ott.geocoder-0.1.0',
        'git+https://github.com/OpenTransitTools/utils.git#egg=ott.utils-0.1.0',
        'git+https://github.com/OpenTransitTools/data.git#egg=ott.data-0.1.0',
        'hg+https://code.google.com/p/gtfsdb/#egg=gtfsdb-0.1.6',
    ],

    license="Mozilla-derived (http://opentransittools.com)",
    url='http://opentransittools.com',
    keywords='ott, otp, services, transit',
    packages=find_packages(),
    include_package_data=True,
    zip_safe=False,
    install_requires=requires,
    extras_require=extras_require,
    tests_require=requires,
    test_suite="ott.services.tests",
    entry_points="""\
        [paste.app_factory]
        main = ott.services.pyramid.app:main
    """,
)
<|endoftext|>


<commit_before>import logging as log
import os
import platform
import sys
from distutils.command.build import build as _build
from distutils.errors import DistutilsSetupError
from distutils.spawn import find_executable
from distutils.sysconfig import get_python_lib
from multiprocessing import cpu_count
from shutil import rmtree
from subprocess import Popen

from setuptools import setup

def run_process(cmds):
    p = Popen(cmds)
    p.wait()
    return p.returncode

log.basicConfig(stream=sys.stdout, level=log.INFO)

# Change the cwd to our source dir
try:
    this_file = __file__
except NameError:
    this_file = sys.argv[0]
this_file = os.path.abspath(this_file)
if os.path.dirname(this_file):
    os.chdir(os.path.dirname(this_file))
script_dir = os.getcwd()

# Clean up temp and package folders
d = os.path.join(script_dir, "build")
if os.path.isdir(d):
    log.info("Removing " + d)
    rmtree(d)

class build(_build):
    def __init__(self, *args, **kwargs):
        _build.__init__(self, *args, **kwargs)
        self.script_dir = None
        self.build_dir = None
        self.cmake_path = None
        self.make_path = None
        self.hg_path = None
        self.cxx_path = None
        self.cc_path = None
        self.install_prefix = None
        self.py_executable = None
        self.py_version = None

    def run(self):
        py_executable = sys.executable
        py_version = "%s.%s" % (sys.version_info[0], sys.version_info[1])
        build_name = "py%s-%s" % (py_version, platform.architecture()[0])
        build_dir = os.path.join(script_dir, "build", build_name)

        self.script_dir = script_dir
        self.build_dir = build_dir
        self.cmake_path = os.environ.get("CMAKE") or find_executable("cmake")
        if not self.cmake_path:
            raise DistutilsSetupError("`cmake` not found, and `CMAKE` is not set.")
        self.make_path = os.environ.get("MAKE") or find_executable("make")
        if not self.make_path:
            raise DistutilsSetupError("`make` not found, and `MAKE` is not set.")
        self.hg_path = find_executable("hg")
        if not self.hg_path:
            raise DistutilsSetupError("`hg` not found.")
        self.cc_path = os.environ.get("CC") or find_executable("gcc")
        if not self.cc_path:
            raise DistutilsSetupError("`gcc` not found, and `CC` is not set.")
        self.cxx_path = os.environ.get("CXX") or find_executable("g++")
        if not self.cxx_path:
            raise DistutilsSetupError("`g++` not found, and `CXX` is not set.")
        self.install_prefix = os.path.join(get_python_lib(), os.pardir, os.pardir, os.pardir)
        self.py_executable = py_executable
        self.py_version = py_version

        log.info("=" * 30)
        log.info("CMake path: " + self.cmake_path)
        log.info("Make path: " + self.make_path)
        log.info("Mercurial path: " + self.hg_path)
        log.info("C compiler path: " + self.cc_path)
        log.info("CXX compiler path: " + self.cxx_path)
        log.info("-" * 3)
        log.info("Script directory: " + self.script_dir)
        log.info("Build directory: " + self.build_dir)
        log.info("Library installation directory: " + self.install_prefix)
        log.info("Python executable: " + self.py_executable)
        log.info("=" * 30)

        # Prepare folders
        if not os.path.exists(self.build_dir):
            log.info("Creating build directory " + self.build_dir)
            os.makedirs(self.build_dir)

        os.chdir(self.build_dir)

        hg_cmd = [self.hg_path, "clone", "https://bitbucket.org/eigen/eigen"]
        log.info("Cloning Eigen...")
        if run_process(hg_cmd) != 0:
            raise DistutilsSetupError(" ".join(hg_cmd))

        os.environ["CXX"] = self.cxx_path
        os.environ["CC"] = self.cc_path

        # Build module
        cmake_cmd = [
            self.cmake_path,
            script_dir,
            "-DCMAKE_INSTALL_PREFIX=" + self.install_prefix,
            "-DEIGEN3_INCLUDE_DIR=" + os.path.join(self.build_dir, "eigen"),
            "-DPYTHON=" + self.py_executable,
            ]
        boost_prefix = os.environ.get("BOOST")
        if boost_prefix:
            cmake_cmd += [
                "-DBOOST_ROOT:PATHNAME=" + boost_prefix,
                "-DBoost_NO_BOOST_CMAKE=TRUE",
                "-DBoost_NO_SYSTEM_PATHS=TRUE",
                "-DBoost_LIBRARY_DIRS:FILEPATH=" + boost_prefix + "/lib",
            ]
        log.info("Configuring...")
        if run_process(cmake_cmd) != 0:
            raise DistutilsSetupError(" ".join(cmake_cmd))

        make_cmd = [self.make_path, "-j", str(cpu_count())]
        log.info("Compiling...")
        if run_process(make_cmd) != 0:
            raise DistutilsSetupError(" ".join(make_cmd))

        make_cmd = [self.make_path, "install"]
        log.info("Installing...")
        if run_process(make_cmd) != 0:
            raise DistutilsSetupError(" ".join(make_cmd))

        setup_cmd = [sys.executable, "setup.py", "install"]
        log.info("Installing Python modules...")
        os.chdir("python")
        if run_process(setup_cmd) != 0:
            raise DistutilsSetupError(" ".join(setup_cmd))

        os.chdir(self.script_dir)

try:
    import pypandoc
    long_description = pypandoc.convert("README.md", "rst")
except (IOError, ImportError):
    long_description = ""

setup(
    name="dyNET",
    #version="0.0.0",
    install_requires=["cython", "numpy"],
    description="The Dynamic Neural Network Toolkit",
    long_description=long_description,
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Environment :: Console",
        "Environment :: MacOS X",
        "Environment :: Win32 (MS Windows)",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Operating System :: POSIX :: Linux",
        "Operating System :: Microsoft",
        "Operating System :: Microsoft :: Windows",
        "Programming Language :: C++",
        "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.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
    ],
    author="Graham Neubig",
    author_email="dynet-users@googlegroups.com",
    url="https://github.com/clab/dynet",
    download_url="https://github.com/clab/dynet/releases",
    license="Apache 2.0",
    cmdclass={"build": build},
)
<commit_msg>Allow setting make flags by env var MAKE_FLAGS for pip installation<commit_after>import logging as log
import os
import platform
import sys
from distutils.command.build import build as _build
from distutils.errors import DistutilsSetupError
from distutils.spawn import find_executable
from distutils.sysconfig import get_python_lib
from multiprocessing import cpu_count
from shutil import rmtree
from subprocess import Popen

from setuptools import setup

def run_process(cmds):
    p = Popen(cmds)
    p.wait()
    return p.returncode

log.basicConfig(stream=sys.stdout, level=log.INFO)

# Change the cwd to our source dir
try:
    this_file = __file__
except NameError:
    this_file = sys.argv[0]
this_file = os.path.abspath(this_file)
if os.path.dirname(this_file):
    os.chdir(os.path.dirname(this_file))
script_dir = os.getcwd()

# Clean up temp and package folders
d = os.path.join(script_dir, "build")
if os.path.isdir(d):
    log.info("Removing " + d)
    rmtree(d)

class build(_build):
    def __init__(self, *args, **kwargs):
        _build.__init__(self, *args, **kwargs)
        self.script_dir = None
        self.build_dir = None
        self.cmake_path = None
        self.make_path = None
        self.hg_path = None
        self.cxx_path = None
        self.cc_path = None
        self.install_prefix = None
        self.py_executable = None
        self.py_version = None

    def run(self):
        py_executable = sys.executable
        py_version = "%s.%s" % (sys.version_info[0], sys.version_info[1])
        build_name = "py%s-%s" % (py_version, platform.architecture()[0])
        build_dir = os.path.join(script_dir, "build", build_name)

        self.script_dir = script_dir
        self.build_dir = build_dir
        self.cmake_path = os.environ.get("CMAKE") or find_executable("cmake")
        if not self.cmake_path:
            raise DistutilsSetupError("`cmake` not found, and `CMAKE` is not set.")
        self.make_path = os.environ.get("MAKE") or find_executable("make")
        if not self.make_path:
            raise DistutilsSetupError("`make` not found, and `MAKE` is not set.")
		self.make_flags = os.environ.get("MAKE_FLAGS", "-j %d" % cpu_count()).split()
        self.hg_path = find_executable("hg")
        if not self.hg_path:
            raise DistutilsSetupError("`hg` not found.")
        self.cc_path = os.environ.get("CC") or find_executable("gcc")
        if not self.cc_path:
            raise DistutilsSetupError("`gcc` not found, and `CC` is not set.")
        self.cxx_path = os.environ.get("CXX") or find_executable("g++")
        if not self.cxx_path:
            raise DistutilsSetupError("`g++` not found, and `CXX` is not set.")
        self.install_prefix = os.path.join(get_python_lib(), os.pardir, os.pardir, os.pardir)
        self.py_executable = py_executable
        self.py_version = py_version

        log.info("=" * 30)
        log.info("CMake path: " + self.cmake_path)
        log.info("Make path: " + self.make_path)
        log.info("Mercurial path: " + self.hg_path)
        log.info("C compiler path: " + self.cc_path)
        log.info("CXX compiler path: " + self.cxx_path)
        log.info("-" * 3)
        log.info("Script directory: " + self.script_dir)
        log.info("Build directory: " + self.build_dir)
        log.info("Library installation directory: " + self.install_prefix)
        log.info("Python executable: " + self.py_executable)
        log.info("=" * 30)

        # Prepare folders
        if not os.path.exists(self.build_dir):
            log.info("Creating build directory " + self.build_dir)
            os.makedirs(self.build_dir)

        os.chdir(self.build_dir)

        hg_cmd = [self.hg_path, "clone", "https://bitbucket.org/eigen/eigen"]
        log.info("Cloning Eigen...")
        if run_process(hg_cmd) != 0:
            raise DistutilsSetupError(" ".join(hg_cmd))

        os.environ["CXX"] = self.cxx_path
        os.environ["CC"] = self.cc_path

        # Build module
        cmake_cmd = [
            self.cmake_path,
            script_dir,
            "-DCMAKE_INSTALL_PREFIX=" + self.install_prefix,
            "-DEIGEN3_INCLUDE_DIR=" + os.path.join(self.build_dir, "eigen"),
            "-DPYTHON=" + self.py_executable,
            ]
        boost_prefix = os.environ.get("BOOST")
        if boost_prefix:
            cmake_cmd += [
                "-DBOOST_ROOT:PATHNAME=" + boost_prefix,
                "-DBoost_NO_BOOST_CMAKE=TRUE",
                "-DBoost_NO_SYSTEM_PATHS=TRUE",
                "-DBoost_LIBRARY_DIRS:FILEPATH=" + boost_prefix + "/lib",
            ]
        log.info("Configuring...")
        if run_process(cmake_cmd) != 0:
            raise DistutilsSetupError(" ".join(cmake_cmd))

        make_cmd = [self.make_path] + self.make_flags
        log.info("Compiling...")
        if run_process(make_cmd) != 0:
            raise DistutilsSetupError(" ".join(make_cmd))

        make_cmd = [self.make_path, "install"]
        log.info("Installing...")
        if run_process(make_cmd) != 0:
            raise DistutilsSetupError(" ".join(make_cmd))

        setup_cmd = [sys.executable, "setup.py", "install"]
        log.info("Installing Python modules...")
        os.chdir("python")
        if run_process(setup_cmd) != 0:
            raise DistutilsSetupError(" ".join(setup_cmd))

        os.chdir(self.script_dir)

try:
    import pypandoc
    long_description = pypandoc.convert("README.md", "rst")
except (IOError, ImportError):
    long_description = ""

setup(
    name="dyNET",
    #version="0.0.0",
    install_requires=["cython", "numpy"],
    description="The Dynamic Neural Network Toolkit",
    long_description=long_description,
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Environment :: Console",
        "Environment :: MacOS X",
        "Environment :: Win32 (MS Windows)",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: POSIX",
        "Operating System :: POSIX :: Linux",
        "Operating System :: Microsoft",
        "Operating System :: Microsoft :: Windows",
        "Programming Language :: C++",
        "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.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
    ],
    author="Graham Neubig",
    author_email="dynet-users@googlegroups.com",
    url="https://github.com/clab/dynet",
    download_url="https://github.com/clab/dynet/releases",
    license="Apache 2.0",
    cmdclass={"build": build},
)
<|endoftext|>


<commit_before>import os
import glob
import fnmatch
from setuptools import setup

def opj(*args):
    path = os.path.join(*args)
    return os.path.normpath(path)

badnames = [".pyc", ".py", "~", "no_"]

def find_data_files(srcdir, *wildcards, **kw):
    # get a list of all files under the srcdir matching wildcards,
    # returned in a format to be used for install_data
    def walk_helper(arg, dirname, files):
        if '.svn' in dirname:
            return
        names = []
        lst, wildcards = arg
        for wc in wildcards:
            wc_name = opj(dirname, wc)
            for f in files:
                filename = opj(dirname, f)

                if not any(bad in filename for bad in badnames):
                    if fnmatch.fnmatch(filename, wc_name)\
                            and not os.path.isdir(filename):
                        names.append(filename)
        if names:
            lst.append((dirname, names))

    file_list = []
    recursive = kw.get('recursive', True)
    if recursive:
        os.path.walk(srcdir, walk_helper, (file_list, wildcards))
    else:
        walk_helper((file_list, wildcards),
                    srcdir,
                    [os.path.basename(f) for f in glob.glob(opj(srcdir, '*'))])
    return file_list
files = find_data_files('sacrud/', '*.*')
print 'files', files

setup(
    name='sacrud',
    version='0.0.1b',
    url='http://github.com/uralbash/sacrud/',
    author='Svintsov Dmitry',
    author_email='root@uralbash.ru',

    packages=['sacrud', 'sacrud.pyramid_ext'],
    data_files=files,
    include_package_data=True,
    zip_safe=False,
    test_suite="pyramid_ext.tests",
    license="GPL",
    package_dir={'sacrud': 'sacrud'},
    package_data={
        'sacrud': ['static/*',
                    'templates/*.jinja2', 'templates/forms/*.jinja2',
                    'templates/types/*.jinja2',
                    'tests/*.py',
                    ],
        'sacrud.pyramid_ext': ['tests/*.py']
    },
    description='SQLAlchemy CRUD.',
    long_description=open('README.md').read(),
    install_requires=[
        "sqlalchemy",
        "pyramid",
        "transaction",
        'zope.sqlalchemy',
        'pyramid_jinja2'
    ],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License (GPL)',
        'Natural Language :: English',
        'Natural Language :: Russian',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Database',
        ],
)
<commit_msg>fix setup.py<commit_after>import os
import glob
import fnmatch
from setuptools import setup

def opj(*args):
    path = os.path.join(*args)
    return os.path.normpath(path)

badnames = [".pyc", ".py", "~", "no_"]

def find_data_files(srcdir, *wildcards, **kw):
    # get a list of all files under the srcdir matching wildcards,
    # returned in a format to be used for install_data
    def walk_helper(arg, dirname, files):
        if '.svn' in dirname:
            return
        names = []
        lst, wildcards = arg
        for wc in wildcards:
            wc_name = opj(dirname, wc)
            for f in files:
                filename = opj(dirname, f)

                if not any(bad in filename for bad in badnames):
                    if fnmatch.fnmatch(filename, wc_name)\
                            and not os.path.isdir(filename):
                        names.append(filename)
        if names:
            lst.append((dirname, names))

    file_list = []
    recursive = kw.get('recursive', True)
    if recursive:
        os.path.walk(srcdir, walk_helper, (file_list, wildcards))
    else:
        walk_helper((file_list, wildcards),
                    srcdir,
                    [os.path.basename(f) for f in glob.glob(opj(srcdir, '*'))])
    return file_list
files = find_data_files('sacrud/', '*.*')
print 'files', files

setup(
    name='sacrud',
    version='0.0.1b',
    url='http://github.com/uralbash/sacrud/',
    author='Svintsov Dmitry',
    author_email='root@uralbash.ru',

    packages=['sacrud', 'sacrud.pyramid_ext'],
    data_files=files,
    include_package_data=True,
    zip_safe=False,
    test_suite="pyramid_ext.tests",
    license="GPL",
    package_dir={'sacrud': 'sacrud'},
    package_data={
        'sacrud': ['static/style/*',
                   'static/js/*',
                   'templates/*.jinja2', 'templates/forms/*.jinja2',
                   'templates/types/*.jinja2',
                   'tests/*.py',
                    ],
        'sacrud.pyramid_ext': ['tests/*.py']
    },
    description='SQLAlchemy CRUD.',
    long_description=open('README.md').read(),
    install_requires=[
        "sqlalchemy",
        "pyramid",
        "transaction",
        'zope.sqlalchemy',
        'pyramid_jinja2'
    ],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License (GPL)',
        'Natural Language :: English',
        'Natural Language :: Russian',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Database',
        ],
)
<|endoftext|>


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

setup(
    name='pylogrotate',
    version='0.0.5',
    description='Logrotate in python',
    author='gfreezy',
    author_email='gfreezy@gmail.com',
    url='https://github.com/xiachufang/pylogrotate',
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
    install_requires=['pyyaml'],
    license='MIT',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: Chinese (Simplified)',
        'Programming Language :: Python :: 2.7',
    ],
    entry_points = {
        'console_scripts': ['pylogrotate=pylogrotate.main:main'],
    },
    keywords='logrotate',
)
<commit_msg>bump to 0.0.6<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages

setup(
    name='pylogrotate',
    version='0.0.6',
    description='Logrotate in python',
    author='gfreezy',
    author_email='gfreezy@gmail.com',
    url='https://github.com/xiachufang/pylogrotate',
    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
    install_requires=['pyyaml'],
    license='MIT',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: Chinese (Simplified)',
        'Programming Language :: Python :: 2.7',
    ],
    entry_points={
        'console_scripts': ['pylogrotate=pylogrotate.main:main'],
    },
    keywords='logrotate',
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(
    name='django-extra-views',
    version='0.2.2',
    url='https://github.com/AndrewIngram/django-extra-views',
    description="Extra class-based views for Django",
    long_description=open('README.rst', 'r').read(),
    license="MIT",
    author="Andrew Ingram",
    author_email="andy@andrewingram.net",
    packages=['extra_views'],
    package_dir={'': '.'},
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Programming Language :: Python']
)
<commit_msg>bumped version<commit_after>from setuptools import setup

setup(
    name='django-extra-views',
    version='0.2.3',
    url='https://github.com/AndrewIngram/django-extra-views',
    description="Extra class-based views for Django",
    long_description=open('README.rst', 'r').read(),
    license="MIT",
    author="Andrew Ingram",
    author_email="andy@andrewingram.net",
    packages=['extra_views'],
    package_dir={'': '.'},
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Programming Language :: Python']
)
<|endoftext|>


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

__author__ = 'Rafael Zamora, rz4@hood.edu'

from setuptools import setup, find_packages
import numpy as np

setup(
    name="DeepDoom-DE",
    version="0.1.0",
    description="Deep Reinforcement Learning Development Environment Powered By ViZDoom 1.1.1. and Keras 2.0",
    license="MIT",
    keywords="Doom Deep Reinforcement Learning",
    packages=find_packages(where='src/.', exclude=["data", "docker"]),
    package_dir={'deepdoomde':'src/deepdoomde'},
    package_data={'src/deepdoomde/':['agent_config.cfg','deepdoom.wad']},
    include_dirs = [np.get_include()],
    include_package_data=True,
    install_requires = ["keras", "tensorflow", "h5py", "matplotlib", "tqdm", "opencv-python", "keras-vis", "wget", "vizdoom"],
)
<commit_msg>Revised Directories<commit_after>#!/usr/bin/env python3

__author__ = 'Rafael Zamora, rz4@hood.edu'

from setuptools import setup, find_packages
import numpy as np

setup(
    name="DeepDoom-DE",
    version="0.1.0",
    description="Deep Reinforcement Learning Development Environment Powered By ViZDoom 1.1.1. and Keras 2.0",
    license="MIT",
    keywords="Doom Deep Reinforcement Learning",
    packages=find_packages(where='src/.', exclude=["data", "docker"]),
    package_dir={'deepdoomde':'src/deepdoomde'},
    package_data={'deepdoomde':['agent_config.cfg','deepdoom.wad']},
    include_dirs = [np.get_include()],
    include_package_data=True,
    install_requires = ["keras", "tensorflow", "h5py", "matplotlib", "tqdm", "opencv-python", "keras-vis", "wget", "vizdoom"],
)
<|endoftext|>


<commit_before>import sys
import os

from setuptools import setup

long_description = open('README.rst').read()

classifiers = [
    'Development Status :: 4 - Beta',
    'License :: OSI Approved :: BSD License',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
]

setup_kwargs = dict(
    name='powershift-cluster',
    version='2.2.0',
    description='PowerShift command plugin for creating OpenShift clusters.',
    long_description=long_description,
    url='https://github.com/getwarped/powershift-cluster',
    author='Graham Dumpleton',
    author_email='Graham.Dumpleton@gmail.com',
    license='BSD',
    classifiers=classifiers,
    keywords='openshift kubernetes',
    packages=['powershift', 'powershift.cluster', 'powershift.cluster.scripts'],
    package_dir={'powershift': 'src/powershift'},
    install_requires=['passlib'],
    extras_require={'cli': ['powershift-cli>=1.1.8']},
    entry_points = {'powershift_cli_plugins': ['cluster = powershift.cluster']},
    package_data = {'powershift.cluster.scripts': ['enable-labels.sh',
        'enable-htpasswd.sh']},
)

setup(**setup_kwargs)
<commit_msg>Ensure using cli package which oc client verification function.<commit_after>import sys
import os

from setuptools import setup

long_description = open('README.rst').read()

classifiers = [
    'Development Status :: 4 - Beta',
    'License :: OSI Approved :: BSD License',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
]

setup_kwargs = dict(
    name='powershift-cluster',
    version='2.2.0',
    description='PowerShift command plugin for creating OpenShift clusters.',
    long_description=long_description,
    url='https://github.com/getwarped/powershift-cluster',
    author='Graham Dumpleton',
    author_email='Graham.Dumpleton@gmail.com',
    license='BSD',
    classifiers=classifiers,
    keywords='openshift kubernetes',
    packages=['powershift', 'powershift.cluster', 'powershift.cluster.scripts'],
    package_dir={'powershift': 'src/powershift'},
    install_requires=['passlib'],
    extras_require={'cli': ['powershift-cli>=1.2.0']},
    entry_points = {'powershift_cli_plugins': ['cluster = powershift.cluster']},
    package_data = {'powershift.cluster.scripts': ['enable-labels.sh',
        'enable-htpasswd.sh']},
)

setup(**setup_kwargs)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

__version__ = '0.1.3'
__description__ = 'Django CepField'
__long_description__ = 'Auto fill address using brasizilian CEP number.'

__author__ = 'Marcus Bodock'
__author_email__ = 'mbodock@gmail.com'

requires = [i.strip() for i in open("requirements.txt").readlines()]

testing_extras = [
    'pytest',
    'pytest-cov',
]

setup(
    name='django-cepfield',
    version=__version__,
    author=__author__,
    author_email=__author_email__,
    packages=find_packages(),
    license='MIT',
    description=__description__,
    long_description=__long_description__,
    url='https://github.com/mbodock/django-cepfield/',
    keywords='Django, CEP, Address, Brazil',
    include_package_data=True,
    zip_safe=False,
    install_requires=requires,
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Topic :: Software Development',
        'Environment :: Web Environment',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'License :: OSI Approved :: MIT License',
    ],
    tests_require=['pytest'],
    extras_require={
        'testing': testing_extras,
    },
)
<commit_msg>Version Bump<commit_after>from setuptools import setup, find_packages

__version__ = '0.1.4'
__description__ = 'Django CepField'
__long_description__ = 'Auto fill address using brasizilian CEP number.'

__author__ = 'Marcus Bodock'
__author_email__ = 'mbodock@gmail.com'

requires = [i.strip() for i in open("requirements.txt").readlines()]

testing_extras = [
    'pytest',
    'pytest-cov',
]

setup(
    name='django-cepfield',
    version=__version__,
    author=__author__,
    author_email=__author_email__,
    packages=find_packages(),
    license='MIT',
    description=__description__,
    long_description=__long_description__,
    url='https://github.com/mbodock/django-cepfield/',
    keywords='Django, CEP, Address, Brazil',
    include_package_data=True,
    zip_safe=False,
    install_requires=requires,
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Topic :: Software Development',
        'Environment :: Web Environment',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'License :: OSI Approved :: MIT License',
    ],
    tests_require=['pytest'],
    extras_require={
        'testing': testing_extras,
    },
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import glob
import os
import sys

#import ah_bootstrap
from setuptools import setup

#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
    import builtins
else:
    import __builtin__ as builtins
builtins._ASTROPY_SETUP_ = True

from astropy_helpers.setup_helpers import (
    register_commands, adjust_compiler, get_debug_option, get_package_info)
from astropy_helpers.git_helpers import get_git_devstr
from astropy_helpers.version_helpers import generate_version_py

# Get some values from the setup.cfg
from distutils import config
conf = config.ConfigParser()
conf.read(['setup.cfg'])
metadata = dict(conf.items('metadata'))

PACKAGENAME = metadata.get('package_name', 'packagename')
DESCRIPTION = metadata.get('description', 'Astropy affiliated package')
AUTHOR = metadata.get('author', '')
AUTHOR_EMAIL = metadata.get('author_email', '')
LICENSE = metadata.get('license', 'unknown')
URL = metadata.get('url', 'http://astropy.org')

# Get the long description from the package's docstring
__import__(PACKAGENAME)
package = sys.modules[PACKAGENAME]
LONG_DESCRIPTION = package.__doc__

# Store the package name in a built-in variable so it's easy
# to get from other parts of the setup infrastructure
builtins._ASTROPY_PACKAGE_NAME_ = PACKAGENAME

# VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION = '0.3.1'

# Indicates if this version is a release version
RELEASE = 'dev' not in VERSION

if not RELEASE:
    VERSION += get_git_devstr(False)

# Populate the dict of setup command overrides; this should be done before
# invoking any other functionality from distutils since it can potentially
# modify distutils' behavior.
cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE)

# Freeze build information in version.py
generate_version_py(PACKAGENAME, VERSION, RELEASE,
                    get_debug_option(PACKAGENAME))

# Treat everything in scripts except README.rst as a script to be installed
scripts = [fname for fname in glob.glob(os.path.join('scripts', '*'))
           if os.path.basename(fname) != 'README.rst']

# Get configuration information from all of the various subpackages.
# See the docstring for setup_helpers.update_package_files for more
# details.
package_info = get_package_info()

# Add the project-global data
package_info['package_data'].setdefault(PACKAGENAME, [])
package_info['package_data'][PACKAGENAME].append('data/*.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/*.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/recipe-templates/aplpy/*.*')

# Package now included as part of MANIFEST.in

# Define entry points for command-line scripts
entry_points = {'console_scripts': []}

entry_point_list = conf.items('entry_points')
for entry_point in entry_point_list:
    entry_points['console_scripts'].append('{0} = {1}'.format(entry_point[0],
                                                              entry_point[1]))

# Include all .c files, recursively, including those generated by
# Cython, since we can not do this in MANIFEST.in with a "dynamic"
# directory name.
c_files = []
for root, dirs, files in os.walk(PACKAGENAME):
    for filename in files:
        if filename.endswith('.c'):
            c_files.append(
                os.path.join(
                    os.path.relpath(root, PACKAGENAME), filename))
package_info['package_data'][PACKAGENAME].extend(c_files)

# Note that requires and provides should not be included in the call to
# ``setup``, since these are now deprecated. See this link for more details:
# https://groups.google.com/forum/#!topic/astropy-dev/urYO8ckB2uM

setup(name=PACKAGENAME,
      version=VERSION,
      description=DESCRIPTION,
      scripts=scripts,
      install_requires=['obvious-ci', 'jinja2'],
      author=AUTHOR,
      author_email=AUTHOR_EMAIL,
      license=LICENSE,
      url=URL,
      long_description=LONG_DESCRIPTION,
      cmdclass=cmdclassd,
      zip_safe=False,
      use_2to3=True,
      entry_points=entry_points,
      **package_info
)
<commit_msg>Back to dev<commit_after>#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import glob
import os
import sys

#import ah_bootstrap
from setuptools import setup

#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
    import builtins
else:
    import __builtin__ as builtins
builtins._ASTROPY_SETUP_ = True

from astropy_helpers.setup_helpers import (
    register_commands, adjust_compiler, get_debug_option, get_package_info)
from astropy_helpers.git_helpers import get_git_devstr
from astropy_helpers.version_helpers import generate_version_py

# Get some values from the setup.cfg
from distutils import config
conf = config.ConfigParser()
conf.read(['setup.cfg'])
metadata = dict(conf.items('metadata'))

PACKAGENAME = metadata.get('package_name', 'packagename')
DESCRIPTION = metadata.get('description', 'Astropy affiliated package')
AUTHOR = metadata.get('author', '')
AUTHOR_EMAIL = metadata.get('author_email', '')
LICENSE = metadata.get('license', 'unknown')
URL = metadata.get('url', 'http://astropy.org')

# Get the long description from the package's docstring
__import__(PACKAGENAME)
package = sys.modules[PACKAGENAME]
LONG_DESCRIPTION = package.__doc__

# Store the package name in a built-in variable so it's easy
# to get from other parts of the setup infrastructure
builtins._ASTROPY_PACKAGE_NAME_ = PACKAGENAME

# VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION = '0.3.2.dev'

# Indicates if this version is a release version
RELEASE = 'dev' not in VERSION

if not RELEASE:
    VERSION += get_git_devstr(False)

# Populate the dict of setup command overrides; this should be done before
# invoking any other functionality from distutils since it can potentially
# modify distutils' behavior.
cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE)

# Freeze build information in version.py
generate_version_py(PACKAGENAME, VERSION, RELEASE,
                    get_debug_option(PACKAGENAME))

# Treat everything in scripts except README.rst as a script to be installed
scripts = [fname for fname in glob.glob(os.path.join('scripts', '*'))
           if os.path.basename(fname) != 'README.rst']

# Get configuration information from all of the various subpackages.
# See the docstring for setup_helpers.update_package_files for more
# details.
package_info = get_package_info()

# Add the project-global data
package_info['package_data'].setdefault(PACKAGENAME, [])
package_info['package_data'][PACKAGENAME].append('data/*.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/*.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/.*')
package_info['package_data'][PACKAGENAME].append('data/template-build-files/recipe-templates/aplpy/*.*')

# Package now included as part of MANIFEST.in

# Define entry points for command-line scripts
entry_points = {'console_scripts': []}

entry_point_list = conf.items('entry_points')
for entry_point in entry_point_list:
    entry_points['console_scripts'].append('{0} = {1}'.format(entry_point[0],
                                                              entry_point[1]))

# Include all .c files, recursively, including those generated by
# Cython, since we can not do this in MANIFEST.in with a "dynamic"
# directory name.
c_files = []
for root, dirs, files in os.walk(PACKAGENAME):
    for filename in files:
        if filename.endswith('.c'):
            c_files.append(
                os.path.join(
                    os.path.relpath(root, PACKAGENAME), filename))
package_info['package_data'][PACKAGENAME].extend(c_files)

# Note that requires and provides should not be included in the call to
# ``setup``, since these are now deprecated. See this link for more details:
# https://groups.google.com/forum/#!topic/astropy-dev/urYO8ckB2uM

setup(name=PACKAGENAME,
      version=VERSION,
      description=DESCRIPTION,
      scripts=scripts,
      install_requires=['obvious-ci', 'jinja2'],
      author=AUTHOR,
      author_email=AUTHOR_EMAIL,
      license=LICENSE,
      url=URL,
      long_description=LONG_DESCRIPTION,
      cmdclass=cmdclassd,
      zip_safe=False,
      use_2to3=True,
      entry_points=entry_points,
      **package_info
)
<|endoftext|>