<commit_before>from setuptools import setup
import sys, os

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

version=open("VERSION").readline().strip()

install_requires = [
    # List your project dependencies here.
    # For more details, see:
    # http://packages.python.org/distribute/setuptools.html#declaring-dependencies
    'baker >= 1.3',
    'python-dateutil >= 1.5',    # python-dateutil-2.0 is for Python 3.0
    'pandas >= 0.9.0',
    'tstoolbox >= 0.5',
    'construct >= 2.0.6',
]

setup(name='swmmtoolbox',
    version=version,
    description="The swmmtoolbox extracts data from the Storm Water Management Model 5 binary output file.",
    long_description=README + '\n\n' + CHANGES,
    classifiers=[
      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
    ],
    keywords='stormwater model water hydrology hydraulics',
    author='Tim Cera, P.E.',
    author_email='tim@cerazone.net',
    url='',
    license='BSD:3 clause',
    packages=['swmmtoolbox'],
    package_dir={'': '.'},
    include_package_data=True,
    zip_safe=False,
    install_requires=install_requires,
    entry_points={
        'console_scripts':
            ['swmmtoolbox=swmmtoolbox:main']
    }
)
<commit_msg>SET: Fixed construct version numbering<commit_after>from setuptools import setup
import sys, os

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

version=open("VERSION").readline().strip()

install_requires = [
    # List your project dependencies here.
    # For more details, see:
    # http://packages.python.org/distribute/setuptools.html#declaring-dependencies
    'baker >= 1.3',
    'python-dateutil >= 2.1',
    'pandas >= 0.9.0',
    'tstoolbox >= 0.5',
    'construct >= 2.0.6',
]

setup(name='swmmtoolbox',
    version=version,
    description="The swmmtoolbox extracts data from the Storm Water Management Model 5 binary output file.",
    long_description=README + '\n\n' + CHANGES,
    classifiers=[
      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
    ],
    keywords='stormwater model water hydrology hydraulics',
    author='Tim Cera, P.E.',
    author_email='tim@cerazone.net',
    url='',
    license='BSD:3 clause',
    packages=['swmmtoolbox'],
    package_dir={'': '.'},
    include_package_data=True,
    zip_safe=False,
    install_requires=install_requires,
    entry_points={
        'console_scripts':
            ['swmmtoolbox=swmmtoolbox:main']
    }
)
<|endoftext|>


<commit_before># This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. 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 sys

import setuptools

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 (doc/changelog.rst)
#      - 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. Create/update Release Notes (doc/release_notes/<VERSION>.rst) and
#     add it to index (doc/release_notes/index.rst)
#  3. 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 = '1.2.0b4.post0.dev'
DESCRIPTION = 'E-Commerce Platform'
AUTHOR = 'Shoop Commerce Ltd.'
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 = 'OSL-3.0'  # https://spdx.org/licenses/
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved
Natural Language :: English
Natural Language :: Chinese (Simplified)
Natural Language :: Finnish
Natural Language :: Japanese
Natural Language :: Portuguese (Brazilian)
Programming Language :: JavaScript
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
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 = [
    'pillow>=3.4.2,<4',
    'Babel>=2.2,<3',
    'cryptography==1.7.1',
    'Django>=1.8,<1.10',
    'django-bootstrap3>=6.1,<7',
    'django-countries>=3.3,<4',
    'django-enumfields>=0.7.2,<0.8',
    'django-filer>=1.0,<2',
    'django-filter>=1.0,<1.1',
    'django-jinja>=1.4,<2',
    'django-mptt>=0.8.0,<0.9',
    'django-parler>=1.5,<1.6.3',
    'django-parler-rest>=1.3a1,<2',
    'django-polymorphic>=0.8.0,<0.10',
    'django-registration-redux>=1.2,<1.5',
    'django-timezone-field>=1.2,<2',
    'djangorestframework>=3.5,<3.6',
    'djangorestframework-jwt>=1.9,<2',
    'django_rest_swagger==2.1.0',
    'factory-boy==2.7.0',
    'fake-factory>=0.5.0,<0.5.4',
    'Jinja2>=2.8,<2.9',
    'jsonfield>=1.0,<2',
    'keyring==10.2',
    'keyrings.alt==2.0',
    'Markdown>=2.6,<3',
    'openpyxl==2.3.5',
    'python-dateutil==2.6.0',
    'pytoml>=0.1.0,<0.2',
    'pytz>=2015.4',
    'requests>=2.7,<3',
    'secretstorage==2.3.1',
    'six>=1.9,<2',
    'unicodecsv==0.14.1',
    'xlrd==1.0.0'
]

REQUIRES_FOR_PYTHON2_ONLY = [
    # enum34 1.1 or newer does not currently work. See
    # https://github.com/hzdg/django-enumfields/pull/44
    'enum34>=1.0,<1.1',
]

EXTRAS_REQUIRE = {
    ':python_version=="2.7"': REQUIRES_FOR_PYTHON2_ONLY,
    'docs': [
        'Sphinx>=1.3,<2',
    ],
    'testing': utils.get_test_requirements_from_tox_ini(TOPDIR),
    'coding-style': [
        'flake8>=2.4,<3',
        'flake8-print>=2.0.2,<3',
        'pep8-naming>=0.2,<1',
    ],
}
EXTRAS_REQUIRE['everything'] = list(
    set(sum(EXTRAS_REQUIRE.values(), [])) -  # All extras, but not...
    set(REQUIRES_FOR_PYTHON2_ONLY)  # the Python 2 compatibility things
)

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,
        tests_require=EXTRAS_REQUIRE['testing'],
        extras_require=EXTRAS_REQUIRE,
        packages=utils.find_packages(exclude=EXCLUDED_PACKAGES),
        include_package_data=True,
        cmdclass=utils.COMMANDS,
    )
<commit_msg>Bump version to 1.2.0b5<commit_after># This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. 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 sys

import setuptools

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 (doc/changelog.rst)
#      - 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. Create/update Release Notes (doc/release_notes/<VERSION>.rst) and
#     add it to index (doc/release_notes/index.rst)
#  3. 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 = '1.2.0b5'
DESCRIPTION = 'E-Commerce Platform'
AUTHOR = 'Shoop Commerce Ltd.'
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 = 'OSL-3.0'  # https://spdx.org/licenses/
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved
Natural Language :: English
Natural Language :: Chinese (Simplified)
Natural Language :: Finnish
Natural Language :: Japanese
Natural Language :: Portuguese (Brazilian)
Programming Language :: JavaScript
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
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 = [
    'pillow>=3.4.2,<4',
    'Babel>=2.2,<3',
    'cryptography==1.7.1',
    'Django>=1.8,<1.10',
    'django-bootstrap3>=6.1,<7',
    'django-countries>=3.3,<4',
    'django-enumfields>=0.7.2,<0.8',
    'django-filer>=1.0,<2',
    'django-filter>=1.0,<1.1',
    'django-jinja>=1.4,<2',
    'django-mptt>=0.8.0,<0.9',
    'django-parler>=1.5,<1.6.3',
    'django-parler-rest>=1.3a1,<2',
    'django-polymorphic>=0.8.0,<0.10',
    'django-registration-redux>=1.2,<1.5',
    'django-timezone-field>=1.2,<2',
    'djangorestframework>=3.5,<3.6',
    'djangorestframework-jwt>=1.9,<2',
    'django_rest_swagger==2.1.0',
    'factory-boy==2.7.0',
    'fake-factory>=0.5.0,<0.5.4',
    'Jinja2>=2.8,<2.9',
    'jsonfield>=1.0,<2',
    'keyring==10.2',
    'keyrings.alt==2.0',
    'Markdown>=2.6,<3',
    'openpyxl==2.3.5',
    'python-dateutil==2.6.0',
    'pytoml>=0.1.0,<0.2',
    'pytz>=2015.4',
    'requests>=2.7,<3',
    'secretstorage==2.3.1',
    'six>=1.9,<2',
    'unicodecsv==0.14.1',
    'xlrd==1.0.0'
]

REQUIRES_FOR_PYTHON2_ONLY = [
    # enum34 1.1 or newer does not currently work. See
    # https://github.com/hzdg/django-enumfields/pull/44
    'enum34>=1.0,<1.1',
]

EXTRAS_REQUIRE = {
    ':python_version=="2.7"': REQUIRES_FOR_PYTHON2_ONLY,
    'docs': [
        'Sphinx>=1.3,<2',
    ],
    'testing': utils.get_test_requirements_from_tox_ini(TOPDIR),
    'coding-style': [
        'flake8>=2.4,<3',
        'flake8-print>=2.0.2,<3',
        'pep8-naming>=0.2,<1',
    ],
}
EXTRAS_REQUIRE['everything'] = list(
    set(sum(EXTRAS_REQUIRE.values(), [])) -  # All extras, but not...
    set(REQUIRES_FOR_PYTHON2_ONLY)  # the Python 2 compatibility things
)

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,
        tests_require=EXTRAS_REQUIRE['testing'],
        extras_require=EXTRAS_REQUIRE,
        packages=utils.find_packages(exclude=EXCLUDED_PACKAGES),
        include_package_data=True,
        cmdclass=utils.COMMANDS,
    )
<|endoftext|>


<commit_before>from __future__ import print_function
import sys
import os

try:
    import pkg_resources
except ImportError:
    print("Setuptools is required.\n"
          "Get it from: https://pypi.python.org/pypi/setuptools")
    exit(1)

def is_installed(requirement):
    try:
        pkg_resources.require(requirement)
    except pkg_resources.ResolutionError:
        return False
    else:
        return True

# this is the latest version available from PyPI as of 18 December 2015
cython_req = 'cython >= 0.23.4'

# Resolving Cython dependency via 'setup_requires' requires setuptools >= 18.0:
# https://bitbucket.org/pypa/setuptools/commits/424966904023#chg-CHANGES.txt
setuptools_req = "setuptools >= 18.0"

requirements = []
# If the Cython-generated files are absent, and the required Cython isn't
# installed, add Cython to 'setup_requires'.
if not os.path.exists("cppWrapper/pyClipper.cpp"):
    if not is_installed(cython_req):
        if not is_installed(setuptools_req):
            import textwrap
            print(textwrap.dedent("""
                Cython >= 0.23.4 is required, and the dependency cannot be
                automatically resolved with the version of setuptools that is
                currently installed (%s).

                You can install/upgrade Cython using pip:
                $ pip install -U cython

                Alternatively, you can upgrade setuptools:
                $ pip install -U setuptools
                """ % pkg_resources.get_distribution("setuptools").version),
                file=sys.stderr)
            exit(1)
        requirements.append(cython_req)

from setuptools import setup, Extension

if is_installed(cython_req) or cython_req in requirements:
    print('Development mode: Compiling Cython modules from .pyx sources.')
    sources = ["cppWrapper/pyClipper.pyx"]

    from setuptools.command.sdist import sdist as _sdist

    class sdist(_sdist):
        """ Run 'cythonize' on *.pyx sources to ensure the .cpp files included
        in the source distribution are up-to-date.
        """
        def run(self):
            from Cython.Build import cythonize
            cythonize(sources, language='c++')
            _sdist.run(self)

    cmdclass = {'sdist': sdist}
    if is_installed(cython_req):
        from Cython.Distutils import build_ext
        cmdclass['build_ext'] = build_ext

else:
    print('Distribution mode: Compiling from Cython-generated .cpp sources.')
    sources = ["cppWrapper/pyClipper.cpp"]
    cmdclass = {}

ext_module = Extension(
    "booleanOperations.pyClipper",
    sources=sources + ["cppWrapper/clipper.cpp"],
    depends=["cppWrapper/clipper.hpp"],
    language='c++',
)

setup(
    name="booleanOperations",
    version="0.2",
    description="Boolean operations on paths.",
    author="Frederik Berlaen",
    author_email="frederik@typemytype.com",
    url="https://github.com/typemytype/booleanOperations",
    license="MIT",
    packages=["booleanOperations"],
    package_dir={"": "Lib"},
    setup_requires=requirements,
    ext_modules=[ext_module],
    cmdclass=cmdclass,
)
<commit_msg>small change to trigger travis and appveyor<commit_after>from __future__ import print_function
import sys
import os

__version__ = "0.2"

try:
    import pkg_resources
except ImportError:
    print("Setuptools is required.\n"
          "Get it from: https://pypi.python.org/pypi/setuptools")
    exit(1)

def is_installed(requirement):
    try:
        pkg_resources.require(requirement)
    except pkg_resources.ResolutionError:
        return False
    else:
        return True

# this is the latest version available from PyPI as of 18 December 2015
cython_req = 'cython >= 0.23.4'

# Resolving Cython dependency via 'setup_requires' requires setuptools >= 18.0:
# https://bitbucket.org/pypa/setuptools/commits/424966904023#chg-CHANGES.txt
setuptools_req = "setuptools >= 18.0"

requirements = []
# If the Cython-generated files are absent, and the required Cython isn't
# installed, add Cython to 'setup_requires'.
if not os.path.exists("cppWrapper/pyClipper.cpp"):
    if not is_installed(cython_req):
        if not is_installed(setuptools_req):
            import textwrap
            print(textwrap.dedent("""
                Cython >= 0.23.4 is required, and the dependency cannot be
                automatically resolved with the version of setuptools that is
                currently installed (%s).

                You can install/upgrade Cython using pip:
                $ pip install -U cython

                Alternatively, you can upgrade setuptools:
                $ pip install -U setuptools
                """ % pkg_resources.get_distribution("setuptools").version),
                file=sys.stderr)
            exit(1)
        requirements.append(cython_req)

from setuptools import setup, Extension

if is_installed(cython_req) or cython_req in requirements:
    print('Development mode: Compiling Cython modules from .pyx sources.')
    sources = ["cppWrapper/pyClipper.pyx"]

    from setuptools.command.sdist import sdist as _sdist

    class sdist(_sdist):
        """ Run 'cythonize' on *.pyx sources to ensure the .cpp files included
        in the source distribution are up-to-date.
        """
        def run(self):
            from Cython.Build import cythonize
            cythonize(sources, language='c++')
            _sdist.run(self)

    cmdclass = {'sdist': sdist}
    if is_installed(cython_req):
        from Cython.Distutils import build_ext
        cmdclass['build_ext'] = build_ext

else:
    print('Distribution mode: Compiling from Cython-generated .cpp sources.')
    sources = ["cppWrapper/pyClipper.cpp"]
    cmdclass = {}

ext_module = Extension(
    "booleanOperations.pyClipper",
    sources=sources + ["cppWrapper/clipper.cpp"],
    depends=["cppWrapper/clipper.hpp"],
    language='c++',
)

setup(
    name="booleanOperations",
    version=__version__,
    description="Boolean operations on paths.",
    author="Frederik Berlaen",
    author_email="frederik@typemytype.com",
    url="https://github.com/typemytype/booleanOperations",
    license="MIT",
    packages=["booleanOperations"],
    package_dir={"": "Lib"},
    setup_requires=requirements,
    ext_modules=[ext_module],
    cmdclass=cmdclass,
)
<|endoftext|>


<commit_before>from shutit_module import ShutItModule

class minikube(ShutItModule):

	def build(self, shutit):
		if not shutit.command_available('kubectl'):
			if shutit.send_and_get_output('uname') == 'Darwin':
				shutit.send('curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl')
			else:
				shutit.send('curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl')
			shutit.send('chmod +x kubectl')
			shutit.send('sudo mv kubectl /usr/local/bin/kubectl')
		def install_minikube():
			if shutit.send_and_get_output('uname') == 'Darwin':
				shutit.send('curl -LO https://storage.googleapis.com/minikube/releases/v$(curl -s https://storage.googleapis.com/minikube/releases/stable.txt)/minikube-darwin-amd64')
				shutit.send('mv minikube-darwin-amd64 minikube')
			else:
				shutit.send('curl -LO https://storage.googleapis.com/minikube/releases/v$(curl -s https://storage.googleapis.com/minikube/releases/stable.txt)/minikube-linux-amd64')
				shutit.send('mv minikube-linux-amd64 minikube')
			shutit.send('chmod +x minikube')
			shutit.send('sudo mv minikube /usr/local/bin/minikube')
		if shutit.command_available('minikube'):
			shutit.pause_point('Want to remove minikube? If so, continue')
			shutit.send('rm -rf ~/.minikube')
			shutit.multisend('minikube delete',{'Y/n':'Y'})
		install_minikube()
		if not shutit.send_and_get_output('''minikube status | grep 'Does Not Exist' | wc -l | awk '{print $1}' ''') == '1':
			shutit.send('minikube start')
		return True

def module():
		return minikube(
			'shutit-library.minikube.minikube', 0.12135426,
			description='',
			maintainer='',
			delivery_methods=['bash'],
			depends=['shutit.tk.setup']
		)
<commit_msg>remove<commit_after><|endoftext|>


<commit_before>from distutils.core import setup
import os

# Stolen from django-registration
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
    os.chdir(root_dir)

for dirpath, dirnames, filenames in os.walk('timelinejs'):
    # Ignore dirnames that start with '.'
    for i, dirname in enumerate(dirnames):
        if dirname.startswith('.'):
            del dirnames[i]
    if '__init__.py' in filenames:
        pkg = dirpath.replace(os.path.sep, '.')
        if os.path.altsep:
            pkg = pkg.replace(os.path.altsep, '.')
        packages.append(pkg)
    elif filenames:
        prefix = dirpath[len('timelinejs/'):]
        for f in filenames:
            data_files.append(os.path.join(prefix, f))

setup(
    name='django-timelinejs2',
    version='2.18.1alpha.0',
    description='Connecting Timeline.js v2.18 to Django',
    author='Travis Swicegood',
    author_email='development@domain51.com',
    url='http://github.com/tswicegood/django-timelinejs/',
    install_requires=[
        'django-staticfiles-timelinejs_static==2.18',
        'python-dateutil>=1.5',
    ],
    packages=packages,
    package_data={'timelinejs': data_files},
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Utilities',
    ],
)
<commit_msg>Tag as v2.18.1 to include slug field<commit_after>from distutils.core import setup
import os

# Stolen from django-registration
# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir:
    os.chdir(root_dir)

for dirpath, dirnames, filenames in os.walk('timelinejs'):
    # Ignore dirnames that start with '.'
    for i, dirname in enumerate(dirnames):
        if dirname.startswith('.'):
            del dirnames[i]
    if '__init__.py' in filenames:
        pkg = dirpath.replace(os.path.sep, '.')
        if os.path.altsep:
            pkg = pkg.replace(os.path.altsep, '.')
        packages.append(pkg)
    elif filenames:
        prefix = dirpath[len('timelinejs/'):]
        for f in filenames:
            data_files.append(os.path.join(prefix, f))

setup(
    name='django-timelinejs2',
    version='2.18.1',
    description='Connecting Timeline.js v2.18 to Django',
    author='Travis Swicegood',
    author_email='development@domain51.com',
    url='http://github.com/tswicegood/django-timelinejs/',
    install_requires=[
        'django-staticfiles-timelinejs_static==2.18',
        'python-dateutil>=1.5',
    ],
    packages=packages,
    package_data={'timelinejs': data_files},
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Utilities',
    ],
)
<|endoftext|>


<commit_before>from flask import current_app as app, g, request, Module, render_template, redirect
from disqusapi import DisqusAPI

from sherlock.apps.snippets.models import Snippets
from sherlock.apps.snippets.forms import NewSnippetForm
from sherlock.utils.readability import summarize_url

frontend = Module(__name__)

@frontend.route('/:org/new', methods=['GET', 'POST'])
def new_snippet(org):
    """
    Creates a new snippet for an organization.
    """

    snippets = Snippets(g.redis)

    form = NewSnippetForm()
    if form.validate_on_submit():
        # Generate a unique slug from name
        snippet = snippets.new(text=form.text.data)

        flash("Success")

        return redirect(url_for('snippet_details', org=org, id=snippet.id))

    return render_template('snippets/new_snippet.html', **{
        'org': org,
    })

@frontend.route('/:org', methods=['GET', 'POST'])
def list_snippets(org):
    """
    Displays a list of all snippets for an organization
    """

    snippets = Snippets(g.redis)

    return render_template('snippets/list_snippets.html', **{
        'snippet_list': snippet_list[:10],
    })
<commit_msg>Remove sherlock<commit_after>from flask import current_app as app, g, request, Module, render_template, redirect

from codesharer.apps.snippets.models import Snippets
from codesharer.apps.snippets.forms import NewSnippetForm
from codesharer.utils.readability import summarize_url

frontend = Module(__name__)

@frontend.route('/:org/new', methods=['GET', 'POST'])
def new_snippet(org):
    """
    Creates a new snippet for an organization.
    """

    snippets = Snippets(g.redis)

    form = NewSnippetForm()
    if form.validate_on_submit():
        # Generate a unique slug from name
        snippet = snippets.new(text=form.text.data)

        flash("Success")

        return redirect(url_for('snippet_details', org=org, id=snippet.id))

    return render_template('snippets/new_snippet.html', **{
        'org': org,
    })

@frontend.route('/:org', methods=['GET', 'POST'])
def list_snippets(org):
    """
    Displays a list of all snippets for an organization
    """

    snippets = Snippets(g.redis)

    return render_template('snippets/list_snippets.html', **{
        'snippet_list': snippet_list[:10],
    })
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import

import io
import re
from glob import glob
from os import path, environ

from setuptools import find_packages

# Include extensions only when not on readthedocs.org
if environ.get('READTHEDOCS', None) == 'True':
    from setuptools import setup
    from distutils.core import Extension
    extensions = []
else:
    from numpy.distutils.core import setup, Extension

    extensions = [
        Extension(name='apexpy.fortranapex',
                  sources=['src/fortranapex/magfld.f', 'src/fortranapex/apex.f',
                           'src/fortranapex/makeapexsh.f90',
                           'src/fortranapex/apexsh.f90',
                           'src/fortranapex/checkapexsh.f90', 'src/fortranapex/fortranapex.pyf'])]

def read(*names, **kwargs):
    return io.open(
        path.join(path.dirname(__file__), *names),
        encoding=kwargs.get('encoding', 'utf8')
    ).read()

if __name__ == "__main__":
    setup(
        name='apexpy',
        version='1.0.3',
        license='MIT',
        description='A Python wrapper for Apex coordinates',
        long_description='%s\n%s' % (read('README.rst'),
                                     re.sub(':[a-z]+:`~?(.*?)`', r'``\1``',
                                            read('CHANGELOG.rst'))),
        author='Christer van der Meeren; Angeline G. Burrell',
        author_email='agb073000@utdallas.edu',
        url='https://github.com/aburrell/apexpy',
        packages=find_packages('src'),
        package_dir={'': 'src'},
        py_modules=[path.splitext(path.basename(pp))[0]
                    for pp in glob('src/*.py')],
        package_data={'apexpy': ['apexsh.dat']},
        zip_safe=False,
        classifiers=[
            # complete classifier list:
            # http://pypi.python.org/pypi?%3Aaction=list_classifiers
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Operating System :: Unix',
            'Operating System :: POSIX',
            'Operating System :: Microsoft :: Windows',
            'Operating System :: MacOS :: MacOS X',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            '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 :: Scientific/Engineering :: Physics',
            'Topic :: Utilities',
        ],
        keywords=[
            'apex',
            'modified apex',
            'quasi-dipole',
            'quasi dipole',
            'coordinates',
            'magnetic coordinates',
            'mlt',
            'magnetic local time',
            'conversion',
            'converting',
        ],
        install_requires=[
            'numpy',
        ],
        ext_modules=extensions,
        entry_points={
            'console_scripts': [
                'apexpy = apexpy.__main__:main',
            ]
        },
    )
<commit_msg>MAINT: updated email and version<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import

import io
import re
from glob import glob
from os import path, environ

from setuptools import find_packages

# Include extensions only when not on readthedocs.org
if environ.get('READTHEDOCS', None) == 'True':
    from setuptools import setup
    from distutils.core import Extension
    extensions = []
else:
    from numpy.distutils.core import setup, Extension

    extensions = [
        Extension(name='apexpy.fortranapex',
                  sources=['src/fortranapex/magfld.f', 'src/fortranapex/apex.f',
                           'src/fortranapex/makeapexsh.f90',
                           'src/fortranapex/apexsh.f90',
                           'src/fortranapex/checkapexsh.f90', 'src/fortranapex/fortranapex.pyf'])]

def read(*names, **kwargs):
    return io.open(
        path.join(path.dirname(__file__), *names),
        encoding=kwargs.get('encoding', 'utf8')
    ).read()

if __name__ == "__main__":
    setup(
        name='apexpy',
        version='1.0.4',
        license='MIT',
        description='A Python wrapper for Apex coordinates',
        long_description='%s\n%s' % (read('README.rst'),
                                     re.sub(':[a-z]+:`~?(.*?)`', r'``\1``',
                                            read('CHANGELOG.rst'))),
        author='Christer van der Meeren; Angeline G. Burrell',
        author_email='angeline.burrell@nrl.navy.mil',
        url='https://github.com/aburrell/apexpy',
        packages=find_packages('src'),
        package_dir={'': 'src'},
        py_modules=[path.splitext(path.basename(pp))[0]
                    for pp in glob('src/*.py')],
        package_data={'apexpy': ['apexsh.dat']},
        zip_safe=False,
        classifiers=[
            # complete classifier list:
            # http://pypi.python.org/pypi?%3Aaction=list_classifiers
            'Development Status :: 5 - Production/Stable',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: MIT License',
            'Operating System :: Unix',
            'Operating System :: POSIX',
            'Operating System :: Microsoft :: Windows',
            'Operating System :: MacOS :: MacOS X',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            '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 :: Scientific/Engineering :: Physics',
            'Topic :: Utilities',
        ],
        keywords=[
            'apex',
            'modified apex',
            'quasi-dipole',
            'quasi dipole',
            'coordinates',
            'magnetic coordinates',
            'mlt',
            'magnetic local time',
            'conversion',
            'converting',
        ],
        install_requires=[
            'numpy',
        ],
        ext_modules=extensions,
        entry_points={
            'console_scripts': [
                'apexpy = apexpy.__main__:main',
            ]
        },
    )
<|endoftext|>


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

# start up windows vm
# some script should start on bootup and try to connect back to this script (through some port)
# this script should send commands for building the tree and creating the exe
# could also have a simple file transfer mechanism so I can get the exe without having to muck around with ftp or whatever

# To setup virtualbox so this script works with it do this
# Set the networking for interface 0 as NAT for the VM
# By default Virtualbox will use 10.0/16 as the subnet to supply IP's from.
# To change it to 192.168.90/8 use
#  $ VBoxManage modifyvm "xp-dev" --natnet1 "192.168.90/8"
# The gateway (host) will be 192.168.90.2 and the first address for the machine
# will be 192.168.90.15. It doesn't really matter what the client IP is,
# all that matters is the gateway IP is 192.168.90.2 (the server_ip variable).

# This is completely arbitrary but the server and client need to agree on it.
main_port = 15421
# Default network settings
server_ip = '10.0.2.2'
# network settings in jon's virtual box
# server_ip = '192.168.90.2'
quit_message = '**quit**'
clear_errors_message = '**clear-errors**'
transfer_message = '**transfer**'
paintown_version = '3.4.0'

class CommandFailure(Exception):
    pass

# higher numbers of verbose output more stuff
verbose = 1

def log_debug(str, level = 2):
    if verbose >= level:
        print str

def log_info(str):
    log_debug(str, 1)

def log_error(str):
    log_debug(str, 0)

def client_side():
    def connect(address, port):
        import socket
        connection = socket.socket()
        res = socket.getaddrinfo(address, port)
        af, socktype, proto, canonname, socket_address = res[0]
        log_info("Connecting to %s:%d.." % (address, port))
        connection.connect(socket_address)
        log_info("Connected!")
        return connection

    # execute a command
    def do_command(command, connection):
        import subprocess
        log_info("Execute command '%s'" % command)
        args = command.split(' ')
        if args[0] == 'cd':
            import os
            os.chdir(args[1])
            connection.sendall('changed directory to ' + args[1])
        else:
            process = subprocess.Popen(args, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell = True)
            stdout = process.stdout
            out = stdout.readline()
            while out != None and out != "":
                log_debug("Sending line '%s'" % out)
                connection.sendall(out)
                out = stdout.readline()
            process.wait()
            if process.returncode != 0:
                log_debug("'%s' failed!" % ' '.join([str(x) for x in args]))
                connection.sendall("*FAILURE* '%s' did not succeed. returncode was %s" % (args, process.returncode))
                raise CommandFailure(args)

    def send_file(connection, port, path):
        send = connect(server_ip, port)
        file = open(path, 'rb')
        connection.sendall('Sending file %s' % path)
        send.sendall(file.read())
        file.close()
        send.close()
        connection.sendall('Sent file %s' % path)

    def read_commands(connection):
        import re
        try:
            line = re.compile('(.*)\n\n')
            data = ""
            ignore = False
            while True:
                more = connection.recv(4096)
                if not more:
                    break
                data += more
                log_debug("Buffer is now '%s'" % data)
                get = line.match(data)
                while get != None:
                    command = get.group(1)
                    if ignore:
                        if command == clear_errors_message:
                            ignore = False
                        else:
                            log_debug("Ignoring '%s'" % command)
                    elif command == quit_message:
                        connection.close()
                        return
                    elif command.split(' ')[0] == transfer_message:
                        all = command.split(' ')
                        port = int(all[1])
                        file = all[2]
                        send_file(connection, port, file)
                    else:
                        log_debug("Got command '%s'" % command)
                        try:
                            out = do_command(command, connection)
                        except Exception, e:
                            log_error("Got an error.. closing the connection: " + str(e))
                            ignore = True

                    # chop of the command from the buffer
                    data = data[(len(command) + 2):]
                    get = line.match(data)
        except Exception, e:
            log_error("Got an error.. closing the connection: " + str(e))
            connection.close()

    def run():
        read_commands(connect(server_ip, main_port))

    run()

def server_side(make_commands):
    def start_windows_vm():
        def start_virtualbox():
            import subprocess
            # specific to jon's setup
            vm_name = "xp-dev"
            # executable = "VBoxSDL"
            # Run with no gui
            executable = "VBoxHeadless"
            return subprocess.Popen([executable, "-startvm", vm_name])

        process = start_virtualbox()
        print "Started virtual box. Use 'rdesktop localhost' to connect to the gui"
        return process

    # returns a connection
    def wait_for_connect(port):
        import socket
        server = socket.socket()
        server.bind(('0.0.0.0', port))
        server.listen(1)
        log_info("Waiting for a connection on port %d.." % port)
        (client, address) = server.accept()
        log_info("Got a connection from %s!" % str(address))
        return client

    # write the command and two newlines
    def send_command(connection, command):
        connection.sendall(command)
        connection.sendall("\n\n")

    def compute_md5(file):
        import hashlib
        f = open(file)
        m = hashlib.md5()
        m.update(f.read())
        f.close()
        return m.hexdigest()

    def do_receive_file(transfer, path):
        (client, ignore_address) = transfer.accept()
        size = 4096
        file = open(path, 'wb')
        data = client.recv(size)
        while data:
            file.write(data)
            data = client.recv(size)
        file.close()
        client.close()
        transfer.close()

        print "%s %s [server]" % (compute_md5(path), path)

    # gets the text output from sending commands
    def send_build_commands(connection):
        import socket
        import threading
        # send_command(connection, 'ls')
        send_command(connection, 'cd c:/svn/paintown')
        send_command(connection, 'svn update')
        send_command(connection, 'cd editor')
        send_command(connection, 'ant')
        send_command(connection, 'cd ..')
        send_command(connection, 'make %s' % ' '.join(make_commands))
        transfer = socket.socket()
        transfer.bind(('0.0.0.0', 0))
        transfer.listen(1)
        transfer_port = transfer.getsockname()[1]
        file = 'paintown-win32-%s.exe' % paintown_version
        send_command(connection, 'md5sum misc/%s' % file)

        receive = threading.Thread(target = do_receive_file, args = (transfer, file))
        receive.start()
        send_command(connection, '%s %d misc/%s' % (transfer_message, transfer_port, file))

        # If an error occurs in the guest then he will skip all commands until
        # he sees the **clear-errors** message and then will continue to process
        # commands
        send_command(connection, clear_errors_message)
        # Wait 5 seconds to give time for the quit message to reach the
        # client script.
        send_command(connection, 'shutdown -s -f -t 5')
        send_command(connection, quit_message)
        size = 4096
        data = connection.recv(size)
        while data:
            print data.strip()
            data = connection.recv(size)
        connection.close()
        receive.join()

    def run():
        import time
        start = time.time()
        vm = start_windows_vm()
        send_build_commands(wait_for_connect(main_port))
        log_info("Waiting for vm to close")
        vm.wait()
        end = time.time()
        log_info("All done. Took %f seconds" % (end - start))

    run()

import sys
if len(sys.argv) < 2:
    log_error("""valid arguments:
  client - run as the client (use this option on windows VM)
  server - run as the server (use this option on linux/host)
  make=a,b,c - send make commands a,b,c. default is just 'win'. if you supply this argument then you must supply the 'win' target or it won't be built
  verbose=# - set verbose level. 1 is the default. higher numbers is more verbose
""")
else:
    import re
    verbose_arg = re.compile('verbose=(\d+)')
    make_arg = re.compile('make=(.*)')
    make_commands = ['win']
    for arg in sys.argv[1:]:
        if arg == 'client':
            client_side()
        elif arg == 'server':
            server_side(make_commands)
        elif make_arg.match(arg) != None:
            out = make_arg.match(arg)
            make_commands = out.group(1).split(',')
        elif verbose_arg.match(arg) != None:
            out = verbose_arg.match(arg)
            verbose = int(out.group(1))
<commit_msg>handle error message normally<commit_after>#!/usr/bin/env python

# start up windows vm
# some script should start on bootup and try to connect back to this script (through some port)
# this script should send commands for building the tree and creating the exe
# could also have a simple file transfer mechanism so I can get the exe without having to muck around with ftp or whatever

# To setup virtualbox so this script works with it do this
# Set the networking for interface 0 as NAT for the VM
# By default Virtualbox will use 10.0/16 as the subnet to supply IP's from.
# To change it to 192.168.90/8 use
#  $ VBoxManage modifyvm "xp-dev" --natnet1 "192.168.90/8"
# The gateway (host) will be 192.168.90.2 and the first address for the machine
# will be 192.168.90.15. It doesn't really matter what the client IP is,
# all that matters is the gateway IP is 192.168.90.2 (the server_ip variable).

# This is completely arbitrary but the server and client need to agree on it.
main_port = 15421
# Default network settings
server_ip = '10.0.2.2'
# network settings in jon's virtual box
# server_ip = '192.168.90.2'
quit_message = '**quit**'
clear_errors_message = '**clear-errors**'
transfer_message = '**transfer**'
paintown_version = '3.4.0'

class CommandFailure(Exception):
    pass

# higher numbers of verbose output more stuff
verbose = 1

def log_debug(str, level = 2):
    if verbose >= level:
        print str

def log_info(str):
    log_debug(str, 1)

def log_error(str):
    log_debug(str, 0)

def client_side():
    def connect(address, port):
        import socket
        connection = socket.socket()
        res = socket.getaddrinfo(address, port)
        af, socktype, proto, canonname, socket_address = res[0]
        log_info("Connecting to %s:%d.." % (address, port))
        connection.connect(socket_address)
        log_info("Connected!")
        return connection

    # execute a command
    def do_command(command, connection):
        import subprocess
        log_info("Execute command '%s'" % command)
        args = command.split(' ')
        if args[0] == 'cd':
            import os
            os.chdir(args[1])
            connection.sendall('changed directory to ' + args[1])
        else:
            process = subprocess.Popen(args, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell = True)
            stdout = process.stdout
            out = stdout.readline()
            while out != None and out != "":
                log_debug("Sending line '%s'" % out)
                connection.sendall(out)
                out = stdout.readline()
            process.wait()
            if process.returncode != 0:
                log_debug("'%s' failed!" % ' '.join([str(x) for x in args]))
                connection.sendall("*FAILURE* '%s' did not succeed. returncode was %s" % (args, process.returncode))
                raise CommandFailure(args)

    def send_file(connection, port, path):
        send = connect(server_ip, port)
        file = open(path, 'rb')
        connection.sendall('Sending file %s' % path)
        send.sendall(file.read())
        file.close()
        send.close()
        connection.sendall('Sent file %s' % path)

    def read_commands(connection):
        import re
        try:
            line = re.compile('(.*)\n\n')
            data = ""
            ignore = False
            while True:
                more = connection.recv(4096)
                if not more:
                    break
                data += more
                log_debug("Buffer is now '%s'" % data)
                get = line.match(data)
                while get != None:
                    command = get.group(1)
                    if ignore:
                        if command == clear_errors_message:
                            ignore = False
                        else:
                            log_debug("Ignoring '%s'" % command)
                    elif command == clear_errors_message:
                        ignore = False
                    elif command == quit_message:
                        connection.close()
                        return
                    elif command.split(' ')[0] == transfer_message:
                        all = command.split(' ')
                        port = int(all[1])
                        file = all[2]
                        send_file(connection, port, file)
                    else:
                        log_debug("Got command '%s'" % command)
                        try:
                            out = do_command(command, connection)
                        except Exception, e:
                            log_error("Got an error.. closing the connection: " + str(e))
                            ignore = True

                    # chop of the command from the buffer
                    data = data[(len(command) + 2):]
                    get = line.match(data)
        except Exception, e:
            log_error("Got an error.. closing the connection: " + str(e))
            connection.close()

    def run():
        read_commands(connect(server_ip, main_port))

    run()

def server_side(make_commands):
    def start_windows_vm():
        def start_virtualbox():
            import subprocess
            # specific to jon's setup
            vm_name = "xp-dev"
            # executable = "VBoxSDL"
            # Run with no gui
            executable = "VBoxHeadless"
            return subprocess.Popen([executable, "-startvm", vm_name])

        process = start_virtualbox()
        print "Started virtual box. Use 'rdesktop localhost' to connect to the gui"
        return process

    # returns a connection
    def wait_for_connect(port):
        import socket
        server = socket.socket()
        server.bind(('0.0.0.0', port))
        server.listen(1)
        log_info("Waiting for a connection on port %d.." % port)
        (client, address) = server.accept()
        log_info("Got a connection from %s!" % str(address))
        return client

    # write the command and two newlines
    def send_command(connection, command):
        connection.sendall(command)
        connection.sendall("\n\n")

    def compute_md5(file):
        import hashlib
        f = open(file)
        m = hashlib.md5()
        m.update(f.read())
        f.close()
        return m.hexdigest()

    def do_receive_file(transfer, path):
        (client, ignore_address) = transfer.accept()
        size = 4096
        file = open(path, 'wb')
        data = client.recv(size)
        while data:
            file.write(data)
            data = client.recv(size)
        file.close()
        client.close()
        transfer.close()

        print "%s %s [server]" % (compute_md5(path), path)

    # gets the text output from sending commands
    def send_build_commands(connection):
        import socket
        import threading
        # send_command(connection, 'ls')
        send_command(connection, 'cd c:/svn/paintown')
        send_command(connection, 'svn update')
        send_command(connection, 'cd editor')
        send_command(connection, 'ant')
        send_command(connection, 'cd ..')
        send_command(connection, 'make %s' % ' '.join(make_commands))
        transfer = socket.socket()
        transfer.bind(('0.0.0.0', 0))
        transfer.listen(1)
        transfer_port = transfer.getsockname()[1]
        file = 'paintown-win32-%s.exe' % paintown_version
        send_command(connection, 'md5sum misc/%s' % file)

        receive = threading.Thread(target = do_receive_file, args = (transfer, file))
        receive.start()
        send_command(connection, '%s %d misc/%s' % (transfer_message, transfer_port, file))

        # If an error occurs in the guest then he will skip all commands until
        # he sees the **clear-errors** message and then will continue to process
        # commands
        send_command(connection, clear_errors_message)
        # Wait 5 seconds to give time for the quit message to reach the
        # client script.
        send_command(connection, 'shutdown -s -f -t 5')
        send_command(connection, quit_message)
        size = 4096
        data = connection.recv(size)
        while data:
            print data.strip()
            data = connection.recv(size)
        connection.close()
        receive.join()

    def run():
        import time
        start = time.time()
        vm = start_windows_vm()
        send_build_commands(wait_for_connect(main_port))
        log_info("Waiting for vm to close")
        vm.wait()
        end = time.time()
        log_info("All done. Took %f seconds" % (end - start))

    run()

import sys
if len(sys.argv) < 2:
    log_error("""valid arguments:
  client - run as the client (use this option on windows VM)
  server - run as the server (use this option on linux/host)
  make=a,b,c - send make commands a,b,c. default is just 'win'. if you supply this argument then you must supply the 'win' target or it won't be built
  verbose=# - set verbose level. 1 is the default. higher numbers is more verbose
""")
else:
    import re
    verbose_arg = re.compile('verbose=(\d+)')
    make_arg = re.compile('make=(.*)')
    make_commands = ['win']
    for arg in sys.argv[1:]:
        if arg == 'client':
            client_side()
        elif arg == 'server':
            server_side(make_commands)
        elif make_arg.match(arg) != None:
            out = make_arg.match(arg)
            make_commands = out.group(1).split(',')
        elif verbose_arg.match(arg) != None:
            out = verbose_arg.match(arg)
            verbose = int(out.group(1))
<|endoftext|>


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

Created by Stephan Hügel on 2015-06-21
"""
# from __future__ import unicode_literals
import os
import re
import io
from setuptools import setup, find_packages, Distribution, Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext

def read(*names, **kwargs):
    with io.open(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf8")
    ) as fp:
        return fp.read()

def find_version(*file_paths):
    version_file = read(*file_paths)
    version_match = re.search(
        r"^__version__ = ['\"]([^'\"]*)['\"]",
        version_file,
        re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")

class BinaryDistribution(Distribution):
    def is_pure(self):
        return False

version=find_version("convertbng/util/__init__.py")
with open('README.rst') as f:
    readme = f.read()

extensions = Extension("convertbng.cutil",
                    sources=["convertbng/cutil/__init__.pyx"],
                    libraries=["lonlat_bng"],
                    library_dirs=['convertbng',],
                    include_dirs=['.',' convertbng', 'convertbng/cutil']
)
extensions = [extensions,]

setup(
    name='convertbng',
    version=version,
    description='Fast lon, lat to and from ETRS89 and BNG (OSGB36) using Rust FFI',
    author='Stephan Hügel',
    author_email='urschrei@gmail.com',
    license='MIT License',
    url='https://github.com/urschrei/convertbng',
    include_package_data=True,
    distclass=BinaryDistribution,
    download_url='https://github.com/urschrei/convertbng/tarball/v%s' % version,
    keywords=['Geo', 'BNG', 'OSGB36', 'GIS', 'ETRS89', 'OSTN02'],
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'Intended Audience :: Education',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Scientific/Engineering :: GIS',
    ],
    packages=find_packages(),
    install_requires=['numpy >= 1.9.0'],
    ext_modules = cythonize(extensions),
    cmdclass={'build_ext': build_ext},
    long_description=readme
)
<commit_msg>More path fiddling<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup.py

Created by Stephan Hügel on 2015-06-21
"""
# from __future__ import unicode_literals
import os
import re
import io
from setuptools import setup, find_packages, Distribution, Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext

def read(*names, **kwargs):
    with io.open(
        os.path.join(os.path.dirname(__file__), *names),
        encoding=kwargs.get("encoding", "utf8")
    ) as fp:
        return fp.read()

def find_version(*file_paths):
    version_file = read(*file_paths)
    version_match = re.search(
        r"^__version__ = ['\"]([^'\"]*)['\"]",
        version_file,
        re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")

class BinaryDistribution(Distribution):
    def is_pure(self):
        return False

version=find_version("convertbng/util/__init__.py")
with open('README.rst') as f:
    readme = f.read()

extensions = Extension("convertbng.cutil",
                    sources=["convertbng/cutil/__init__.pyx"],
                    libraries=["lonlat_bng"],
                    library_dirs=['convertbng/util',],
                    include_dirs=['.',' convertbng', 'convertbng/cutil']
)
extensions = [extensions,]

setup(
    name='convertbng',
    version=version,
    description='Fast lon, lat to and from ETRS89 and BNG (OSGB36) using Rust FFI',
    author='Stephan Hügel',
    author_email='urschrei@gmail.com',
    license='MIT License',
    url='https://github.com/urschrei/convertbng',
    include_package_data=True,
    distclass=BinaryDistribution,
    download_url='https://github.com/urschrei/convertbng/tarball/v%s' % version,
    keywords=['Geo', 'BNG', 'OSGB36', 'GIS', 'ETRS89', 'OSTN02'],
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'Intended Audience :: Education',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Scientific/Engineering :: GIS',
    ],
    packages=find_packages(),
    install_requires=['numpy >= 1.9.0'],
    ext_modules = cythonize(extensions),
    cmdclass={'build_ext': build_ext},
    long_description=readme
)
<|endoftext|>


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

from random import random
from subprocess import call
import sys, os

def get_ip_flags(iname):
    for line in file(iname).readlines():
        line = line.strip()
        if not line.startswith('/*') and line.endswith('*/'):
            continue
        line = line[2:-2].strip()
        if not line.startswith('IPOLICE_FLAGS:'):
            continue
        ip_pars = line.split(':', 1)
        ip_flags = ip_pars[1].strip().split(',')
        return ip_flags
    return None

class header_file(object):
    ifname = None
    ip_flags = None

    def __init__(self, ifname):
        self.ifname = ifname
        if not ifname.startswith('"'):
            return
        iname = ifname.strip('"')
        self.ip_flags = get_ip_flags(iname)

    def isflset(self, flname):
        if self.ip_flags == None:
            return False
        return (flname in self.ip_flags)

def first_pass(fname):
    includes = []
    for line in file(fname).readlines():
        line = line.strip()
        lparts = line.split(None, 1)
        if len(lparts) < 2 or not lparts[0].startswith('#include'):
            continue
        includes.append(header_file(lparts[1]))
    if len(includes) > 0:
        return tuple(includes)
    return None

def second_pass(fname_in, fname_out, filter):
    #print 'second_pass', fname_in, fname_out, filter
    fout = file(fname_out, 'w')
    fh_names = [x.ifname for x in filter]
    for line in file(fname_in).readlines():
        line_s = line.strip()
        lparts = line_s.split(None, 1)
        if len(lparts) < 2 or not lparts[0].startswith('#include'):
            fout.write(line)
            continue
        if lparts[1] not in fh_names:
            fout.write(line)
            continue
        fout.write('#if 0\n')
        fout.write(line)
        fout.write('#endif\n')
    ofnames = []
    if fname.endswith('.c') or fname.endswith('.h'):
        objfile = fname[:-2] + '.o'
        ofnames.append(objfile)
        objfile_dbg = 'rtpproxy_debug-' + objfile
        ofnames.append(objfile_dbg)
    for objfile in ofnames:
        if os.path.exists(objfile):
            #print 'removing', objfile
            os.remove(objfile)

if __name__ == '__main__':
    make = os.environ['SMAKE']
    cleanbuild_targets = ('-DRTPP_DEBUG', 'clean', 'all')
    build_targets = ('-DRTPP_DEBUG', 'all')
    try:
        make_flags = os.environ['SMAKEFLAGS'].split()
    except KeyError:
        make_flags = None
    always_ignore = ('<sys/types.h>', '"config.h"')
    fname = sys.argv[1]
    ignore = list(always_ignore)
    if fname.endswith('.c'):
        ignore.append('"%s.h"' % fname[:-2])
    print 'processing %s' % fname
    includes = first_pass(fname)
    if includes == None:
        print '  ...no includes found'
        sys.exit(0)
    includes = [x for x in includes if x.ifname not in ignore \
      and not x.isflset('DONT_REMOVE')]
    includes.sort()
    devnull = file('ipol/' + fname + '.iout', 'a')
    print ' .collected %d "#include" statements' % len(includes)
    print ' .doing dry run'
    cargs = [make,]
    if make_flags != None:
        cargs.extend(make_flags)
    cargs.extend(cleanbuild_targets)
    devnull.write('\n\n***** Dry-Running: %s *****\n\n' % (str(cargs),))
    devnull.flush()
    rval = call(cargs, stdout = devnull, stderr = devnull)
    if rval != 0:
        print '  ...dry run failed'
        sys.exit(255)
    devnull.flush()
    r = int(random() * 1000000.0)
    sfl_includes = []
    fname_bak = '%s.%.6d' % (fname, r)
    os.rename(fname, fname_bak)
    print ' ..renamed "%s" into "%s"' % (fname, fname_bak)
    while True:
        sfl_includes_bak = sfl_includes[:]
        for include in includes:
            if include in sfl_includes:
                continue
            i2 = sfl_includes[:]
            i2.append(include)
            second_pass(fname_bak, fname, i2)
            call(('diff', '-du', fname_bak, fname), stdout = devnull, \
              stderr = devnull)
            devnull.flush()
            cargs = [make,]
            if make_flags != None:
                cargs.extend(make_flags)
            if fname.endswith('.h'):
                cargs.extend(cleanbuild_targets)
            else:
                cargs.extend(build_targets)
            devnull.write('\n\n***** Running: %s *****\n\n' % (str(cargs),))
            devnull.flush()
#            rval = call(cargs)
            rval = call(cargs, stdout = devnull, \
              stderr = devnull)
            os.remove(fname)
            devnull.write('\n\n***** status %d *****\n\n' % (rval,))
            devnull.flush()
            if rval == 0:
                sfl_includes.append(include)
                break
        if len(sfl_includes_bak) == len(sfl_includes):
            break
    os.rename(fname_bak, fname)
    if len(sfl_includes) == 0:
        sys.exit(0)
    for include in sfl_includes:
        print '"#include %s" is superfluous in %s' % (include.ifname, fname)
    sys.exit(1)
<commit_msg>o Add ability to search in a number of extra directories for   local includes;<commit_after>#!/usr/bin/env python

from random import random
from subprocess import call
import sys, os

def get_ip_flags(iname, includedirs):
    includedirs = ['.',] + includedirs
    for dname in includedirs:
        try:
            f = file('%s/%s' % (dname, iname))
            break
        except IOError:
            continue
    else:
        raise Exception('%s is not found in %s' % (iname, includedirs))
    for line in f.readlines():
        line = line.strip()
        if not line.startswith('/*') and line.endswith('*/'):
            continue
        line = line[2:-2].strip()
        if not line.startswith('IPOLICE_FLAGS:'):
            continue
        ip_pars = line.split(':', 1)
        ip_flags = ip_pars[1].strip().split(',')
        return ip_flags
    return None

class header_file(object):
    ifname = None
    ip_flags = None

    def __init__(self, ifname, includedirs):
        self.ifname = ifname
        if not ifname.startswith('"'):
            return
        iname = ifname.strip('"')
        self.ip_flags = get_ip_flags(iname, includedirs)

    def isflset(self, flname):
        if self.ip_flags == None:
            return False
        return (flname in self.ip_flags)

def first_pass(fname, includedirs):
    includes = []
    for line in file(fname).readlines():
        line = line.strip()
        lparts = line.split(None, 1)
        if len(lparts) < 2 or not lparts[0].startswith('#include'):
            continue
        includes.append(header_file(lparts[1], includedirs))
    if len(includes) > 0:
        return tuple(includes)
    return None

def second_pass(fname_in, fname_out, filter):
    #print 'second_pass', fname_in, fname_out, filter
    fout = file(fname_out, 'w')
    fh_names = [x.ifname for x in filter]
    for line in file(fname_in).readlines():
        line_s = line.strip()
        lparts = line_s.split(None, 1)
        if len(lparts) < 2 or not lparts[0].startswith('#include'):
            fout.write(line)
            continue
        if lparts[1] not in fh_names:
            fout.write(line)
            continue
        fout.write('#if 0\n')
        fout.write(line)
        fout.write('#endif\n')
    ofnames = []
    if fname.endswith('.c') or fname.endswith('.h'):
        objfile = fname[:-2] + '.o'
        ofnames.append(objfile)
        objfile_dbg = 'rtpproxy_debug-' + objfile
        ofnames.append(objfile_dbg)
    for objfile in ofnames:
        if os.path.exists(objfile):
            #print 'removing', objfile
            os.remove(objfile)

if __name__ == '__main__':
    make = os.environ['SMAKE']
    includedirs = os.environ['SIPATH'].split(':')
    cleanbuild_targets = ('clean', 'all')
    build_targets = ('all',)
    try:
        make_flags = os.environ['SMAKEFLAGS'].split()
    except KeyError:
        make_flags = None
    always_ignore = ('<sys/types.h>', '"config.h"')
    fname = sys.argv[1]
    ignore = list(always_ignore)
    if fname.endswith('.c'):
        ignore.append('"%s.h"' % fname[:-2])
    print 'processing %s' % fname
    includes = first_pass(fname, includedirs)
    if includes == None:
        print '  ...no includes found'
        sys.exit(0)
    includes = [x for x in includes if x.ifname not in ignore \
      and not x.isflset('DONT_REMOVE')]
    includes.sort()
    devnull = file('ipol/' + fname + '.iout', 'a')
    print ' .collected %d "#include" statements' % len(includes)
    print ' .doing dry run'
    cargs = [make,]
    if make_flags != None:
        cargs.extend(make_flags)
    cargs.extend(cleanbuild_targets)
    devnull.write('\n\n***** Dry-Running: %s *****\n\n' % (str(cargs),))
    devnull.flush()
    rval = call(cargs, stdout = devnull, stderr = devnull)
    if rval != 0:
        print '  ...dry run failed'
        sys.exit(255)
    devnull.flush()
    r = int(random() * 1000000.0)
    sfl_includes = []
    fname_bak = '%s.%.6d' % (fname, r)
    os.rename(fname, fname_bak)
    print ' ..renamed "%s" into "%s"' % (fname, fname_bak)
    while True:
        #print 'sfl_includes:', [x.ifname for x in sfl_includes]
        sfl_includes_bak = sfl_includes[:]
        for include in includes:
            if include in sfl_includes:
                continue
            i2 = sfl_includes[:]
            i2.append(include)
            second_pass(fname_bak, fname, i2)
            call(('diff', '-du', fname_bak, fname), stdout = devnull, \
              stderr = devnull)
            devnull.flush()
            cargs = [make,]
            if make_flags != None:
                cargs.extend(make_flags)
            if fname.endswith('.h'):
                cargs.extend(cleanbuild_targets)
            else:
                cargs.extend(build_targets)
            devnull.write('\n\n***** Running: %s *****\n\n' % (str(cargs),))
            devnull.flush()
#            rval = call(cargs)
            rval = call(cargs, stdout = devnull, \
              stderr = devnull)
            os.remove(fname)
            devnull.write('\n\n***** status %d *****\n\n' % (rval,))
            devnull.flush()
            if rval == 0:
                sfl_includes.append(include)
                break
        if len(sfl_includes_bak) == len(sfl_includes):
            break
    os.rename(fname_bak, fname)
    for include in sfl_includes:
        print '"#include %s" is superfluous in %s' % (include.ifname, fname)
    sys.exit(len(sfl_includes))
<|endoftext|>


<commit_before># Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://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.
"""Tests for counter utility to count all the metrics computed."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import apache_beam as beam
import tensorflow as tf

from tensorflow_model_analysis import constants
from tensorflow_model_analysis.evaluators import counter_util
from tensorflow_model_analysis.post_export_metrics import post_export_metrics

class CounterUtilTest(tf.test.TestCase):

  def testMetricComputedBeamCounter(self):
    with beam.Pipeline() as pipeline:
      auc = post_export_metrics.auc()
      _ = pipeline | counter_util.IncrementMetricsComputationCounters([auc])

    result = pipeline.run()
    metric_filter = beam.metrics.metric.MetricsFilter().with_namespace(
        constants.METRICS_NAMESPACE).with_name('metric_computed_auc')
    actual_metrics_count = result.metrics().query(
        filter=metric_filter)['counters'][0].committed

    self.assertEqual(actual_metrics_count, 1)

  def testSliceSpecBeamCounter(self):
    with beam.Pipeline() as pipeline:
      _ = (
          pipeline
          | beam.Create([[[('slice_key', b'first_slice')]]])
          | counter_util.IncrementSliceSpecCounters())

    result = pipeline.run()

    slice_spec_filter = beam.metrics.metric.MetricsFilter().with_namespace(
        constants.METRICS_NAMESPACE).with_name(
            'slice_computed_slice_key_first_slice')
    slice_count = result.metrics().query(
        filter=slice_spec_filter)['counters'][0].committed
    self.assertEqual(slice_count, 1)

if __name__ == '__main__':
  tf.test.main()
<commit_msg>noop<commit_after># Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://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.
"""Tests for counter utility to count all the metrics computed."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import apache_beam as beam
import tensorflow as tf

from tensorflow_model_analysis import constants
from tensorflow_model_analysis.evaluators import counter_util
from tensorflow_model_analysis.post_export_metrics import post_export_metrics

class CounterUtilTest(tf.test.TestCase):

  def testMetricComputedBeamCounter(self):
    with beam.Pipeline() as pipeline:
      auc = post_export_metrics.auc()
      _ = pipeline | counter_util.IncrementMetricsComputationCounters([auc])

    result = pipeline.run()
    metric_filter = beam.metrics.metric.MetricsFilter().with_namespace(
        constants.METRICS_NAMESPACE).with_name('metric_computed_auc')
    actual_metrics_count = result.metrics().query(
        filter=metric_filter)['counters'][0].committed

    self.assertEqual(actual_metrics_count, 1)

  def testSliceSpecBeamCounter(self):
    with beam.Pipeline() as pipeline:
      _ = (
          pipeline
          | beam.Create([[[('slice_key', 'first_slice')]]])
          | counter_util.IncrementSliceSpecCounters())

    result = pipeline.run()

    slice_spec_filter = beam.metrics.metric.MetricsFilter().with_namespace(
        constants.METRICS_NAMESPACE).with_name(
            'slice_computed_slice_key_first_slice')
    slice_count = result.metrics().query(
        filter=slice_spec_filter)['counters'][0].committed
    self.assertEqual(slice_count, 1)

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


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

import os
import codecs
from setuptools import setup

def read(fname):
    file_path = os.path.join(os.path.dirname(__file__), fname)
    return codecs.open(file_path, encoding='utf-8').read()

setup(
    name='idempotent-sequence',
    version='1.0.3',
    author='Jazeps Basko',
    author_email='jazeps.basko@gmail.com',
    maintainer='Jazeps Basko',
    maintainer_email='jazeps.basko@gmail.com',
    license='MIT',
    url='https://github.com/jbasko/idempotent-sequence',
    description='Organise a set of units of code in a sequence that can be rerun repeatedly skipping already completed units',
    long_description=read('README.rst'),
    packages=['idemseq', 'idemseq.examples'],
    install_requires=['funcsigs>=1.0.2', 'Werkzeug>=0.12'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'License :: OSI Approved :: MIT License',
    ],
)<commit_msg>Bump version<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import codecs
from setuptools import setup

def read(fname):
    file_path = os.path.join(os.path.dirname(__file__), fname)
    return codecs.open(file_path, encoding='utf-8').read()

setup(
    name='idempotent-sequence',
    version='2.0.0',
    author='Jazeps Basko',
    author_email='jazeps.basko@gmail.com',
    maintainer='Jazeps Basko',
    maintainer_email='jazeps.basko@gmail.com',
    license='MIT',
    url='https://github.com/jbasko/idempotent-sequence',
    description='Organise a set of units of code in a sequence that can be rerun repeatedly skipping already completed units',
    long_description=read('README.rst'),
    packages=['idemseq', 'idemseq.examples'],
    install_requires=['funcsigs>=1.0.2', 'Werkzeug>=0.12'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'License :: OSI Approved :: MIT License',
    ],
)<|endoftext|>


<commit_before>import os

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

def get_crochet_version():
    """
    Get crochet version from version module without importing more than
    necessary.
    """
    this_dir_path = os.path.dirname(__file__)
    crochet_module_path = os.path.join(this_dir_path, "crochet")
    version_module_path = os.path.join(crochet_module_path, "_version.py")

    # The version module contains a variable called __version__
    with open(version_module_path) as version_module:
        exec(version_module.read())
    return locals()["__version__"]

def read(path):
    """
    Read the contents of a file.
    """
    with open(path) as f:
        return f.read()

setup(
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    name='crochet',
    version=get_crochet_version(),
    description="Use Twisted anywhere!",
    install_requires=[
        "Twisted>=11.1",
    ],
    keywords="twisted threading",
    license="MIT",
    packages=["crochet", "crochet.tests"],
    url="https://github.com/itamarst/crochet",
    maintainer='Itamar Turner-Trauring',
    maintainer_email='itamar@itamarst.org',
    long_description=read('README.rst') + '\n' + read('NEWS.rst'),
)
<commit_msg>Fix wrong path to news file.<commit_after>import os

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

def get_crochet_version():
    """
    Get crochet version from version module without importing more than
    necessary.
    """
    this_dir_path = os.path.dirname(__file__)
    crochet_module_path = os.path.join(this_dir_path, "crochet")
    version_module_path = os.path.join(crochet_module_path, "_version.py")

    # The version module contains a variable called __version__
    with open(version_module_path) as version_module:
        exec(version_module.read())
    return locals()["__version__"]

def read(path):
    """
    Read the contents of a file.
    """
    with open(path) as f:
        return f.read()

setup(
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],
    name='crochet',
    version=get_crochet_version(),
    description="Use Twisted anywhere!",
    install_requires=[
        "Twisted>=11.1",
    ],
    keywords="twisted threading",
    license="MIT",
    packages=["crochet", "crochet.tests"],
    url="https://github.com/itamarst/crochet",
    maintainer='Itamar Turner-Trauring',
    maintainer_email='itamar@itamarst.org',
    long_description=read('README.rst') + '\n' + read('docs/news.rst'),
)
<|endoftext|>


<commit_before>#+
# Distutils script to install DBussy. Invoke from the command line
# in this directory as follows:
#
#     python3 setup.py build
#     sudo python3 setup.py install
#
# Written by Lawrence D'Oliveiro <ldo@geek-central.gen.nz>.
#-

import sys
import distutils.core
from distutils.command.build import \
    build as std_build

class my_build(std_build) :
    "customization of build to perform additional validation."

    def run(self) :
        try :
            exec \
              (
                "async def dummy() :\n"
                "    pass\n"
                "#end dummy\n"
              )
        except SyntaxError :
            sys.stderr.write("This module requires Python 3.5 or later.\n")
            sys.exit(-1)
        #end try
        super().run()
    #end run

#end my_build

distutils.core.setup \
  (
    name = "DBussy",
    version = "0.95",
    description = "language bindings for libdbus, for Python 3.5 or later",
    author = "Lawrence D'Oliveiro",
    author_email = "ldo@geek-central.gen.nz",
    url = "http://github.com/ldo/dbussy",
    py_modules = ["dbussy", "ravel"],
    cmdclass =
        {
            "build" : my_build,
        },
  )
<commit_msg>why not call it version 1.0<commit_after>#+
# Distutils script to install DBussy. Invoke from the command line
# in this directory as follows:
#
#     python3 setup.py build
#     sudo python3 setup.py install
#
# Written by Lawrence D'Oliveiro <ldo@geek-central.gen.nz>.
#-

import sys
import distutils.core
from distutils.command.build import \
    build as std_build

class my_build(std_build) :
    "customization of build to perform additional validation."

    def run(self) :
        try :
            exec \
              (
                "async def dummy() :\n"
                "    pass\n"
                "#end dummy\n"
              )
        except SyntaxError :
            sys.stderr.write("This module requires Python 3.5 or later.\n")
            sys.exit(-1)
        #end try
        super().run()
    #end run

#end my_build

distutils.core.setup \
  (
    name = "DBussy",
    version = "1.0",
    description = "language bindings for libdbus, for Python 3.5 or later",
    author = "Lawrence D'Oliveiro",
    author_email = "ldo@geek-central.gen.nz",
    url = "http://github.com/ldo/dbussy",
    py_modules = ["dbussy", "ravel"],
    cmdclass =
        {
            "build" : my_build,
        },
  )
<|endoftext|>