<commit_before># This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import os
import setuptools
import sys

import shuup_setup_utils as utils

TOPDIR = os.path.abspath(os.path.dirname(__file__))
LONG_DESCRIPTION_FILE = os.path.join(TOPDIR, "README.rst")
VERSION_FILE = os.path.join(TOPDIR, "shuup", "_version.py")

# Release instructions
#
#  1. Update the Change Log (CHANGELOG.md)
#      - Make sure all relevant changes since last release are listed
#      - Remove the instruction bullet point ("List all changes after
#        x.x.x here...")
#      - Change the "Unreleased" header to appropriate version header.
#        See header of the last release for example.
#  2. Update VERSION variable here: Increase and drop .post0.dev suffix
#  4. Update version and release variables in doc/conf.py
#  5. Commit changes of steps 1--4
#  6. Tag the commit (of step 5) with
#        git tag -a -m "Shuup X.Y.Z" vX.Y.Z
#     where X.Y.Z is the new version number (must be same as VERSION
#     variable here)
#  7. Check the tag is OK and push it with
#        git push origin refs/tags/vX.Y.Z
#  8. Do a post-release commit:
#      - Add new "Unreleased" header and instruction bullet point to
#        Change Log
#      - Add ".post0.dev" suffix to VERSION variable here

NAME = "shuup"
VERSION = "3.0.0b2.post0.dev"
DESCRIPTION = "E-Commerce Platform"
AUTHOR = "Shuup Commerce Inc."
AUTHOR_EMAIL = "shuup@shuup.com"
URL = "http://shuup.com/"
DOWNLOAD_URL_TEMPLATE = (
    "https://github.com/shuup/shuup/releases/download/" "v{version}/shuup-{version}-py2.py3-none-any.whl"
)
LICENSE = "proprietary"  # https://spdx.org/licenses/
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: Other/Proprietary License
Natural Language :: English
Natural Language :: Chinese (Simplified)
Natural Language :: Finnish
Natural Language :: Japanese
Natural Language :: Portuguese (Brazilian)
Programming Language :: JavaScript
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Internet :: WWW/HTTP :: Site Management
Topic :: Office/Business
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules
""".strip().splitlines()

EXCLUDED_PACKAGES = [
    "shuup_tests",
    "shuup_tests.*",
]

utils.add_exclude_patters(
    [
        "build",
        "doc",
        "var",
        "LC_MESSAGES",
        "local_settings.py",
    ]
)

REQUIRES = [
    "Babel==2.5.3",
    "bleach==3.1.5",
    "django>=1.11,<2.3",
    "django-bootstrap3>=11,<11.1",
    "django-countries>=6.1.2,<6.2",
    "django-enumfields>=2.0.0,<2.1",
    "django-filer>=1.7,<1.8",
    "django-filter>=2.2.0,<2.3",
    "django-jinja==2.5.0",
    "django-mptt==0.9.1",
    "django-parler==2.0.1",
    "django-polymorphic==2.1.2",
    "django-registration-redux==2.7",
    "django-reversion==3.0.5",
    "django-timezone-field==3.1",  # doesn't support Django 3 in this version
    "djangorestframework==3.11",
    "factory-boy==2.7.0",
    "fake-factory>=0.5.0,<0.5.4",
    "Jinja2==2.8.1",
    "jsonfield>=1,<3",
    "keyring>=23",
    "keyrings.alt>=4",
    "lxml>=4,<5",
    "Markdown>=3,<4",
    "openpyxl>=3.0.7,<4",
    "python-dateutil>=2.8",
    "shuup-mirage-field>=2,<3",
    "toml>=0.10.0,<1" "pytz>=2015.4",
    "requests>=2.7,<3",
    "six>=1.9,<2",
    "unicodecsv==0.14.1",
    "xlrd>=1",
]

if __name__ == "__main__":
    if "upload" in sys.argv:
        raise EnvironmentError("Uploading is blacklisted")

    version = utils.get_version(VERSION, TOPDIR, VERSION_FILE)
    utils.write_version_to_file(version, VERSION_FILE)

    setuptools.setup(
        name=NAME,
        version=version,
        description=DESCRIPTION,
        long_description=utils.get_long_description(LONG_DESCRIPTION_FILE),
        url=URL,
        download_url=DOWNLOAD_URL_TEMPLATE.format(version=version),
        author=AUTHOR,
        author_email=AUTHOR_EMAIL,
        license=LICENSE,
        classifiers=CLASSIFIERS,
        install_requires=REQUIRES,
        python_requires=">=3.6",
        packages=utils.find_packages(exclude=EXCLUDED_PACKAGES),
        include_package_data=True,
        cmdclass=utils.COMMANDS,
    )
<commit_msg>Release 3.0.0b3<commit_after># This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import os
import setuptools
import sys

import shuup_setup_utils as utils

TOPDIR = os.path.abspath(os.path.dirname(__file__))
LONG_DESCRIPTION_FILE = os.path.join(TOPDIR, "README.rst")
VERSION_FILE = os.path.join(TOPDIR, "shuup", "_version.py")

# Release instructions
#
#  1. Update the Change Log (CHANGELOG.md)
#      - Make sure all relevant changes since last release are listed
#      - Remove the instruction bullet point ("List all changes after
#        x.x.x here...")
#      - Change the "Unreleased" header to appropriate version header.
#        See header of the last release for example.
#  2. Update VERSION variable here: Increase and drop .post0.dev suffix
#  4. Update version and release variables in doc/conf.py
#  5. Commit changes of steps 1--4
#  6. Tag the commit (of step 5) with
#        git tag -a -m "Shuup X.Y.Z" vX.Y.Z
#     where X.Y.Z is the new version number (must be same as VERSION
#     variable here)
#  7. Check the tag is OK and push it with
#        git push origin refs/tags/vX.Y.Z
#  8. Do a post-release commit:
#      - Add new "Unreleased" header and instruction bullet point to
#        Change Log
#      - Add ".post0.dev" suffix to VERSION variable here

NAME = "shuup"
VERSION = "3.0.0b3"
DESCRIPTION = "E-Commerce Platform"
AUTHOR = "Shuup Commerce Inc."
AUTHOR_EMAIL = "shuup@shuup.com"
URL = "http://shuup.com/"
DOWNLOAD_URL_TEMPLATE = (
    "https://github.com/shuup/shuup/releases/download/" "v{version}/shuup-{version}-py2.py3-none-any.whl"
)
LICENSE = "proprietary"  # https://spdx.org/licenses/
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: Other/Proprietary License
Natural Language :: English
Natural Language :: Chinese (Simplified)
Natural Language :: Finnish
Natural Language :: Japanese
Natural Language :: Portuguese (Brazilian)
Programming Language :: JavaScript
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Internet :: WWW/HTTP :: Site Management
Topic :: Office/Business
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules
""".strip().splitlines()

EXCLUDED_PACKAGES = [
    "shuup_tests",
    "shuup_tests.*",
]

utils.add_exclude_patters(
    [
        "build",
        "doc",
        "var",
        "LC_MESSAGES",
        "local_settings.py",
    ]
)

REQUIRES = [
    "Babel==2.5.3",
    "bleach==3.1.5",
    "django>=1.11,<2.3",
    "django-bootstrap3>=11,<11.1",
    "django-countries>=6.1.2,<6.2",
    "django-enumfields>=2.0.0,<2.1",
    "django-filer>=1.7,<1.8",
    "django-filter>=2.2.0,<2.3",
    "django-jinja==2.5.0",
    "django-mptt==0.9.1",
    "django-parler==2.0.1",
    "django-polymorphic==2.1.2",
    "django-registration-redux==2.7",
    "django-reversion==3.0.5",
    "django-timezone-field==3.1",  # doesn't support Django 3 in this version
    "djangorestframework==3.11",
    "factory-boy==2.7.0",
    "fake-factory>=0.5.0,<0.5.4",
    "Jinja2==2.8.1",
    "jsonfield>=1,<3",
    "keyring>=23",
    "keyrings.alt>=4",
    "lxml>=4,<5",
    "Markdown>=3,<4",
    "openpyxl>=3.0.7,<4",
    "python-dateutil>=2.8",
    "shuup-mirage-field>=2,<3",
    "toml>=0.10.0,<1" "pytz>=2015.4",
    "requests>=2.7,<3",
    "six>=1.9,<2",
    "unicodecsv==0.14.1",
    "xlrd>=1",
]

if __name__ == "__main__":
    if "upload" in sys.argv:
        raise EnvironmentError("Uploading is blacklisted")

    version = utils.get_version(VERSION, TOPDIR, VERSION_FILE)
    utils.write_version_to_file(version, VERSION_FILE)

    setuptools.setup(
        name=NAME,
        version=version,
        description=DESCRIPTION,
        long_description=utils.get_long_description(LONG_DESCRIPTION_FILE),
        url=URL,
        download_url=DOWNLOAD_URL_TEMPLATE.format(version=version),
        author=AUTHOR,
        author_email=AUTHOR_EMAIL,
        license=LICENSE,
        classifiers=CLASSIFIERS,
        install_requires=REQUIRES,
        python_requires=">=3.6",
        packages=utils.find_packages(exclude=EXCLUDED_PACKAGES),
        include_package_data=True,
        cmdclass=utils.COMMANDS,
    )
<|endoftext|>


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

from setuptools import setup
import re
import sys
if sys.version < "2.2.3":
    from distutils.dist import DistributionMetadata
    DistributionMetadata.classifiers = None
    DistributionMetadata.download_url = None

# Workaround for problems caused by this import
# It's either this or hardcoding the version.
#from pyrax.version import version
with open("pyrax/version.py", "rt") as vfile:
    version_text = vfile.read()
vmatch = re.search(r'version ?= ?"(.+)"$', version_text)
version = vmatch.groups()[0]

testing_requires = ["mock"]

setup(
    name="pyrax",
    version=version,
    description="Python language bindings for the Rackspace Cloud.",
    author="Rackspace",
    author_email="ed.leafe@rackspace.com",
    url="https://github.com/rackspace/pyrax",
    keywords="pyrax rackspace cloud openstack",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: 2",
    ],
    install_requires=[
        "python-novaclient>=2.10.0",
        "rackspace-novaclient",
        "python-swiftclient",
        "httplib2",
        "keyring",
    ] + testing_requires,
    packages=[
        "pyrax",
        "pyrax/cf_wrapper",
    ],
)
<commit_msg>Updated novaclient version requirement.<commit_after>#!/usr/bin/env python

from setuptools import setup
import re
import sys
if sys.version < "2.2.3":
    from distutils.dist import DistributionMetadata
    DistributionMetadata.classifiers = None
    DistributionMetadata.download_url = None

# Workaround for problems caused by this import
# It's either this or hardcoding the version.
#from pyrax.version import version
with open("pyrax/version.py", "rt") as vfile:
    version_text = vfile.read()
vmatch = re.search(r'version ?= ?"(.+)"$', version_text)
version = vmatch.groups()[0]

testing_requires = ["mock"]

setup(
    name="pyrax",
    version=version,
    description="Python language bindings for the Rackspace Cloud.",
    author="Rackspace",
    author_email="ed.leafe@rackspace.com",
    url="https://github.com/rackspace/pyrax",
    keywords="pyrax rackspace cloud openstack",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: 2",
    ],
    install_requires=[
        "python-novaclient>=2.13.0",
        "rackspace-novaclient",
        "python-swiftclient",
        "httplib2",
        "keyring",
    ] + testing_requires,
    packages=[
        "pyrax",
        "pyrax/cf_wrapper",
    ],
)
<|endoftext|>


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

from __future__ import print_function
import os
import platform
import sys
from subprocess import Popen
from subprocess import call
from setuptools import setup, Extension
from distutils.command.build import build
from distutils.command.clean import clean
from multiprocessing import cpu_count
import time

################################################################################
# ENVIRONMENT VARIABLES
################################################################################

os.putenv('ARCHFLAGS', '-arch x86_64')
os.environ['ARCHFLAGS'] = '-arch x86_64'
AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION')
BASEPATH = os.path.dirname(os.path.abspath(__file__))
AEROSPIKE_C_HOME = os.path.join(BASEPATH, 'aerospike-client-c')

AEROSPIKE_C_TARGET = None
PLATFORM = platform.platform(1)
LINUX = 'Linux' in PLATFORM
DARWIN = 'Darwin' in PLATFORM or 'macOS' in PLATFORM
CWD = os.path.abspath(os.path.dirname(__file__))
STATIC_SSL = os.getenv('STATIC_SSL')
SSL_LIB_PATH = os.getenv('SSL_LIB_PATH')
EVENT_LIB = os.getenv('EVENT_LIB')

################################################################################
# GENERIC BUILD SETTINGS
################################################################################

include_dirs = ['src/include'] + \
    [x for x in os.getenv('CPATH', '').split(':') if len(x) > 0] + \
    ['/usr/local/opt/openssl/include'] + \
    ['aerospike-client-c/modules/common/src/include']
extra_compile_args = [
    '-std=gnu99', '-g', '-Wall', '-fPIC', '-O1', '-DDEBUG',
    '-fno-common', '-fno-strict-aliasing', '-Wno-strict-prototypes',
    '-march=nocona',
    '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT',
    '-DMARCH_x86_64',
    '-Wno-implicit-function-declaration'
]
extra_objects = []
extra_link_args = []
library_dirs = ['/usr/local/opt/openssl/lib', '/usr/local/lib']
libraries = [
    'ssl',
    'crypto',
    'pthread',
    'm',
    'z'
]
################################################################################
# STATIC SSL LINKING BUILD SETTINGS
################################################################################

if STATIC_SSL:
    extra_objects.extend(
        [SSL_LIB_PATH + 'libssl.a', SSL_LIB_PATH + 'libcrypto.a'])
    libraries.remove('ssl')
    libraries.remove('crypto')
    library_dirs.remove('/usr/local/opt/openssl/lib')

################################################################################
# PLATFORM SPECIFIC BUILD SETTINGS
################################################################################

if DARWIN:
    # ---------------------------------------------------------------------------
    # Mac Specific Compiler and Linker Settings
    # ---------------------------------------------------------------------------
    extra_compile_args = extra_compile_args + [
        '-D_DARWIN_UNLIMITED_SELECT'
    ]

    AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Darwin-x86_64'

elif LINUX:
    # ---------------------------------------------------------------------------
    # Linux Specific Compiler and Linker Settings
    # ---------------------------------------------------------------------------
    extra_compile_args = extra_compile_args + [
        '-rdynamic', '-finline-functions'
    ]
    libraries = libraries + ['rt']
    AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Linux-x86_64'
else:
    print("error: OS not supported:", PLATFORM, file=sys.stderr)
    sys.exit(8)

include_dirs = include_dirs + [
    '/usr/local/opt/openssl/include',
    AEROSPIKE_C_TARGET + '/include'
    ]
extra_objects = extra_objects + [
    AEROSPIKE_C_TARGET + '/lib/libaerospike.a'
]

os.putenv('CPATH', ':'.join(include_dirs))
os.environ['CPATH'] = ':'.join(include_dirs)

################################################################################
# SETUP
################################################################################

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

# Get the version from the relevant file
with open(os.path.join(CWD, 'VERSION'), "r", encoding='utf-8') as f:
    version = f.read()

BASEPATH = os.path.dirname(os.path.abspath(__file__))
CCLIENT_PATH = os.path.join(BASEPATH, 'aerospike-client-c')

# if EVENT_LIB is None or EVENT_LIB == "":
#     EVENT_LIB = "libevent"

if EVENT_LIB is not None:
    if EVENT_LIB == "libuv":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['uv']
    elif EVENT_LIB == "libevent":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['event_core', 'event_pthreads']
    elif EVENT_LIB == "libev":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['ev']
    else:
        print("Building aerospike with no-async support\n")

class CClientBuild(build):

    def run(self):
        if self.force == 1:
            # run original c-extension clean task
            # clean.run(self)
            cmd = [
                'make',
                'clean'
            ]
            def clean():
                call(cmd, cwd=CCLIENT_PATH)
            self.execute(clean, [], 'Clean core aerospike-client-c previous builds')

        os.putenv('LD_LIBRARY_PATH', ':'.join(library_dirs))
        os.environ['LD_LIBRARY_PATH'] = ':'.join(library_dirs)
        os.putenv('DYLD_LIBRARY_PATH', ':'.join(library_dirs))
        os.environ['DYLD_LIBRARY_PATH'] = ':'.join(library_dirs)
        # build core client
        cmd = [
            'make',
            'V=' + str(self.verbose),
        ]
        if EVENT_LIB is not None:
            cmd = [
                'make',
                'V=' + str(self.verbose),
                'EVENT_LIB='+EVENT_LIB]

        def compile():
            print(cmd, library_dirs, libraries)
            call(cmd, cwd=CCLIENT_PATH)

        self.execute(compile, [], 'Compiling core aerospike-client-c')
        # run original c-extension build code
        build.run(self)

class CClientClean(clean):

    def run(self):
        # run original c-extension clean task
        # clean.run(self)
        cmd = [
            'make',
            'clean'
        ]

        def clean():
            call(cmd, cwd=CCLIENT_PATH)

        self.execute(clean, [], 'Clean core aerospike-client-c')

setup(
    name='aerospike',
    version=version.strip(),
    description='Aerospike Client Library for Python',
    long_description=long_description,
    author='Aerospike, Inc.',
    author_email='info@aerospike.com',
    url='http://aerospike.com',
    license='Apache Software License',
    keywords=['aerospike', 'nosql', 'database'],
    classifiers=[
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX :: Linux',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Database'
    ],

    # Package Data Files
    zip_safe=False,
    include_package_data=True,

    # Data files
    ext_modules=[
        Extension(
            # Extension Name
            'aerospike',

            # Source Files
            [
                'src/main/aerospike.c',
                'src/main/exception.c',
                'src/main/log.c',
                'src/main/client/type.c',
                'src/main/client/apply.c',
                'src/main/client/bit_operate.c',
                'src/main/client/cdt_list_operate.c',
                'src/main/client/cdt_map_operate.c',
                'src/main/client/hll_operate.c',
                'src/main/client/expression_operations.c',
                'src/main/client/cdt_operation_utils.c',
                'src/main/client/close.c',
                'src/main/client/connect.c',
                'src/main/client/exists.c',
                'src/main/client/exists_many.c',
                'src/main/client/get.c',
                'src/main/client/get_async.c',
                'src/main/client/put_async.c',
                'src/main/client/get_many.c',
                'src/main/client/batch_get_ops.c',
                'src/main/client/select_many.c',
                'src/main/client/info_single_node.c',
                'src/main/client/info_random_node.c',
                'src/main/client/info_node.c',
                'src/main/client/info.c',
                'src/main/client/put.c',
                'src/main/client/operate_list.c',
                'src/main/client/operate_map.c',
                'src/main/client/operate.c',
                'src/main/client/query.c',
                'src/main/client/remove.c',
                'src/main/client/scan.c',
                'src/main/client/select.c',
                'src/main/client/tls_info_host.c',
                'src/main/client/truncate.c',
                'src/main/client/admin.c',
                'src/main/client/udf.c',
                'src/main/client/sec_index.c',
                'src/main/serializer.c',
                'src/main/client/remove_bin.c',
                'src/main/client/get_key_digest.c',
                'src/main/query/type.c',
                'src/main/query/apply.c',
                'src/main/query/add_ops.c',
                'src/main/query/foreach.c',
                'src/main/query/predexp.c',
                'src/main/query/results.c',
                'src/main/query/select.c',
                'src/main/query/where.c',
                'src/main/query/execute_background.c',
                'src/main/scan/type.c',
                'src/main/scan/foreach.c',
                'src/main/scan/results.c',
                'src/main/scan/select.c',
                'src/main/scan/execute_background.c',
                'src/main/scan/apply.c',
                'src/main/scan/add_ops.c',
                'src/main/scan/paginate.c',
                'src/main/geospatial/type.c',
                'src/main/geospatial/wrap.c',
                'src/main/geospatial/unwrap.c',
                'src/main/geospatial/loads.c',
                'src/main/geospatial/dumps.c',
                'src/main/policy.c',
                'src/main/conversions.c',
                'src/main/convert_predexp.c',
                'src/main/convert_expressions.c',
                'src/main/policy_config.c',
                'src/main/calc_digest.c',
                'src/main/predicates.c',
                'src/main/tls_config.c',
                'src/main/global_hosts/type.c',
                'src/main/nullobject/type.c',
                'src/main/cdt_types/type.c',
                'src/main/key_ordered_dict/type.c',
                'src/main/client/set_xdr_filter.c',
                'src/main/client/get_nodes.c',
                'src/main/convert_partition_filter.c',
                'src/main/client/get_key_partition_id.c'
            ],

            # Compile
            include_dirs=include_dirs,
            extra_compile_args=extra_compile_args,

            # Link
            library_dirs=library_dirs,
            libraries=libraries,
            extra_objects=extra_objects,
            extra_link_args=extra_link_args,
        )
    ],
    packages=['aerospike_helpers', 'aerospike_helpers.operations',
              'aerospike_helpers.expressions', 'aerospike_helpers.awaitable'],

    cmdclass={
        'build': CClientBuild,
        'clean': CClientClean
    }
)
<commit_msg>use io module for opening file so source-tar can be built using python27 in mac<commit_after># -*- coding: utf-8 -*-
################################################################################
# Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################

from __future__ import print_function
import os
import platform
import sys
from subprocess import Popen
from subprocess import call
from setuptools import setup, Extension
from distutils.command.build import build
from distutils.command.clean import clean
from multiprocessing import cpu_count
import time
import io

################################################################################
# ENVIRONMENT VARIABLES
################################################################################

os.putenv('ARCHFLAGS', '-arch x86_64')
os.environ['ARCHFLAGS'] = '-arch x86_64'
AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION')
BASEPATH = os.path.dirname(os.path.abspath(__file__))
AEROSPIKE_C_HOME = os.path.join(BASEPATH, 'aerospike-client-c')

AEROSPIKE_C_TARGET = None
PLATFORM = platform.platform(1)
LINUX = 'Linux' in PLATFORM
DARWIN = 'Darwin' in PLATFORM or 'macOS' in PLATFORM
CWD = os.path.abspath(os.path.dirname(__file__))
STATIC_SSL = os.getenv('STATIC_SSL')
SSL_LIB_PATH = os.getenv('SSL_LIB_PATH')
EVENT_LIB = os.getenv('EVENT_LIB')

################################################################################
# GENERIC BUILD SETTINGS
################################################################################

include_dirs = ['src/include'] + \
    [x for x in os.getenv('CPATH', '').split(':') if len(x) > 0] + \
    ['/usr/local/opt/openssl/include'] + \
    ['aerospike-client-c/modules/common/src/include']
extra_compile_args = [
    '-std=gnu99', '-g', '-Wall', '-fPIC', '-O1', '-DDEBUG',
    '-fno-common', '-fno-strict-aliasing', '-Wno-strict-prototypes',
    '-march=nocona',
    '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT',
    '-DMARCH_x86_64',
    '-Wno-implicit-function-declaration'
]
extra_objects = []
extra_link_args = []
library_dirs = ['/usr/local/opt/openssl/lib', '/usr/local/lib']
libraries = [
    'ssl',
    'crypto',
    'pthread',
    'm',
    'z'
]
################################################################################
# STATIC SSL LINKING BUILD SETTINGS
################################################################################

if STATIC_SSL:
    extra_objects.extend(
        [SSL_LIB_PATH + 'libssl.a', SSL_LIB_PATH + 'libcrypto.a'])
    libraries.remove('ssl')
    libraries.remove('crypto')
    library_dirs.remove('/usr/local/opt/openssl/lib')

################################################################################
# PLATFORM SPECIFIC BUILD SETTINGS
################################################################################

if DARWIN:
    # ---------------------------------------------------------------------------
    # Mac Specific Compiler and Linker Settings
    # ---------------------------------------------------------------------------
    extra_compile_args = extra_compile_args + [
        '-D_DARWIN_UNLIMITED_SELECT'
    ]

    AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Darwin-x86_64'

elif LINUX:
    # ---------------------------------------------------------------------------
    # Linux Specific Compiler and Linker Settings
    # ---------------------------------------------------------------------------
    extra_compile_args = extra_compile_args + [
        '-rdynamic', '-finline-functions'
    ]
    libraries = libraries + ['rt']
    AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Linux-x86_64'
else:
    print("error: OS not supported:", PLATFORM, file=sys.stderr)
    sys.exit(8)

include_dirs = include_dirs + [
    '/usr/local/opt/openssl/include',
    AEROSPIKE_C_TARGET + '/include'
    ]
extra_objects = extra_objects + [
    AEROSPIKE_C_TARGET + '/lib/libaerospike.a'
]

os.putenv('CPATH', ':'.join(include_dirs))
os.environ['CPATH'] = ':'.join(include_dirs)

################################################################################
# SETUP
################################################################################

# Get the long description from the relevant file
with io.open(os.path.join(CWD, 'README.rst'), "r", encoding='utf-8') as f:
    long_description = f.read()

# Get the version from the relevant file
with io.open(os.path.join(CWD, 'VERSION'), "r", encoding='utf-8') as f:
    version = f.read()

BASEPATH = os.path.dirname(os.path.abspath(__file__))
CCLIENT_PATH = os.path.join(BASEPATH, 'aerospike-client-c')

# if EVENT_LIB is None or EVENT_LIB == "":
#     EVENT_LIB = "libevent"

if EVENT_LIB is not None:
    if EVENT_LIB == "libuv":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['uv']
    elif EVENT_LIB == "libevent":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['event_core', 'event_pthreads']
    elif EVENT_LIB == "libev":
        extra_compile_args = extra_compile_args + ['-DAS_EVENT_LIB_DEFINED']
        library_dirs = library_dirs + ['/usr/local/lib/']
        libraries = libraries + ['ev']
    else:
        print("Building aerospike with no-async support\n")

class CClientBuild(build):

    def run(self):
        if self.force == 1:
            # run original c-extension clean task
            # clean.run(self)
            cmd = [
                'make',
                'clean'
            ]
            def clean():
                call(cmd, cwd=CCLIENT_PATH)
            self.execute(clean, [], 'Clean core aerospike-client-c previous builds')

        os.putenv('LD_LIBRARY_PATH', ':'.join(library_dirs))
        os.environ['LD_LIBRARY_PATH'] = ':'.join(library_dirs)
        os.putenv('DYLD_LIBRARY_PATH', ':'.join(library_dirs))
        os.environ['DYLD_LIBRARY_PATH'] = ':'.join(library_dirs)
        # build core client
        cmd = [
            'make',
            'V=' + str(self.verbose),
        ]
        if EVENT_LIB is not None:
            cmd = [
                'make',
                'V=' + str(self.verbose),
                'EVENT_LIB='+EVENT_LIB]

        def compile():
            print(cmd, library_dirs, libraries)
            call(cmd, cwd=CCLIENT_PATH)

        self.execute(compile, [], 'Compiling core aerospike-client-c')
        # run original c-extension build code
        build.run(self)

class CClientClean(clean):

    def run(self):
        # run original c-extension clean task
        # clean.run(self)
        cmd = [
            'make',
            'clean'
        ]

        def clean():
            call(cmd, cwd=CCLIENT_PATH)

        self.execute(clean, [], 'Clean core aerospike-client-c')

setup(
    name='aerospike',
    version=version.strip(),
    description='Aerospike Client Library for Python',
    long_description=long_description,
    author='Aerospike, Inc.',
    author_email='info@aerospike.com',
    url='http://aerospike.com',
    license='Apache Software License',
    keywords=['aerospike', 'nosql', 'database'],
    classifiers=[
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX :: Linux',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Database'
    ],

    # Package Data Files
    zip_safe=False,
    include_package_data=True,

    # Data files
    ext_modules=[
        Extension(
            # Extension Name
            'aerospike',

            # Source Files
            [
                'src/main/aerospike.c',
                'src/main/exception.c',
                'src/main/log.c',
                'src/main/client/type.c',
                'src/main/client/apply.c',
                'src/main/client/bit_operate.c',
                'src/main/client/cdt_list_operate.c',
                'src/main/client/cdt_map_operate.c',
                'src/main/client/hll_operate.c',
                'src/main/client/expression_operations.c',
                'src/main/client/cdt_operation_utils.c',
                'src/main/client/close.c',
                'src/main/client/connect.c',
                'src/main/client/exists.c',
                'src/main/client/exists_many.c',
                'src/main/client/get.c',
                'src/main/client/get_async.c',
                'src/main/client/put_async.c',
                'src/main/client/get_many.c',
                'src/main/client/batch_get_ops.c',
                'src/main/client/select_many.c',
                'src/main/client/info_single_node.c',
                'src/main/client/info_random_node.c',
                'src/main/client/info_node.c',
                'src/main/client/info.c',
                'src/main/client/put.c',
                'src/main/client/operate_list.c',
                'src/main/client/operate_map.c',
                'src/main/client/operate.c',
                'src/main/client/query.c',
                'src/main/client/remove.c',
                'src/main/client/scan.c',
                'src/main/client/select.c',
                'src/main/client/tls_info_host.c',
                'src/main/client/truncate.c',
                'src/main/client/admin.c',
                'src/main/client/udf.c',
                'src/main/client/sec_index.c',
                'src/main/serializer.c',
                'src/main/client/remove_bin.c',
                'src/main/client/get_key_digest.c',
                'src/main/query/type.c',
                'src/main/query/apply.c',
                'src/main/query/add_ops.c',
                'src/main/query/foreach.c',
                'src/main/query/predexp.c',
                'src/main/query/results.c',
                'src/main/query/select.c',
                'src/main/query/where.c',
                'src/main/query/execute_background.c',
                'src/main/scan/type.c',
                'src/main/scan/foreach.c',
                'src/main/scan/results.c',
                'src/main/scan/select.c',
                'src/main/scan/execute_background.c',
                'src/main/scan/apply.c',
                'src/main/scan/add_ops.c',
                'src/main/scan/paginate.c',
                'src/main/geospatial/type.c',
                'src/main/geospatial/wrap.c',
                'src/main/geospatial/unwrap.c',
                'src/main/geospatial/loads.c',
                'src/main/geospatial/dumps.c',
                'src/main/policy.c',
                'src/main/conversions.c',
                'src/main/convert_predexp.c',
                'src/main/convert_expressions.c',
                'src/main/policy_config.c',
                'src/main/calc_digest.c',
                'src/main/predicates.c',
                'src/main/tls_config.c',
                'src/main/global_hosts/type.c',
                'src/main/nullobject/type.c',
                'src/main/cdt_types/type.c',
                'src/main/key_ordered_dict/type.c',
                'src/main/client/set_xdr_filter.c',
                'src/main/client/get_nodes.c',
                'src/main/convert_partition_filter.c',
                'src/main/client/get_key_partition_id.c'
            ],

            # Compile
            include_dirs=include_dirs,
            extra_compile_args=extra_compile_args,

            # Link
            library_dirs=library_dirs,
            libraries=libraries,
            extra_objects=extra_objects,
            extra_link_args=extra_link_args,
        )
    ],
    packages=['aerospike_helpers', 'aerospike_helpers.operations',
              'aerospike_helpers.expressions', 'aerospike_helpers.awaitable'],

    cmdclass={
        'build': CClientBuild,
        'clean': CClientClean
    }
)
<|endoftext|>


<commit_before>__author__ = '30070_VS'

"""
Q2 Web Front-End Test
Automate the following functional test using Selenium:
1. Navigate to the Wikipedia home page, http://www.wikipedia.org/.
2. Search for a given string in English:
(a) Type in a string given as parameter in the search input field.
(b) Select English as the search language.
(c) Click the search button.
3. Validate that the first heading of the search results page matches the
search string (ignoring case).
4. Verify that the search results page is available in a language given as
parameter.
5. Navigate to the search results page in that language.
6. Validate that the search results page in the new language includes a
link to the version in English.
"""

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# Create a new instance of the Firefox driver
driver = webdriver.Firefox()

# go to the google home page
driver.get("http://www.google.com")

# the page is ajaxy so the title is originally this:
print(driver.title)

# find the element that's name attribute is q (the google search box)
inputElement = driver.find_element_by_name("q")

# type in the search
inputElement.send_keys("cheese!")

# submit the form (although google automatically searches now without submitting)
inputElement.submit()

try:
    # we have to wait for the page to refresh, the last thing that seems to be updated is the title
    WebDriverWait(driver, 10).until(EC.title_contains("cheese!"))

    # You should see "cheese! - Google Search"
    print(driver.title)

finally:
    driver.quit()
<commit_msg>Q2 Changed to work with Wikipedia<commit_after>__author__ = '30070_VS'

"""
Q2 Web Front-End Test
Automate the following functional test using Selenium:
1. .
2. Search for a given string in English:
(a) Type in a string given as parameter in the search input field.
(b) Select English as the search language.
(c) Click the search button.
3. Validate that the first heading of the search results page matches the
search string (ignoring case).
4. Verify that the search results page is available in a language given as
parameter.
5. Navigate to the search results page in that language.
6. Validate that the search results page in the new language includes a
link to the version in English.
"""

from selenium import webdriver
# from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions

# Test Data
start_page = "http://www.wikipedia.org/"
search_field_name = "search"
search_string = "London"

# Create a new instance of the Firefox driver.
driver = webdriver.Firefox()

# Navigate to the Wikipedia home page, http://www.wikipedia.org/.
driver.get(start_page)

# the page is ajaxy so the title is originally this:
print(driver.title)

# 2. Search for a given string in English:
# (a) Type in a string given as parameter in the search input field.
inputElement = driver.find_element_by_name(search_field_name)
# type in the search
inputElement.send_keys(search_string)
# submit the form (although google automatically searches now without submitting)
inputElement.submit()

try:
    # we have to wait for the page to refresh, the last thing that seems to be updated is the title
    WebDriverWait(driver, 10).until(expected_conditions.title_contains(search_string))

    print(driver.title)

finally:
    driver.quit()
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

long_description = '''mssh-copy-id is a command-line tool to copy SSH keys to multiple servers.'''
tests_require = ['mock', 'pytest', 'pytest-runner', 'pytest-cov', 'coverage']

setup(
    name='mssh-copy-id',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='0.0.1',

    description='Copy SSH keys to multiple servers',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/samuel-phan/mssh-copy-id',

    # Author details
    author='Samuel Phan',
    author_email='samuel@quoonel.com',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 4 - Beta',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Topic :: System :: Installation/Setup',
        'Topic :: System :: Systems Administration',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
    ],

    # What does your project relate to?
    keywords='ssh ssh-key ssh-copy-id',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),

    # Alternatively, if you want to distribute just a my_module.py, uncomment
    # this:
    #   py_modules=["my_module"],

    # List run-time dependencies here.  These will be installed by pip when
    # your project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['paramiko>=1.7', 'argparse'],
    tests_require=tests_require,

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install -e .[dev,test]
    extras_require={
        # 'dev': ['check-manifest'],
        'test': tests_require,
    },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    package_data={
        # 'sample': ['package_data.dat'],
    },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages. See:
    # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    scripts=['msshcopyid/bin/mssh-copy-id.py'],
    entry_points={
        'console_scripts': [
            'mssh-copy-id = msshcopyid:main',
        ],
    },
)
<commit_msg>Add the info that Python 2.7 is supported<commit_after>from setuptools import setup, find_packages

long_description = '''mssh-copy-id is a command-line tool to copy SSH keys to multiple servers.'''
tests_require = ['mock', 'pytest', 'pytest-runner', 'pytest-cov', 'coverage']

setup(
    name='mssh-copy-id',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='0.0.1',

    description='Copy SSH keys to multiple servers',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/samuel-phan/mssh-copy-id',

    # Author details
    author='Samuel Phan',
    author_email='samuel@quoonel.com',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 4 - Beta',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Topic :: System :: Installation/Setup',
        'Topic :: System :: Systems Administration',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],

    # What does your project relate to?
    keywords='ssh ssh-key ssh-copy-id',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),

    # Alternatively, if you want to distribute just a my_module.py, uncomment
    # this:
    #   py_modules=["my_module"],

    # List run-time dependencies here.  These will be installed by pip when
    # your project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['paramiko>=1.7', 'argparse'],
    tests_require=tests_require,

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install -e .[dev,test]
    extras_require={
        # 'dev': ['check-manifest'],
        'test': tests_require,
    },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    package_data={
        # 'sample': ['package_data.dat'],
    },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages. See:
    # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    scripts=['msshcopyid/bin/mssh-copy-id.py'],
    entry_points={
        'console_scripts': [
            'mssh-copy-id = msshcopyid:main',
        ],
    },
)
<|endoftext|>


<commit_before>#! /usr/bin/python
"""pytest-dependency - Manage dependencies of tests

This pytest plugin manages dependencies of tests.  It allows to mark
some tests as dependent from other tests.  These tests will then be
skipped if any of the dependencies did fail or has been skipped.
"""

__version__ = "0.3.1"

import sys
if sys.version_info < (2, 7):
    raise RuntimeError("You are using Python %s.\n"
                       "Please apply python2_6.patch first."
                       % sys.version.split()[0])
import os
import os.path
import re
from setuptools import setup
import setuptools.command.sdist as st_sdist

def _filter_file(src, dest, subst):
    """Copy src to dest doing substitutions on the fly.
    """
    substre = re.compile(r'\$(%s)' % '|'.join(subst.keys()))
    def repl(m):
        return subst[m.group(1)]
    with open(src, "rt") as sf, open(dest, "wt") as df:
        while True:
            l = sf.readline()
            if not l:
                break
            df.write(re.sub(substre, repl, l))

class sdist(st_sdist.sdist):
    def make_release_tree(self, base_dir, files):
        st_sdist.sdist.make_release_tree(self, base_dir, files)
        if not self.dry_run:
            src = "pytest_dependency.py"
            dest = os.path.join(base_dir, src)
            gitrevfile = ".gitrevision"
            if hasattr(os, 'link') and os.path.exists(dest):
                os.unlink(dest)
            subst = {'DOC': __doc__, 'VERSION': __version__}
            if os.path.exists(gitrevfile):
                with open(gitrevfile, "rt") as f:
                    subst['REVISION'] = f.readline().strip()
            _filter_file(src, dest, subst)

setup(
    name='pytest-dependency',
    version=__version__,
    description='Manage dependencies of tests',
    author='Rolf Krahl',
    author_email='rolf@rotkraut.de',
    maintainer='Rolf Krahl',
    maintainer_email='rolf@rotkraut.de',
    url='https://github.com/RKrahl/pytest-dependency',
    license='Apache Software License 2.0',
    long_description=__doc__,
    py_modules=['pytest_dependency'],
    install_requires=['pytest >= 2.8.0'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Framework :: Pytest',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Testing',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        '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',
        'Operating System :: OS Independent',
        'License :: OSI Approved :: Apache Software License',
    ],
    entry_points={
        'pytest11': [
            'dependency = pytest_dependency',
        ],
    },
    cmdclass = {'sdist': sdist},
)
<commit_msg>Set development status to Beta.<commit_after>#! /usr/bin/python
"""pytest-dependency - Manage dependencies of tests

This pytest plugin manages dependencies of tests.  It allows to mark
some tests as dependent from other tests.  These tests will then be
skipped if any of the dependencies did fail or has been skipped.
"""

__version__ = "0.3.1"

import sys
if sys.version_info < (2, 7):
    raise RuntimeError("You are using Python %s.\n"
                       "Please apply python2_6.patch first."
                       % sys.version.split()[0])
import os
import os.path
import re
from setuptools import setup
import setuptools.command.sdist as st_sdist

def _filter_file(src, dest, subst):
    """Copy src to dest doing substitutions on the fly.
    """
    substre = re.compile(r'\$(%s)' % '|'.join(subst.keys()))
    def repl(m):
        return subst[m.group(1)]
    with open(src, "rt") as sf, open(dest, "wt") as df:
        while True:
            l = sf.readline()
            if not l:
                break
            df.write(re.sub(substre, repl, l))

class sdist(st_sdist.sdist):
    def make_release_tree(self, base_dir, files):
        st_sdist.sdist.make_release_tree(self, base_dir, files)
        if not self.dry_run:
            src = "pytest_dependency.py"
            dest = os.path.join(base_dir, src)
            gitrevfile = ".gitrevision"
            if hasattr(os, 'link') and os.path.exists(dest):
                os.unlink(dest)
            subst = {'DOC': __doc__, 'VERSION': __version__}
            if os.path.exists(gitrevfile):
                with open(gitrevfile, "rt") as f:
                    subst['REVISION'] = f.readline().strip()
            _filter_file(src, dest, subst)

setup(
    name='pytest-dependency',
    version=__version__,
    description='Manage dependencies of tests',
    author='Rolf Krahl',
    author_email='rolf@rotkraut.de',
    maintainer='Rolf Krahl',
    maintainer_email='rolf@rotkraut.de',
    url='https://github.com/RKrahl/pytest-dependency',
    license='Apache Software License 2.0',
    long_description=__doc__,
    py_modules=['pytest_dependency'],
    install_requires=['pytest >= 2.8.0'],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Framework :: Pytest',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Testing',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        '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',
        'Operating System :: OS Independent',
        'License :: OSI Approved :: Apache Software License',
    ],
    entry_points={
        'pytest11': [
            'dependency = pytest_dependency',
        ],
    },
    cmdclass = {'sdist': sdist},
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
import os
import sys

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

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

readme = open('README.rst').read()
doclink = """
Documentation
-------------

The full documentation is at http://pylunar.rtfd.org."""
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

requirements = [
    "ephem",
    "pytz"
]

test_requirements = [
    "wheel>=0.22",
    "bumpversion",
    "flake8",
    "coverage",
    "Sphinx",
    "cryptography",
    "PyYAML"
]

setup(
    name='pylunar',
    version='0.5.1',
    description='Information for completing the Astronomical League\'s ' +
                'Lunar and Lunar II observing programs.',
    long_description=readme + '\n\n' + doclink + '\n\n' + history,
    author='Michael Reuter',
    author_email='mareuternh@gmail.com',
    url='https://github.com/mareuter/pylunar',
    packages=[
        'pylunar',
    ],
    package_dir={'pylunar': 'pylunar'},
    include_package_data=True,
    install_requires=requirements,
    extras_require={':python_version=="2.7"': ['enum34']},
    license='MIT',
    zip_safe=False,
    keywords='pylunar',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    test_suite='tests',
    tests_require=test_requirements

)
<commit_msg>Get requirements from file for setup.py.<commit_after>#!/usr/bin/env python
import os
import sys

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

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

readme = open('README.rst').read()
doclink = """
Documentation
-------------

The full documentation is at http://pylunar.rtfd.org."""
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

requirements = None
with open('requirements/prod.txt') as prodFile:
    requirements = [x.strip() for x in prodFile]

test_requirements = None
with open('requirements/test.txt') as testFile:
    test_requirements = [x.strip() for x in testFile]

setup(
    name='pylunar',
    version='0.5.1',
    description='Information for completing the Astronomical League\'s ' +
                'Lunar and Lunar II observing programs.',
    long_description=readme + '\n\n' + doclink + '\n\n' + history,
    author='Michael Reuter',
    author_email='mareuternh@gmail.com',
    url='https://github.com/mareuter/pylunar',
    packages=[
        'pylunar',
    ],
    package_dir={'pylunar': 'pylunar'},
    include_package_data=True,
    install_requires=requirements,
    license='MIT',
    zip_safe=False,
    keywords='pylunar',
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    test_suite='tests',
    tests_require=test_requirements
)
<|endoftext|>


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

from setuptools import extension, setup, find_packages
import os, platform, sys

if sys.version_info[0] < 3:
    from codecs import open

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

with open(path + "/README", "U", encoding="utf-8") as r:
    readme_text = r.read()

## OS X non-PPC workaround
# Apple OS X 10.6 with Xcode 4 have Python compiled with PPC but they removed
# support for compiling with that arch, so we have to override ARCHFLAGS.
if sys.platform == "darwin" and not os.environ.get("ARCHFLAGS"):
    compiler_dirn = "/usr/libexec/gcc/darwin"
    if os.path.exists(compiler_dirn):
        dir_items = os.listdir(compiler_dirn)
        if "ppc" not in dir_items:
            os.environ["ARCHFLAGS"] = "-arch i386 -arch x86_64"

from distutils.sysconfig import get_config_vars

(opt,) = get_config_vars('OPT')
if opt:
    os.environ['OPT'] = " ".join(
        flag for flag in opt.split() if flag != '-Wstrict-prototypes'
    )

cflags = ["-fno-strict-aliasing", ]

define_macros = [('HAVE_EXPAT_CONFIG_H', '1')]
libraries = []
os_name = platform.system().lower()
if os_name.find('win') >= 0:
    define_macros.append(('XML_STATIC', 1))
elif os_name.find('linux') >= 0:
    libraries.append('rt')

cpp_module = extension.Extension(
    'nkit4py',
    define_macros = define_macros,
    include_dirs=[
        './deps/include',
        './deps/expat-2.1.0/lib',
        './deps/nkit/src',
        './src'
    ],
    library_dirs=[],
    libraries=libraries,
    extra_compile_args=cflags,
    sources=['./src/wrap.cpp',
            './deps/expat-2.1.0/lib/xmlparse.c',
            './deps/expat-2.1.0/lib/xmltok.c',
            './deps/expat-2.1.0/lib/xmlrole.c',
            "./deps/yajl-2.0.5/src/yajl_lex.c",
            "./deps/yajl-2.0.5/src/yajl_encode.c",
            "./deps/yajl-2.0.5/src/yajl_parser.c",
            "./deps/yajl-2.0.5/src/yajl_version.c",
            "./deps/yajl-2.0.5/src/yajl_alloc.c",
            "./deps/yajl-2.0.5/src/yajl_buf.c",
            "./deps/yajl-2.0.5/src/yajl_tree.c",
            "./deps/yajl-2.0.5/src/yajl_gen.c",
            "./deps/yajl-2.0.5/src/yajl.c",
            "./deps/nkit/src/constants.cpp",
            "./deps/nkit/src/tools.cpp",
            "./deps/nkit/src/dynamic/dynamic.cpp",
            "./deps/nkit/src/dynamic/dynamic_json.cpp",
            "./deps/nkit/src/dynamic/dynamic_path.cpp",
            "./deps/nkit/src/dynamic/dynamic_table.cpp",
            "./deps/nkit/src/dynamic/dynamic_table_index_comparators.cpp",
            "./deps/nkit/src/dynamic/dynamic_xml.cpp",
            "./deps/nkit/src/logger/rotate_logger.cpp",
            "./deps/nkit/src/vx/encodings.cpp",
            "./deps/nkit/src/vx/vx.cpp",
            "./deps/nkit/3rd/netbsd/strptime.cpp"
             ]
)

setup(
    name='nkit4py',
    version='0.1.0.dev20',
    description='Simple and fast XML to Python object or JSON converter and filter. Written in C++ using Expat SAX parser.',
    long_description=readme_text,
    url='https://github.com/eye3/nkit4py',
    author='Boris T. Darchiev',
    author_email='boris.darchiev@gmail.com',
    license='Apache-2.0 <http://www.apache.org/licenses/LICENSE-2.0>',

    keywords='xml2py xml2json xml python object list json fast expat sax nkit nkit4py nkit4nodejs',

    py_modules=[],
    ext_modules=[cpp_module]
)
<commit_msg>Version bubble up<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import extension, setup, find_packages
import os, platform, sys

if sys.version_info[0] < 3:
    from codecs import open

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

with open(path + "/README", "U", encoding="utf-8") as r:
    readme_text = r.read()

## OS X non-PPC workaround
# Apple OS X 10.6 with Xcode 4 have Python compiled with PPC but they removed
# support for compiling with that arch, so we have to override ARCHFLAGS.
if sys.platform == "darwin" and not os.environ.get("ARCHFLAGS"):
    compiler_dirn = "/usr/libexec/gcc/darwin"
    if os.path.exists(compiler_dirn):
        dir_items = os.listdir(compiler_dirn)
        if "ppc" not in dir_items:
            os.environ["ARCHFLAGS"] = "-arch i386 -arch x86_64"

from distutils.sysconfig import get_config_vars

(opt,) = get_config_vars('OPT')
if opt:
    os.environ['OPT'] = " ".join(
        flag for flag in opt.split() if flag != '-Wstrict-prototypes'
    )

cflags = ["-fno-strict-aliasing", ]

define_macros = [('HAVE_EXPAT_CONFIG_H', '1')]
libraries = []
os_name = platform.system().lower()
if os_name.find('win') >= 0:
    define_macros.append(('XML_STATIC', 1))
elif os_name.find('linux') >= 0:
    libraries.append('rt')

cpp_module = extension.Extension(
    'nkit4py',
    define_macros = define_macros,
    include_dirs=[
        './deps/include',
        './deps/expat-2.1.0/lib',
        './deps/nkit/src',
        './src'
    ],
    library_dirs=[],
    libraries=libraries,
    extra_compile_args=cflags,
    sources=['./src/wrap.cpp',
            './deps/expat-2.1.0/lib/xmlparse.c',
            './deps/expat-2.1.0/lib/xmltok.c',
            './deps/expat-2.1.0/lib/xmlrole.c',
            "./deps/yajl-2.0.5/src/yajl_lex.c",
            "./deps/yajl-2.0.5/src/yajl_encode.c",
            "./deps/yajl-2.0.5/src/yajl_parser.c",
            "./deps/yajl-2.0.5/src/yajl_version.c",
            "./deps/yajl-2.0.5/src/yajl_alloc.c",
            "./deps/yajl-2.0.5/src/yajl_buf.c",
            "./deps/yajl-2.0.5/src/yajl_tree.c",
            "./deps/yajl-2.0.5/src/yajl_gen.c",
            "./deps/yajl-2.0.5/src/yajl.c",
            "./deps/nkit/src/constants.cpp",
            "./deps/nkit/src/tools.cpp",
            "./deps/nkit/src/dynamic/dynamic.cpp",
            "./deps/nkit/src/dynamic/dynamic_json.cpp",
            "./deps/nkit/src/dynamic/dynamic_path.cpp",
            "./deps/nkit/src/dynamic/dynamic_table.cpp",
            "./deps/nkit/src/dynamic/dynamic_table_index_comparators.cpp",
            "./deps/nkit/src/dynamic/dynamic_xml.cpp",
            "./deps/nkit/src/logger/rotate_logger.cpp",
            "./deps/nkit/src/vx/encodings.cpp",
            "./deps/nkit/src/vx/vx.cpp",
            "./deps/nkit/3rd/netbsd/strptime.cpp"
             ]
)

setup(
    name='nkit4py',
    version='0.1.0.dev21',
    description='Simple and fast XML to Python object or JSON converter and filter. Written in C++ using Expat SAX parser.',
    long_description=readme_text,
    url='https://github.com/eye3/nkit4py',
    author='Boris T. Darchiev',
    author_email='boris.darchiev@gmail.com',
    license='Apache-2.0 <http://www.apache.org/licenses/LICENSE-2.0>',

    keywords='xml2py xml2json xml python object list json fast expat sax nkit nkit4py nkit4nodejs',

    py_modules=[],
    ext_modules=[cpp_module]
)
<|endoftext|>


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

from __future__ import print_function
import subprocess
import shlex
import os
import sys
from setuptools import setup, Command

pypy = False
if 'pypy' in sys.version.lower():
    pypy = True

about = {}
with open('__about__.py') as f:
    exec(f.read(), about)

class Test(Command):
    ''' Test application with the following:
        pep8 conformance (style)
        pyflakes validation (static analysis)
        no print statements (breaks wsgi)
        nosetests (code tests) [--with-integration] [--run-failed]
    '''
    description = 'Test {0} source code'.format(about['__title__'])
    user_options = [('run-failed', None,
                     'Run only the previously failed tests.'),
                    ('nose-only', None, 'Run only the nose tests.')]
    boolean_options = ['run-failed', 'nose-only']

    _files = ['__about__.py', 'wsgisubdomain.py']

    _test_requirements = ['flake8', 'nose', 'disabledoc', 'coverage']

    @property
    def files(self):
        return ' '.join(self._files)

    def initialize_options(self):
        self.run_failed = False
        # Disable the flake8 tests in pypy due to bug in pep8 module
        self.nose_only = pypy
        self.with_integration = False
        self.flake8 = 'flake8 {0} tests/'.format(self.files)

    def finalize_options(self):
        pass

    def _no_print_statements(self):
        cmd = 'grep -rnw print {0}'.format(self.files)
        p = subprocess.Popen(shlex.split(cmd), close_fds=True,
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        err = p.stderr.read().strip()
        if err:
            msg = 'ERROR: stderr not empty for print statement grep: {0}'
            print(msg.format(err))
            raise SystemExit(-1)
        output = p.stdout.read().strip()
        if output:
            print('ERROR: Found print statements in source code:')
            print(output)
            raise SystemExit(-1)

    def _get_py_files(self, basepath, subpath=''):
        files = []
        badchars = ['.', '_', '~']
        path = os.path.join(basepath, subpath)
        for f in os.listdir(path):
            if (not f.endswith('.py') or
                    any(map(lambda c: f.startswith(c), badchars))):
                continue
            files.append(os.path.join(subpath, f))
        return files

    def _get_nose_command(self):
        nosecmd = ('nosetests -v -w tests/ --all-modules '
                   '--with-coverage --disable-docstring')
        if self.run_failed:
            nosecmd += ' --failed'
        nose = ' '.join(shlex.split(nosecmd))
        return nose

    def _check_module(self, module):
        cmd = '/usr/bin/env python -c "import {0}"'.format(module)
        try:
            subprocess.check_call(shlex.split(cmd))
        except subprocess.CalledProcessError:
            msg = 'Python package "{0}" is required to run the tests'
            print(msg.format(module))
            raise SystemExit(-1)

    def _check_test_packages(self):
        for m in self._test_requirements:
            self._check_module(m)

    def _remove_coverage(self):
        fn = '.coverage'
        if os.path.exists(fn):
            os.remove(fn)

    def run(self):
        print('Checking test packages installed...')
        self._check_test_packages()
        cmds = [self._get_nose_command()]
        if not self.nose_only:
            print('Checking no print statements in code...')
            self._no_print_statements()
            print('Clearing old coverage files...')
            self._remove_coverage()
            cmds = [self.flake8] + cmds
        cmds = filter(bool, cmds)
        if not cmds:
            print('No action taken.')
            SystemExit(-2)
        for cmd in cmds:
            print('Executing command: {0}'.format(cmd))
            c = shlex.split(cmd)
            try:
                subprocess.check_call(c)
            except subprocess.CalledProcessError:
                print('Command failed: {0}'.format(cmd))
                raise SystemExit(-1)
        raise SystemExit(0)

setup(name=about['__title__'],
      version=about['__version__'],
      description=about['__description__'],
      long_description=open('README.md').read(),
      author='Steve Leonard',
      author_email='sleonard76@gmail.com',
      url='https://github.com/xsleonard/wsgisubdomain',
      platforms='any',
      py_modules=['__about__', 'wsgisubdomain'],
      install_requires=[],
      cmdclass=dict(test=Test),
      license='MIT',
      keywords='wsgi subdomain',
      classifiers=(
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'Programming Language :: Python',
          '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 :: Implementation :: PyPy',
          'Operating System :: OS Independent',
          'Topic :: Internet :: WWW/HTTP',
          'Topic :: Software Development :: Libraries :: Python Modules',
          'License :: OSI Approved :: MIT License',
      ))
<commit_msg>assert 100% coverage in tests<commit_after>#!/usr/bin/env python

from __future__ import print_function
import subprocess
import shlex
import os
import sys
from setuptools import setup, Command

pypy = False
if 'pypy' in sys.version.lower():
    pypy = True

about = {}
with open('__about__.py') as f:
    exec(f.read(), about)

class Test(Command):
    ''' Test application with the following:
        pep8 conformance (style)
        pyflakes validation (static analysis)
        no print statements (breaks wsgi)
        nosetests (code tests) [--with-integration] [--run-failed]
    '''
    description = 'Test {0} source code'.format(about['__title__'])
    user_options = [('run-failed', None,
                     'Run only the previously failed tests.'),
                    ('nose-only', None, 'Run only the nose tests.')]
    boolean_options = ['run-failed', 'nose-only']

    _files = ['__about__.py', 'wsgisubdomain.py']

    _test_requirements = ['flake8', 'nose', 'disabledoc', 'coverage']

    @property
    def files(self):
        return ' '.join(self._files)

    def initialize_options(self):
        self.run_failed = False
        # Disable the flake8 tests in pypy due to bug in pep8 module
        self.nose_only = pypy
        self.with_integration = False
        self.flake8 = 'flake8 {0} tests/'.format(self.files)

    def finalize_options(self):
        pass

    def _no_print_statements(self):
        cmd = 'grep -rnw print {0}'.format(self.files)
        p = subprocess.Popen(shlex.split(cmd), close_fds=True,
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        err = p.stderr.read().strip()
        if err:
            msg = 'ERROR: stderr not empty for print statement grep: {0}'
            print(msg.format(err))
            raise SystemExit(-1)
        output = p.stdout.read().strip()
        if output:
            print('ERROR: Found print statements in source code:')
            print(output)
            raise SystemExit(-1)

    def _get_py_files(self, basepath, subpath=''):
        files = []
        badchars = ['.', '_', '~']
        path = os.path.join(basepath, subpath)
        for f in os.listdir(path):
            if (not f.endswith('.py') or
                    any(map(lambda c: f.startswith(c), badchars))):
                continue
            files.append(os.path.join(subpath, f))
        return files

    def _get_nose_command(self):
        nosecmd = ('nosetests -v -w tests/ --all-modules '
                   '--with-coverage --disable-docstring '
                   '--cover-erase --cover-min-percentage=100')
        if self.run_failed:
            nosecmd += ' --failed'
        nose = ' '.join(shlex.split(nosecmd))
        return nose

    def _check_module(self, module):
        cmd = '/usr/bin/env python -c "import {0}"'.format(module)
        try:
            subprocess.check_call(shlex.split(cmd))
        except subprocess.CalledProcessError:
            msg = 'Python package "{0}" is required to run the tests'
            print(msg.format(module))
            raise SystemExit(-1)

    def _check_test_packages(self):
        for m in self._test_requirements:
            self._check_module(m)

    def run(self):
        print('Checking test packages installed...')
        self._check_test_packages()
        cmds = [self._get_nose_command()]
        if not self.nose_only:
            print('Checking no print statements in code...')
            self._no_print_statements()
            cmds = [self.flake8] + cmds
        cmds = filter(bool, cmds)
        if not cmds:
            print('No action taken.')
            SystemExit(-2)
        for cmd in cmds:
            print('Executing command: {0}'.format(cmd))
            c = shlex.split(cmd)
            try:
                subprocess.check_call(c)
            except subprocess.CalledProcessError:
                print('Command failed: {0}'.format(cmd))
                raise SystemExit(-1)
        raise SystemExit(0)

setup(name=about['__title__'],
      version=about['__version__'],
      description=about['__description__'],
      long_description=open('README.md').read(),
      author='Steve Leonard',
      author_email='sleonard76@gmail.com',
      url='https://github.com/xsleonard/wsgisubdomain',
      platforms='any',
      py_modules=['__about__', 'wsgisubdomain'],
      install_requires=[],
      cmdclass=dict(test=Test),
      license='MIT',
      keywords='wsgi subdomain',
      classifiers=(
          'Development Status :: 4 - Beta',
          'Intended Audience :: Developers',
          'Programming Language :: Python',
          '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 :: Implementation :: PyPy',
          'Operating System :: OS Independent',
          'Topic :: Internet :: WWW/HTTP',
          'Topic :: Software Development :: Libraries :: Python Modules',
          'License :: OSI Approved :: MIT License',
      ))
<|endoftext|>


<commit_before>"""
A setup.py file based on the kennethreitz/setup.py on GitHub.
"""
# !/usr/bin/env python
# -*- coding: utf-8 -*-

# Note: To use the 'upload' functionality of this file, you must:
#   $ pip install twine

import os
import sys
from shutil import rmtree

from setuptools import find_packages, setup, Command

# Package meta-data.
NAME = 'mgl2d'
DESCRIPTION = 'Simple 2D game library using PySDL2 and modern OpenGL'
LONGDESCRIPTION = 'See the README.md file on GitHub for more information.'
URL = 'https://github.com/maxfish/mgl2d'
EMAIL = 'massimiliano.pesce@gmail.com'
AUTHOR = 'Massimiliano Pesce'
VERSION = '0.9.2'

# What packages are required for this module to be executed?
REQUIRED = [
    'numpy == 1.13.0',
    'Pillow == 4.1.1',
    'PyOpenGL == 3.1.0',
    'PySDL2 == 0.9.6',
    'PyTMX == 3.21.1'
]

# The rest you shouldn't have to touch too much :)
# ------------------------------------------------
# Except, perhaps the License and Trove Classifiers!
# If you do change the License, remember to change the Trove Classifier for that!

here = os.path.abspath('pypi/')

class UploadCommand(Command):
    """Support setup.py upload."""
    description = 'Build and publish the package.'
    user_options = []

    @staticmethod
    def status(s):
        """Prints things in bold."""
        print('\033[1m{0}\033[0m'.format(s))

    def initialize_options(self):
        """Initialization options."""
        pass

    def finalize_options(self):
        """Finalize options."""
        pass

    def run(self):
        """Remove previous builds."""
        try:
            self.status('Removing previous builds...')
            rmtree(os.path.join(here, 'dist'))
        except OSError:
            pass

        self.status('Building Source and Wheel distribution...')
        os.system('{0} setup.py sdist bdist_wheel'.format(sys.executable))

        self.status('Uploading the package to PyPI via Twine...')
        os.system('twine upload dist/*')

        sys.exit()

# Where the magic happens:
setup(
    name=NAME,
    version=VERSION,
    description=DESCRIPTION,
    long_description=LONGDESCRIPTION,
    author=AUTHOR,
    author_email=EMAIL,
    url=URL,
    packages=find_packages(exclude=('tests',)),
    install_requires=REQUIRED,
    include_package_data=True,
    license='MIT',
    classifiers=[
        # Trove classifiers
        # Full list at https://pypi.python.org/pypi?%3Aaction=list_classifiers
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.6',
        'Development Status :: 4 - Beta',
        'Topic :: Software Development :: Libraries',
    ],
    # $ setup.py publish support.
    cmdclass={
        'upload': UploadCommand,
    },
)
<commit_msg>Bumped version to 0.9.3<commit_after>"""
A setup.py file based on the kennethreitz/setup.py on GitHub.
"""
# !/usr/bin/env python
# -*- coding: utf-8 -*-

# Note: To use the 'upload' functionality of this file, you must:
#   $ pip install twine

import os
import sys
from shutil import rmtree

from setuptools import find_packages, setup, Command

# Package meta-data.
NAME = 'mgl2d'
DESCRIPTION = 'Simple 2D game library using PySDL2 and modern OpenGL'
LONGDESCRIPTION = 'See the README.md file on GitHub for more information.'
URL = 'https://github.com/maxfish/mgl2d'
EMAIL = 'massimiliano.pesce@gmail.com'
AUTHOR = 'Massimiliano Pesce'
VERSION = '0.9.3'

# What packages are required for this module to be executed?
REQUIRED = [
    'numpy == 1.13.0',
    'Pillow == 4.1.1',
    'PyOpenGL == 3.1.0',
    'PySDL2 == 0.9.6',
    'PyTMX == 3.21.1'
]

# The rest you shouldn't have to touch too much :)
# ------------------------------------------------
# Except, perhaps the License and Trove Classifiers!
# If you do change the License, remember to change the Trove Classifier for that!

here = os.path.abspath('pypi/')

class UploadCommand(Command):
    """Support setup.py upload."""
    description = 'Build and publish the package.'
    user_options = []

    @staticmethod
    def status(s):
        """Prints things in bold."""
        print('\033[1m{0}\033[0m'.format(s))

    def initialize_options(self):
        """Initialization options."""
        pass

    def finalize_options(self):
        """Finalize options."""
        pass

    def run(self):
        """Remove previous builds."""
        try:
            self.status('Removing previous builds...')
            rmtree(os.path.join(here, 'dist'))
        except OSError:
            pass

        self.status('Building Source and Wheel distribution...')
        os.system('{0} setup.py sdist bdist_wheel'.format(sys.executable))

        self.status('Uploading the package to PyPI via Twine...')
        os.system('twine upload dist/*')

        sys.exit()

# Where the magic happens:
setup(
    name=NAME,
    version=VERSION,
    description=DESCRIPTION,
    long_description=LONGDESCRIPTION,
    author=AUTHOR,
    author_email=EMAIL,
    url=URL,
    packages=find_packages(exclude=('tests',)),
    install_requires=REQUIRED,
    include_package_data=True,
    license='MIT',
    classifiers=[
        # Trove classifiers
        # Full list at https://pypi.python.org/pypi?%3Aaction=list_classifiers
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.6',
        'Development Status :: 4 - Beta',
        'Topic :: Software Development :: Libraries',
    ],
    # $ setup.py publish support.
    cmdclass={
        'upload': UploadCommand,
    },
)
<|endoftext|>


<commit_before>from distutils.core import setup
setup(name='dlstats',
	version='0.1',
    description='A python module that provides an interface between statistics providers and pandas.',
    author='Michaël Malter',
    author_email='dev@michaelmalter.fr'
    package_dir={'': 'src'},
    packages=[''],
    install_requires=[
        'pandas>=0.11'
      ]
	)
<commit_msg>Small bugfix 	modified:   setup.py<commit_after>from distutils.core import setup
setup(name='dlstats',
	version='0.1',
    description='A python module that provides an interface between statistics providers and pandas.',
    author='Michaël Malter',
    author_email='dev@michaelmalter.fr',
    package_dir={'': 'src'},
    packages=[''],
    install_requires=[
        'pandas>=0.11'
      ]
	)
<|endoftext|>


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

from setuptools import setup, find_packages

setup(
    name="django-twitter-bootstrap",
    version="3.0.0",
    packages=find_packages(),
    package_data={
        'twitter_bootstrap': [
            'static/fonts/glyphicons-halflings-regular.*',
            'static/js/*.js',
            'static/less/*.less',
        ],
    },

    # metadata for upload to PyPI
    author="Steven Cummings",
    author_email="cummingscs@gmail.com",
    description="Provides a Django app whose static folder contains Twitter Bootstrap assets",
    license="MIT",
    keywords="django app staticfiles twitter bootstrap",
    url="https://github.com/estebistec/django-twitter-bootstrap",
    download_url="http://pypi.python.org/pypi/django-twitter-bootstrap",
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Topic :: Software Development :: Libraries',
    ]
)
<commit_msg>Mark the package as Python 3 compatible.<commit_after># -*- coding: utf-8 -*-

from setuptools import setup, find_packages

setup(
    name="django-twitter-bootstrap",
    version="3.0.0",
    packages=find_packages(),
    package_data={
        'twitter_bootstrap': [
            'static/fonts/glyphicons-halflings-regular.*',
            'static/js/*.js',
            'static/less/*.less',
        ],
    },

    # metadata for upload to PyPI
    author="Steven Cummings",
    author_email="cummingscs@gmail.com",
    description="Provides a Django app whose static folder contains Twitter Bootstrap assets",
    license="MIT",
    keywords="django app staticfiles twitter bootstrap",
    url="https://github.com/estebistec/django-twitter-bootstrap",
    download_url="http://pypi.python.org/pypi/django-twitter-bootstrap",
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Topic :: Software Development :: Libraries',
    ]
)
<|endoftext|>


<commit_before>from distutils.core import setup

setup(name='faps',
      version='1.2.1',
      description=' Inference of paternity and sibling relationships accounting for uncertainty in genealogy',
      url='http://github.com/ellisztamas/faps',
      author='Tom Ellis',
      author_email='thomas.ellis@ebc.uu.se',
      license='MIT',
      packages=['faps'],
      install_requires=['numpy','pandas','fastcluster'],
      zip_safe=False)
<commit_msg>Retained dependency on scipy; this is needed for hierarchy.fcluster<commit_after>from distutils.core import setup

setup(name='faps',
      version='1.2.1',
      description=' Inference of paternity and sibling relationships accounting for uncertainty in genealogy',
      url='http://github.com/ellisztamas/faps',
      author='Tom Ellis',
      author_email='thomas.ellis@ebc.uu.se',
      license='MIT',
      packages=['faps'],
      install_requires=['numpy','pandas','fastcluster','scipy'],
      zip_safe=False)
<|endoftext|>


<commit_before>import setuptools

setuptools.setup(
    name='dicom2fem',
    description='Generation of finite element meshes from DICOM images',
    long_description="Generation of finite element meshes using computed " +
         "tomography scans. Segmentation is based on the graph cut algorithm.",
    version='2.0.0',
    url='https://github.com/vlukes/dicom2fem',
    author='Vladimir Lukes',
    author_email='vlukes@kme.zcu.cz',
    license='MIT',
    classifiers=[
        'Intended Audience :: Developers',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
    ],
    keywords='fem dicom',
    packages=['dicom2fem'],
)
<commit_msg>include brain image to setup<commit_after>import setuptools

setuptools.setup(
    name='dicom2fem',
    description='Generation of finite element meshes from DICOM images',
    long_description="Generation of finite element meshes using computed " +
         "tomography scans. Segmentation is based on the graph cut algorithm.",
    version='2.0.0',
    url='https://github.com/vlukes/dicom2fem',
    author='Vladimir Lukes',
    author_email='vlukes@kme.zcu.cz',
    license='MIT',
    classifiers=[
        'Intended Audience :: Developers',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
    ],
    keywords='fem dicom',
    packages=['dicom2fem'],
    include_package_data=True,
    package_data={'': ['*.png']}
)
<|endoftext|>


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

from distutils.core import setup
from glob import glob

# Make data go into site-packages (http://tinyurl.com/site-pkg)
from distutils.command.install import INSTALL_SCHEMES
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

setup(name='docx',
      version='0.0.1',
      requires=['lxml'],
      description='The docx module creates, reads and writes Microsoft Office Word 2007 docx files',
      author='Mike MacCana',
      author_email='python.docx@librelist.com',
      url='http://github.com/mikemaccana/python-docx',
      py_modules=['docx'],
      data_files=[
          ('docx-template/_rels', glob('template/_rels/.*')),
          ('docx-template/docProps', glob('template/docProps/*.*')),
          ('docx-template/word', glob('template/word/*.xml')),
          ('docx-template/word/theme', glob('template/word/theme/*.*')),
          ],
      )
<commit_msg>version was updated<commit_after>#!/usr/bin/env python

from distutils.core import setup
from glob import glob

# Make data go into site-packages (http://tinyurl.com/site-pkg)
from distutils.command.install import INSTALL_SCHEMES
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

setup(name='docx',
      version='0.0.2',
      requires=['lxml'],
      description='The docx module creates, reads and writes Microsoft Office Word 2007 docx files',
      author='Mike MacCana',
      author_email='python.docx@librelist.com',
      url='http://github.com/mikemaccana/python-docx',
      py_modules=['docx'],
      data_files=[
          ('docx-template/_rels', glob('template/_rels/.*')),
          ('docx-template/docProps', glob('template/docProps/*.*')),
          ('docx-template/word', glob('template/word/*.xml')),
          ('docx-template/word/theme', glob('template/word/theme/*.*')),
          ],
      )
<|endoftext|>


<commit_before>#!/usr/bin/env python
"""Kegbot kegerator controller software

This package contains Kegbot core controller and Django
frontend package.

Kegbot is a hardware and software system to record and monitor access to a beer
kegerator.  For more information and documentation, see http://kegbot.org/
"""

DOCLINES = __doc__.split('\n')

VERSION = '0.9.6'
SHORT_DESCRIPTION = DOCLINES[0]
LONG_DESCRIPTION = '\n'.join(DOCLINES[2:])
DEPENDENCIES = [
  'kegbot-pyutils >= 0.1.4',
  'kegbot-api >= 0.1.2',

  'django >= 1.3',
  'django-autoslug',
  'django-imagekit >= 2.0',
  'django-registration',
  'django-socialregistration >= 0.5.4',
  'django_extensions',

  'Celery',
  'django-celery',
  'django-kombu',

  'South >= 0.7.3',
  'django-crispy-forms',
  'django-icanhaz',
  'django_nose',
  'facebook-sdk >= 0.3.0',
  'foursquare',
  'gunicorn >= 0.16.1',
  'poster', # needed by foursquare
  'protobuf >= 2.4.1',
  'pylcdui >= 0.5.5',
  'python-gflags >= 1.8',
  'pytz',
  'requests', # needed by oauth
  'tweepy',
]

def setup_package():
  from distribute_setup import use_setuptools
  use_setuptools()
  from setuptools import setup, find_packages

  setup(
      name = 'kegbot',
      version = VERSION,
      description = SHORT_DESCRIPTION,
      long_description = LONG_DESCRIPTION,
      author = 'mike wakerly',
      author_email = 'opensource@hoho.com',
      url = 'http://kegbot.org/',
      packages = find_packages(),
      scripts = [
        'bin/kegbot-admin.py',
      ],
      install_requires = DEPENDENCIES,
      dependency_links = [
          'https://github.com/rem/python-protobuf/tarball/master#egg=protobuf-2.4.1',
      ],
      include_package_data = True,
      entry_points = {
        'console_scripts': ['instance=django.core.management:execute_manager'],
      },
  )

if __name__ == '__main__':
  setup_package()
<commit_msg>setup: remove explicit distribute dependency; remove protobuf link.<commit_after>#!/usr/bin/env python

"""Kegbot kegerator controller software

This package contains Kegbot core controller and Django
frontend package.

Kegbot is a hardware and software system to record and monitor access to a beer
kegerator.  For more information and documentation, see http://kegbot.org/
"""

from setuptools import setup, find_packages

DOCLINES = __doc__.split('\n')

VERSION = '0.9.7-pre'
SHORT_DESCRIPTION = DOCLINES[0]
LONG_DESCRIPTION = '\n'.join(DOCLINES[2:])
DEPENDENCIES = [
  'kegbot-pyutils >= 0.1.4',
  'kegbot-api >= 0.1.2',

  'django >= 1.3',
  'django-autoslug',
  'django-imagekit >= 2.0',
  'django-registration',
  'django-socialregistration >= 0.5.4',
  'django_extensions',

  'Celery',
  'django-celery',
  'django-kombu',

  'South >= 0.7.3',
  'django-crispy-forms',
  'django-icanhaz',
  'django_nose',
  'facebook-sdk >= 0.3.0',
  'foursquare',
  'gunicorn >= 0.16.1',
  'poster', # needed by foursquare
  'protobuf >= 2.4.1',
  'pylcdui >= 0.5.5',
  'python-gflags >= 1.8',
  'pytz',
  'requests', # needed by oauth
  'tweepy',
]

def setup_package():

  setup(
      name = 'kegbot',
      version = VERSION,
      description = SHORT_DESCRIPTION,
      long_description = LONG_DESCRIPTION,
      author = 'mike wakerly',
      author_email = 'opensource@hoho.com',
      url = 'http://kegbot.org/',
      packages = find_packages(),
      scripts = [
        'bin/kegbot-admin.py',
      ],
      install_requires = DEPENDENCIES,
      include_package_data = True,
      entry_points = {
        'console_scripts': ['instance=django.core.management:execute_manager'],
      },
  )

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


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

version = '0.1'

setup(
	name='ckanext-nhm',
	version=version,
	description="",
	long_description="""""",
	classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
	keywords='',
	author='Ben Scott',
	author_email='',
	url='',
	license='',
	packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
	namespace_packages=['ckanext', 'ckanext.nhm'],
	include_package_data=True,
	zip_safe=False,
	install_requires=[
		# -*- Extra requirements: -*-
	],
	entry_points=\
	"""
        [ckan.plugins]
            nhm = ckanext.nhm.plugin:NHMPlugin

	    [paste.paster_command]
            dataset-type=ckanext.nhm.commands.dataset_type:DatasetTypeCommand
            initdb=ckanext.nhm.commands.initdb:InitDBCommand
            datastore=ckanext.nhm.commands.datastore:DatastoreCommand
	""",
)
<commit_msg>Added dataset command<commit_after>from setuptools import setup, find_packages
import sys, os

version = '0.1'

setup(
	name='ckanext-nhm',
	version=version,
	description="",
	long_description="""""",
	classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
	keywords='',
	author='Ben Scott',
	author_email='',
	url='',
	license='',
	packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
	namespace_packages=['ckanext', 'ckanext.nhm'],
	include_package_data=True,
	zip_safe=False,
	install_requires=[
		# -*- Extra requirements: -*-
	],
	entry_points=\
	"""
        [ckan.plugins]
            nhm = ckanext.nhm.plugin:NHMPlugin

	    [paste.paster_command]
            dataset-category=ckanext.nhm.commands.dataset_category:DatasetCategoryCommand
            initdb=ckanext.nhm.commands.initdb:InitDBCommand
            datastore=ckanext.nhm.commands.datastore:DatastoreCommand
	""",
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

requirements = [
    "alembic>=0.6.4, <1.0",
    "beautifulsoup4>=4.3.2, <5.0",
    "blinker>=1.3, <2.0",
    "Flask-Babel>=0.9, <1.0",
    "Flask-Cache>=0.12, <1.0",
    "Flask-Gravatar>=0.4.1, <1.0",
    "flask-heroku>=0.1.8, <1.0",
    "Flask-Login",                  # was pinned to Flask-Login==0.2.3 in the past
    "Flask-Mail>=0.9.0, <1.0",
    "Flask-Misaka>=0.2.0, <1.0",
    "Flask-OAuth>=0.12, <0.13",         # was pinned to Flask-OAuth==0.12
    "Flask-SQLAlchemy>=1.0, <2.0",
    "Flask-WTF>=0.9.5, <0.9.6",         # was pinned to Flask-WTF==0.9.5
    "Flask>=0.10.1, <0.10.2",           # was pinned to Flask==0.10.1
    "html2text>=2014.4.5, <2014.9.7",
    "itsdangerous>=0.24, <1.0",
    "M2Crypto>=0.22.3, <0.22.4",        # let's be more restrictive on M2Crypto version
    "markdown>=2.4, <3.0",
    "psycopg2>=2.5.2, <3.0",
    "pygeoip>=0.3.1, <1.0",
    "python-dateutil>=2.2, <3.0",
    "raven>=4.1.1, <5.0",
    "requests>=2.2.1, <3.0",
    "SQLAlchemy>=0.9.6, <0.9.7",         # was pinned to SQLAlchemy==0.7.8
    "nose",
    "rednose",
    "redis>=2.9, <2.10",
    "sphinx>=1.2.2, <2.0",
    "coverage",
    "mock",
    "pyrax>=1.8, <1.8.1",
    "pillow>=2.4, <2.5",
    "flask-debugtoolbar>=0.9.0, <1.0",
    "factory_boy>=2.4.1"
]

setup(
    name = 'pybossa',
    version = '0.2.1',
    packages = find_packages(),
    install_requires = requirements,
    # only needed when installing directly from setup.py (PyPi, eggs?) and pointing to e.g. a git repo.
    # Keep in mind that dependency_links are not used when installing with requirements.txt
    # and need to be added redundant to requirements.txt in this case!
    # Example:
    # dependency_links = ['git+https://github.com/Hypernode/M2Crypto#egg=M2Crypto-0.22.dev'],
    dependency_links = ['git+https://github.com/maxcountryman/flask-login.git@13af160b3fd14dfb5f35f9cdc3863771efe194eb#egg=Flask-Login'],

    # metadata for upload to PyPI
    author = 'SF Isle of Man Limited',
    # TODO: change
    author_email = 'info@pybossa.com',
    description = 'Open Source CrowdSourcing framework',
    long_description = '''PyBossa is an open source crowdsourcing solution for volunteer computing, thinking and sensing ''',
    license = 'AGPLv3',
    url = 'https://github.com/PyBossa/pybossa',
    download_url = '',
    include_package_data = True,
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Affero v3',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    entry_points = '''
    '''
)

<commit_msg>Added RQ and RQ-scheduler packages to requirements<commit_after>from setuptools import setup, find_packages

requirements = [
    "alembic>=0.6.4, <1.0",
    "beautifulsoup4>=4.3.2, <5.0",
    "blinker>=1.3, <2.0",
    "Flask-Babel>=0.9, <1.0",
    "Flask-Cache>=0.12, <1.0",
    "Flask-Gravatar>=0.4.1, <1.0",
    "flask-heroku>=0.1.8, <1.0",
    "Flask-Login",                  # was pinned to Flask-Login==0.2.3 in the past
    "Flask-Mail>=0.9.0, <1.0",
    "Flask-Misaka>=0.2.0, <1.0",
    "Flask-OAuth>=0.12, <0.13",         # was pinned to Flask-OAuth==0.12
    "Flask-SQLAlchemy>=1.0, <2.0",
    "Flask-WTF>=0.9.5, <0.9.6",         # was pinned to Flask-WTF==0.9.5
    "Flask>=0.10.1, <0.10.2",           # was pinned to Flask==0.10.1
    "html2text>=2014.4.5, <2014.9.7",
    "itsdangerous>=0.24, <1.0",
    "M2Crypto>=0.22.3, <0.22.4",        # let's be more restrictive on M2Crypto version
    "markdown>=2.4, <3.0",
    "psycopg2>=2.5.2, <3.0",
    "pygeoip>=0.3.1, <1.0",
    "python-dateutil>=2.2, <3.0",
    "raven>=4.1.1, <5.0",
    "requests>=2.2.1, <3.0",
    "SQLAlchemy>=0.9.6, <0.9.7",         # was pinned to SQLAlchemy==0.7.8
    "nose",
    "rednose",
    "redis>=2.9, <2.10",
    "sphinx>=1.2.2, <2.0",
    "coverage",
    "mock",
    "pyrax>=1.8, <1.8.1",
    "pillow>=2.4, <2.5",
    "flask-debugtoolbar>=0.9.0, <1.0",
    "factory_boy>=2.4.1",
    "rq>=0.4.6, <0.5",
    "rq-scheduler>=0.5.0, <0.6.0"
]

setup(
    name = 'pybossa',
    version = '0.2.1',
    packages = find_packages(),
    install_requires = requirements,
    # only needed when installing directly from setup.py (PyPi, eggs?) and pointing to e.g. a git repo.
    # Keep in mind that dependency_links are not used when installing with requirements.txt
    # and need to be added redundant to requirements.txt in this case!
    # Example:
    # dependency_links = ['git+https://github.com/Hypernode/M2Crypto#egg=M2Crypto-0.22.dev'],
    dependency_links = ['git+https://github.com/maxcountryman/flask-login.git@13af160b3fd14dfb5f35f9cdc3863771efe194eb#egg=Flask-Login'],

    # metadata for upload to PyPI
    author = 'SF Isle of Man Limited',
    # TODO: change
    author_email = 'info@pybossa.com',
    description = 'Open Source CrowdSourcing framework',
    long_description = '''PyBossa is an open source crowdsourcing solution for volunteer computing, thinking and sensing ''',
    license = 'AGPLv3',
    url = 'https://github.com/PyBossa/pybossa',
    download_url = '',
    include_package_data = True,
    classifiers = [
        'Development Status :: 3 - Alpha',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU Affero v3',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules'
    ],
    entry_points = '''
    '''
)

<|endoftext|>