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

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

version = '0.4.1'

if sys.argv[-1] == 'publish':
    try:
        import wheel
        print("Wheel version: ", wheel.__version__)
    except ImportError:
        print('Wheel library missing. Please run "pip install wheel"')
        sys.exit()
    os.system('python setup.py sdist upload')
    os.system('python setup.py bdist_wheel upload')
    sys.exit()

if sys.argv[-1] == 'tag':
    print("Tagging the version on git:")
    os.system("git tag -a %s -m 'version %s'" % (version, version))
    os.system("git push --tags")
    sys.exit()

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

setup(
    name='django-behaviors',
    version=version,
    description="""Common behaviors for Django Models, e.g. Timestamps, Publishing, Authoring/Editing and more.""",
    long_description=readme + '\n\n' + history,
    author='Ryan Castner',
    author_email='castner.rr@gmail.com',
    url='https://github.com/audiolion/django-behaviors',
    packages=[
        'behaviors',
    ],
    include_package_data=True,
    extras={
        "slugged": "awesome-slugify>=1.6.5",
    },
    license="MIT",
    zip_safe=False,
    keywords='django-behaviors',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Framework :: Django',
        'Framework :: Django :: 1.8',
        'Framework :: Django :: 1.11',
        'Framework :: Django :: 2.0',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        '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',
    ],
)
<commit_msg>chore: long_description_content_type added to setup.py Resolves twine warning<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

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

version = '0.4.1'

if sys.argv[-1] == 'publish':
    try:
        import wheel
        print("Wheel version: ", wheel.__version__)
    except ImportError:
        print('Wheel library missing. Please run "pip install wheel"')
        sys.exit()
    os.system('python setup.py sdist upload')
    os.system('python setup.py bdist_wheel upload')
    sys.exit()

if sys.argv[-1] == 'tag':
    print("Tagging the version on git:")
    os.system("git tag -a %s -m 'version %s'" % (version, version))
    os.system("git push --tags")
    sys.exit()

readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')

setup(
    name='django-behaviors',
    version=version,
    description="""Common behaviors for Django Models, e.g. Timestamps, Publishing, Authoring/Editing and more.""",
    long_description=readme + '\n\n' + history,
    long_description_content_type='text/x-rst',
    author='Ryan Castner',
    author_email='castner.rr@gmail.com',
    url='https://github.com/audiolion/django-behaviors',
    packages=[
        'behaviors',
    ],
    include_package_data=True,
    extras={
        "slugged": "awesome-slugify>=1.6.5",
    },
    license="MIT",
    zip_safe=False,
    keywords='django-behaviors',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Framework :: Django',
        'Framework :: Django :: 1.8',
        'Framework :: Django :: 1.11',
        'Framework :: Django :: 2.0',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        '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',
    ],
)
<|endoftext|>


<commit_before>#
# This file is part of looping. Looping is free software available under the
# terms of the Apache 2.0 license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2013 the authors. See the file "AUTHORS" for a complete
# list.

from setuptools import setup

version_info = {
    'name': 'looping',
    'version': '0.2.dev',
    'description': 'An EventLoop interface for various event loops',
    'author': 'Geert Jansen',
    'author_email': 'geertj@gmail.com',
    'url': 'https://github.com/geertj/looping',
    'license': 'Apache 2.0',
    'classifiers': [
        'Development Status :: 3 - Alpha',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.2'
        'Programming Language :: Python :: 3.3'
    ]
}

if __name__ == '__main__':
    setup(
        package_dir = {'': 'lib'},
        packages = ['looping'],
        install_requires = ['setuptools', 'pyuv>=0.9.6'],
        test_suite = 'nose.collector',
        **version_info
    )
<commit_msg>Version 0.2<commit_after>#
# This file is part of looping. Looping is free software available under the
# terms of the Apache 2.0 license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2013 the authors. See the file "AUTHORS" for a complete
# list.

from setuptools import setup

version_info = {
    'name': 'looping',
    'version': '0.2',
    'description': 'A PEP3156 interface for various event loops',
    'author': 'Geert Jansen',
    'author_email': 'geertj@gmail.com',
    'url': 'https://github.com/geertj/looping',
    'license': 'Apache 2.0',
    'classifiers': [
        'Development Status :: 4 - Beta',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.2'
        'Programming Language :: Python :: 3.3'
    ]
}

if __name__ == '__main__':
    setup(
        package_dir = {'': 'lib'},
        packages = ['looping'],
        install_requires = ['setuptools', 'pyuv>=0.9.6'],
        test_suite = 'nose.collector',
        **version_info
    )
<|endoftext|>


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

"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

from setuptools import setup, find_packages

with open('README.rst') as readme_file:
    README = readme_file.read()

setup(
    name="OGRe",
    version='4.5.1',
    description='OpenFusion GeoJSON Retriever',
    long_description=README,
    author='David Tucker',
    author_email='dmtucker@ucsc.edu',
    license='LGPLv2+',
    url='https://github.com/dmtucker/ogre',
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),
    include_package_data=True,
    test_suite="ogre.test",
    tests_require=['mock==1.0.1'],
    install_requires=['twython'],
    entry_points={'console_scripts': ['ogre = ogre.__main__:main']},
    keywords='OpenFusion Twitter GeoJSON geotag',
    classifiers=[
        'License :: OSI Approved :: '
        'GNU Lesser General Public License v2 or later (LGPLv2+)',
        'Intended Audience :: Developers',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 4 - Beta',
    ],
)
<commit_msg>Bump the version to 4.6.0<commit_after>#!/usr/bin/env python
# coding: utf-8

"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

from setuptools import setup, find_packages

with open('README.rst') as readme_file:
    README = readme_file.read()

setup(
    name="OGRe",
    version='4.6.0',
    description='OpenFusion GeoJSON Retriever',
    long_description=README,
    author='David Tucker',
    author_email='dmtucker@ucsc.edu',
    license='LGPLv2+',
    url='https://github.com/dmtucker/ogre',
    packages=find_packages(exclude=['contrib', 'docs', 'tests']),
    include_package_data=True,
    test_suite="ogre.test",
    tests_require=['mock==1.0.1'],
    install_requires=['twython'],
    entry_points={'console_scripts': ['ogre = ogre.__main__:main']},
    keywords='OpenFusion Twitter GeoJSON geotag',
    classifiers=[
        'License :: OSI Approved :: '
        'GNU Lesser General Public License v2 or later (LGPLv2+)',
        'Intended Audience :: Developers',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 4 - Beta',
    ],
)
<|endoftext|>


<commit_before>from distutils.core import setup

setup(
    name='biocyc',
    version='0.1.9',
    author='Martin Fitzpatrick',
    author_email='martin.fitzpatrick@gmail.com',
    packages=['biocyc'],
    url='https://github.com/mfitzp/biocyc',
    #license='LICENSE.txt',
    description='Python interface to BioCyc REST API with caching mechanism',
    #long_description=open('README.txt').read()
    )
<commit_msg>Version bump<commit_after>from distutils.core import setup

setup(
    name='biocyc',
    version='0.2.0',
    author='Martin Fitzpatrick',
    author_email='martin.fitzpatrick@gmail.com',
    packages=['biocyc'],
    url='https://github.com/mfitzp/biocyc',
    #license='LICENSE.txt',
    description='Python interface to BioCyc REST API with caching mechanism',
    #long_description=open('README.txt').read()
    )
<|endoftext|>


<commit_before># 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
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import io
import os

import setuptools

# Package metadata.

name = 'google-cloud-speech'
description = 'Google Cloud Speech API client library'
version = '0.32.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'google-api-core[grpc]<0.2.0dev,>=0.1.4',
]
extras = {
}

# Setup boilerplate below this line.

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

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        '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',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)
<commit_msg>Update dependency range for api-core to include v1.0.0 releases (#4944)<commit_after># 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
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import io
import os

import setuptools

# Package metadata.

name = 'google-cloud-speech'
description = 'Google Cloud Speech API client library'
version = '0.32.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'google-api-core[grpc]<2.0.0dev,>=0.1.4',
]
extras = {
}

# Setup boilerplate below this line.

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

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')

setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        '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',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)
<|endoftext|>


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

descr = """Machine Learning Time Series Platform

https://github.com/mltsp

"""

DISTNAME            = 'mltsp'
DESCRIPTION         = 'Machine Learning Time Series Platform'
LONG_DESCRIPTION    = descr
MAINTAINER          = 'MLTSP Team'
MAINTAINER_EMAIL    = 'stefanv@berkeley.edu'
URL                 = 'https://github.com/mltsp'
LICENSE             = 'Modified BSD'
DOWNLOAD_URL        = 'https://github.com/mltsp/mltsp'
VERSION             = '0.1dev'
PYTHON_VERSION      = (3, 4)

import os

import setuptools
from distutils.command.build_py import build_py

def configuration(parent_package='', top_path=None):
    if os.path.exists('MANIFEST'):
         os.remove('MANIFEST')

    from numpy.distutils.misc_util import Configuration
    config = Configuration(None, parent_package, top_path)

    config.set_options(
            ignore_setup_xxx_py=True,
            assume_default_configuration=True,
            delegate_options_to_subpackages=True,
            quiet=True)

    config.add_subpackage('mltsp')

    return config

def write_version_py(filename='version.py'):
    template = """# THIS FILE IS GENERATED FROM THE MLTSP SETUP.PY
version='%s'
"""

    vfile = open(os.path.join(os.path.dirname(__file__),
                              filename), 'w')

    try:
        vfile.write(template % VERSION)
    finally:
        vfile.close()

def get_package_version(package):
    for version_attr in ('__version__', 'VERSION', 'version'):
        version_info = getattr(package, version_attr, None)
        if version_info and str(version_attr) == version_attr:
            return str(version_info)

if __name__ == "__main__":
    write_version_py()

    from numpy.distutils.core import setup
    setup(
        name=DISTNAME,
        description=DESCRIPTION,
        long_description=LONG_DESCRIPTION,
        maintainer=MAINTAINER,
        maintainer_email=MAINTAINER_EMAIL,
        url=URL,
        license=LICENSE,
        download_url=DOWNLOAD_URL,
        version=VERSION,

        classifiers=[
            'Development Status :: 4 - Beta',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Programming Language :: C',
            'Programming Language :: Python :: 3',
            'Topic :: Scientific/Engineering',
            'Operating System :: Microsoft :: Windows',
            'Operating System :: POSIX',
            'Operating System :: Unix',
            'Operating System :: MacOS',
        ],

        configuration=configuration,
        packages=setuptools.find_packages(),
        include_package_data=True,
        zip_safe=False,
        cmdclass={'build_py': build_py},
    )
<commit_msg>Write mltsp version from setup file<commit_after>#! /usr/bin/env python

descr = """Machine Learning Time Series Platform

https://github.com/mltsp

"""

DISTNAME            = 'mltsp'
DESCRIPTION         = 'Machine Learning Time Series Platform'
LONG_DESCRIPTION    = descr
MAINTAINER          = 'MLTSP Team'
MAINTAINER_EMAIL    = 'stefanv@berkeley.edu'
URL                 = 'https://github.com/mltsp'
LICENSE             = 'Modified BSD'
DOWNLOAD_URL        = 'https://github.com/mltsp/mltsp'
VERSION             = '0.1dev'
PYTHON_VERSION      = (3, 4)

import os

import setuptools
from distutils.command.build_py import build_py

def configuration(parent_package='', top_path=None):
    if os.path.exists('MANIFEST'):
         os.remove('MANIFEST')

    from numpy.distutils.misc_util import Configuration
    config = Configuration(None, parent_package, top_path)

    config.set_options(
            ignore_setup_xxx_py=True,
            assume_default_configuration=True,
            delegate_options_to_subpackages=True,
            quiet=True)

    config.add_subpackage('mltsp')

    return config

def write_version_py(filename='mltsp/version.py'):
    template = """# THIS FILE IS GENERATED FROM THE MLTSP SETUP.PY
version='%s'
"""

    vfile = open(os.path.join(os.path.dirname(__file__),
                              filename), 'w')

    try:
        vfile.write(template % VERSION)
    finally:
        vfile.close()

def get_package_version(package):
    for version_attr in ('__version__', 'VERSION', 'version'):
        version_info = getattr(package, version_attr, None)
        if version_info and str(version_attr) == version_attr:
            return str(version_info)

if __name__ == "__main__":
    write_version_py()

    from numpy.distutils.core import setup
    setup(
        name=DISTNAME,
        description=DESCRIPTION,
        long_description=LONG_DESCRIPTION,
        maintainer=MAINTAINER,
        maintainer_email=MAINTAINER_EMAIL,
        url=URL,
        license=LICENSE,
        download_url=DOWNLOAD_URL,
        version=VERSION,

        classifiers=[
            'Development Status :: 4 - Beta',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: Science/Research',
            'License :: OSI Approved :: BSD License',
            'Programming Language :: C',
            'Programming Language :: Python :: 3',
            'Topic :: Scientific/Engineering',
            'Operating System :: Microsoft :: Windows',
            'Operating System :: POSIX',
            'Operating System :: Unix',
            'Operating System :: MacOS',
        ],

        configuration=configuration,
        packages=setuptools.find_packages(),
        include_package_data=True,
        zip_safe=False,
        cmdclass={'build_py': build_py},
    )
<|endoftext|>


<commit_before>from setuptools import setup
from distutils.core import Extension

ext_modules = []

ext_modules.append(Extension(name='pinpoint._caltech_distortion',
                             sources=['src/_caltech_distortion.c']))

setup(name='pinpoint',
      description='a Python library for N-view camera calibration',
      version='0.0.2+git',
      author='pinpoint developers',
      author_email='pinpoint-team@lists.launchpad.net',
      license='BSD',
      url='http://launchpad.net/pinpoint',
      packages = ['pinpoint'],
      ext_modules= ext_modules,
      entry_points = {
    'gui_scripts': ['pinpoint_distortion_gui = pinpoint.distortion_gui:main',
                    ],
    },
      )
<commit_msg>bump version for release<commit_after>from setuptools import setup
from distutils.core import Extension

ext_modules = []

ext_modules.append(Extension(name='pinpoint._caltech_distortion',
                             sources=['src/_caltech_distortion.c']))

setup(name='pinpoint',
      description='a Python library for N-view camera calibration',
      version='0.0.3',
      author='pinpoint developers',
      author_email='pinpoint-team@lists.launchpad.net',
      license='BSD',
      url='http://launchpad.net/pinpoint',
      packages = ['pinpoint'],
      ext_modules= ext_modules,
      entry_points = {
    'gui_scripts': ['pinpoint_distortion_gui = pinpoint.distortion_gui:main',
                    ],
    },
      )
<|endoftext|>


<commit_before>"""Distutils setup file, used to install or test 'implements'."""
from __future__ import print_function

import textwrap
from setuptools import setup

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

if __name__ == '__main__':
    setup(
        name='implements',
        description='Pythonic interfaces',
        long_description=readme,
        url='http://implements.readthedocs.io',
        use_scm_version=True,
        author='Kamil Sindi',
        author_email='ksindi@ksindi.com',
        maintainer='Kamil Sindi',
        maintainer_email='ksindi@ksindi.com',
        install_requires=[
            'setuptools_scm>=1.15.0',
        ],
        setup_requires=[
            'setuptools>=18.0',
            'pytest-runner',
            'setuptools_scm>=1.15.0',
            'sphinx_rtd_theme',
        ],
        tests_require=[
            'pytest',
            'pytest-flake8',
        ],
        zip_safe=False,
        include_package_data=True,
        classifiers=textwrap.dedent("""
            Development Status :: 4 - Beta
            Intended Audience :: Developers
            License :: OSI Approved :: MIT
            Natural Language :: English
            Programming Language :: Python :: 3
            Programming Language :: Python :: 3.5
            Programming Language :: Python :: 3.6
            """).strip().splitlines(),
        keywords=['implements', 'interfaces'],
        license='MIT',
    )
<commit_msg>update setup.py<commit_after>"""Distutils setup file, used to install or test 'implements'."""
from __future__ import print_function

import textwrap
from setuptools import setup

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

if __name__ == '__main__':
    setup(
        name='implements',
        description='Pythonic interfaces',
        long_description=readme,
        url='http://implements.readthedocs.io',
        use_scm_version=True,
        author='Kamil Sindi',
        author_email='ksindi@ksindi.com',
        maintainer='Kamil Sindi',
        maintainer_email='ksindi@ksindi.com',
        install_requires=[
            'setuptools_scm>=1.15.0',
        ],
        setup_requires=[
            'setuptools>=18.0',
            'pytest-runner',
            'setuptools_scm>=1.15.0',
            'sphinx_rtd_theme',
        ],
        tests_require=[
            'pytest',
            'pytest-flake8',
        ],
        zip_safe=False,
        include_package_data=True,
        classifiers=textwrap.dedent("""
            Development Status :: 5 - Production/Stable
            Intended Audience :: Developers
            License :: OSI Approved :: MIT License
            Natural Language :: English
            Programming Language :: Python :: 3
            Programming Language :: Python :: 3.5
            Programming Language :: Python :: 3.6
            """).strip().splitlines(),
        keywords=['implements', 'interfaces'],
        license='MIT',
    )
<|endoftext|>


<commit_before># coding=utf-8

import os
import subprocess
import sys

from setuptools import setup
from setuptools.command.build_py import build_py

class build_py_with_assets(build_py):
    def run(self):
        if not self.dry_run:
            self._build_assets()
        build_py.run(self)

    def _build_assets(self):
        asset_dir = 'maildump/static/assets'
        # Lame check if we have prebuilt assets. If we do so we are probably installing from a pypi package which
        # means that webassets might not be installed yet and thus we cannot build the assets now...
        if os.path.exists(asset_dir) and os.listdir(asset_dir):
            return
        args = ['webassets', '-m', 'maildump.web', 'build']
        with open(os.devnull, 'w') as devnull:
            subprocess.check_call(args, stderr=devnull)
            subprocess.check_call(args + ['--production'], stderr=devnull)

with open('requirements.txt') as f:
    requirements = f.read().splitlines()
with open('README.rst') as f:
    readme = f.read()

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

setup(
    name='maildump',
    version='0.5',
    description='An SMTP server that makes all received mails accessible via a web interface and REST API.',
    long_description=readme,
    url='https://github.com/ThiefMaster/maildump',
    download_url='https://github.com/ThiefMaster/maildump',
    author=u'Adrian Mönnich',
    author_email='adrian@planetcoding.net',
    license='MIT',
    zip_safe=False,
    include_package_data=True,
    packages=('maildump', 'maildump_runner'),
    entry_points={
        'console_scripts': [
            'maildump = maildump_runner.__main__:main',
        ],
    },
    install_requires=requirements,
    cmdclass={'build_py': build_py_with_assets},
    classifiers=[
        'Development Status :: 4 - Beta',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Environment :: No Input/Output (Daemon)',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Topic :: Communications :: Email',
        'Topic :: Software Development',
        'Topic :: System :: Networking',
        'Topic :: Utilities'
    ]
)
<commit_msg>Bump version to 0.5.1<commit_after># coding=utf-8

import os
import subprocess
import sys

from setuptools import setup
from setuptools.command.build_py import build_py

class build_py_with_assets(build_py):
    def run(self):
        if not self.dry_run:
            self._build_assets()
        build_py.run(self)

    def _build_assets(self):
        asset_dir = 'maildump/static/assets'
        # Lame check if we have prebuilt assets. If we do so we are probably installing from a pypi package which
        # means that webassets might not be installed yet and thus we cannot build the assets now...
        if os.path.exists(asset_dir) and os.listdir(asset_dir):
            return
        args = ['webassets', '-m', 'maildump.web', 'build']
        with open(os.devnull, 'w') as devnull:
            subprocess.check_call(args, stderr=devnull)
            subprocess.check_call(args + ['--production'], stderr=devnull)

with open('requirements.txt') as f:
    requirements = f.read().splitlines()
with open('README.rst') as f:
    readme = f.read()

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

setup(
    name='maildump',
    version='0.5.1',
    description='An SMTP server that makes all received mails accessible via a web interface and REST API.',
    long_description=readme,
    url='https://github.com/ThiefMaster/maildump',
    download_url='https://github.com/ThiefMaster/maildump',
    author=u'Adrian Mönnich',
    author_email='adrian@planetcoding.net',
    license='MIT',
    zip_safe=False,
    include_package_data=True,
    packages=('maildump', 'maildump_runner'),
    entry_points={
        'console_scripts': [
            'maildump = maildump_runner.__main__:main',
        ],
    },
    install_requires=requirements,
    cmdclass={'build_py': build_py_with_assets},
    classifiers=[
        'Development Status :: 4 - Beta',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Environment :: No Input/Output (Daemon)',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Topic :: Communications :: Email',
        'Topic :: Software Development',
        'Topic :: System :: Networking',
        'Topic :: Utilities'
    ]
)
<|endoftext|>


<commit_before>import setuptools
import os
import sys
import distutils.spawn
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.errors import *
import pickle

if sys.version_info[0] == 2:
    def output(*args, **kwargs):
        end = kwargs.get('end', '\n')
        f = kwargs.get('file', sys.stdout)
        f.write(' '.join(str(a) for a in args))
        f.write(end)
else:
    output = getattr(__builtins__, 'print')

__version__ = "0.10.0"

# Disable hard links, otherwise building distributions fails on OS X
try:
    del os.link
except:
    pass

# On Windows, we need ws2_32 and iphlpapi
if getattr(sys, 'getwindowsversion', None):
    libraries = ['ws2_32', 'iphlpapi']
    def_macros = [('WIN32', 1)]
else:
    mos = getattr(sys, 'platform', None)
    libraries = []
    if mos.startswith('sunos'):
        libraries = ['socket', 'nsl']
    def_macros = []

def_macros.append(("NETIFACES_VERSION", __version__))

iface_mod = Extension('netifaces', sources=['netifaces.c'],
                      libraries=libraries,
                      define_macros=def_macros)

#
#  There must be a better way to do this...
#
class my_build_ext(build_ext):
    def build_extensions(self):
        self.check_requirements()
        build_ext.build_extensions(self)

    def test_build(self, contents, link=True, execute=False, libraries=None,
                   include_dirs=None, library_dirs=None):
        name = os.path.join(self.build_temp, 'conftest-%s.c' % self.conftestidx)
        self.conftestidx += 1
        if os.path.exists(name):
            os.unlink(name)
        thefile = open(name, 'w')
        thefile.write(contents)
        thefile.close()

        sys.stdout.flush()
        sys.stderr.flush()
        mystdout = os.dup(1)
        mystderr = os.dup(2)
        result = True
        try:
            os.dup2(self.ctout, 1)
            os.dup2(self.ctout, 2)
            try:
                objects = self.compiler.compile([name],
                                                output_dir=self.build_temp,
                                                include_dirs=include_dirs,
                                                debug=self.debug)
                if link:
                    self.compiler.link_executable(objects,
                                                  'conftest',
                                                  output_dir=self.build_temp,
                                                  library_dirs=library_dirs,
                                                  libraries=libraries,
                                                  debug=self.debug)
                    if execute:
                        abspath = os.path.abspath(os.path.join(self.build_temp,
                                                               'conftest'))
                        pipe = os.popen(abspath, 'r')
                        result = pipe.read().strip()
                        status = pipe.close()
                        if status is None:
                            status = 0
                        if result == '':
                            result = True
                        if status != 0:
                            result = False

            finally:
                os.dup2(mystdout, 1)
                os.dup2(mystderr, 2)
        except CompileError:
            return False
        except DistutilsExecError:
            return False
        return result

    def check_requirements(self):
        # Load the cached config data from a previous run if possible; compiling
        # things to test for features is slow
        cache_file = os.path.join(self.build_temp, 'config.cache')
        if os.path.exists(cache_file):
            myfile = open(cache_file, 'rb')
            try:
                results = pickle.load(myfile)
            finally:
                myfile.close()
        else:
            results = {}

        self.conftestidx = 0

        output("checking for getifaddrs...", end='')

        result = results.get('have_getifaddrs', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            if not os.path.exists(self.build_temp):
                os.makedirs(self.build_temp)
            outname = os.path.join(self.build_temp, 'conftest.out')
            self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)
            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <ifaddrs.h>
            int main(void) {
              struct ifaddrs *addrs;
              int ret;
              ret = getifaddrs(&addrs);
              freeifaddrs (addrs);
              return 0;
            }
            """
            if self.test_build(testrig):
                result = True
            else:
                result = False

        if result:
            output("found. %s" % cached)
            self.compiler.define_macro('HAVE_GETIFADDRS', 1)
        else:
            output("not found. %s" % cached)

        results['have_getifaddrs'] = result

        output("checking for getnameinfo...", end='')

        result = results.get('have_getnameinfo', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            if not os.path.exists(self.build_temp):
                os.makedirs(self.build_temp)
            outname = os.path.join(self.build_temp, 'conftest2.out')
            self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)
            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <arpa/inet.h>
            #include <netdb.h>
            #include <stdlib.h>
            int main(void) {
              struct sockaddr_in sin;
              char buffer[256];
              int ret;

              sin.sin_family = AF_INET;
              sin.sin_port = 0;
              sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);

              ret = getnameinfo ((struct sockaddr *)&sin, sizeof (sin),
                                 buffer, sizeof (buffer),
                                 NULL, 0,
                                 NI_NUMERICHOST);

              return 0;
            }
            """
            if self.test_build(testrig,libraries=libraries):
                result = True
            else:
                result = False

        if result:
            output("found. %s" % cached)
            self.compiler.define_macro('HAVE_GETNAMEINFO', 1)
        else:
            output("not found. %s" % cached)

        results['have_getnameinfo'] = result

        if not results['have_getifaddrs']:
            output("checking for socket IOCTLs...", end='')

            result = results.get('have_socket_ioctls', None)
            if result is not None:
                cached = '(cached)'
            else:
                cached = ''

                if not os.path.exists(self.build_temp):
                    os.makedirs(self.build_temp)
                outname = os.path.join(self.build_temp, 'conftest3.out')
                self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)

                result = []
                ioctls = ('SIOCGIFCONF',
                          'SIOCGSIZIFCONF',
                          'SIOCGIFHWADDR',
                          'SIOCGIFADDR',
                          'SIOCGIFFLAGS',
                          'SIOCGIFDSTADDR',
                          'SIOCGIFBRDADDR',
                          'SIOCGIFNETMASK',
                          'SIOCGLIFNUM',
                          'SIOCGLIFCONF',
                          'SIOCGLIFFLAGS')
                added_includes = ""
                if mos.startswith('sunos'):
                    added_includes = """
                     #include <unistd.h>
                     #include <stropts.h>
                     #include <sys/sockio.h>
                    """

                for ioctl in ioctls:
                    testrig = """
                    #include <sys/types.h>
                    #include <sys/socket.h>
                    #include <sys/ioctl.h>
                    #include <net/if.h>
                    #include <netinet/in.h>
                    #include <arpa/inet.h>
                    %(addedinc)s
                    int main(void) {
                        int fd = socket (AF_INET, SOCK_DGRAM, IPPROTO_IP);
                        struct ifreq ifreq;

                        ioctl(fd, %(ioctl)s, &ifreq);

                        return 0;
                    }
                    """ % { 'ioctl': ioctl , 'addedinc': added_includes}

                    if self.test_build(testrig,libraries=libraries):
                        result.append(ioctl)

            if result:
                output("%r. %s" % (result, cached))
                for ioctl in result:
                    self.compiler.define_macro('HAVE_%s' % ioctl, 1)
                self.compiler.define_macro('HAVE_SOCKET_IOCTLS', 1)
            else:
                output("not found. %s" % cached)

            results['have_socket_ioctls'] = result

        output("checking for optional header files...", end='')

        result = results.get('have_headers', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            result =[]
            headers = ('net/if_dl.h', 'netash/ash.h',
                       'netatalk/at.h', 'netax25/ax25.h',
                       'neteconet/ec.h', 'netipx/ipx.h',
                       'netpacket/packet.h', 'netrose/rose.h',
                       'linux/irda.h', 'linux/atm.h',
                       'linux/llc.h', 'linux/tipc.h',
                       'linux/dn.h')

            for header in headers:
                testrig = """
                #include <sys/types.h>
                #include <sys/socket.h>
                #include <net/if.h>
                #include <%s>
                int main (void) { return 0; }
                """ % header

                if self.test_build(testrig, link=False):
                    result.append(header)

        if result:
            output("%s. %s" % (' '.join(result), cached))
            for header in result:
                macro = header.upper().replace('.', '_').replace('/', '_')
                self.compiler.define_macro('HAVE_%s' % macro, 1)
        else:
            output("none found. %s" % cached)

        optional_headers = result
        results['have_headers'] = result

        output("checking whether struct sockaddr has a length field...", end='')

        result = results.get('have_sockaddr_sa_len', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <net/if.h>

            int main (void) {
              struct sockaddr sa;
              sa.sa_len = 5;
              return 0;
            }
            """

            result = self.test_build(testrig)

        if result:
            output('yes. %s' % cached)
            self.compiler.define_macro('HAVE_SOCKADDR_SA_LEN', 1)
        else:
            output('no. %s' % cached)

        results['have_sockaddr_sa_len'] = result

        if not results['have_sockaddr_sa_len']:
            # GAK! On certain stupid platforms (Linux), there's no sa_len.
            # Macho Linux programmers apparently think that it's not needed,
            # however, unfortunately, getifaddrs() doesn't return the
            # lengths, because they're in the sa_len field on just about
            # everything but Linux.
            output("checking which sockaddr_xxx structs are defined...", end='')

            result = results.get('have_sockaddrs', None)
            if result is not None:
                cached = '(cached)'
            else:
                cached = ''

                if not os.path.exists(self.build_temp):
                    os.makedirs(self.build_temp)
                outname = os.path.join(self.build_temp, 'conftest4.out')
                self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)

                sockaddrs = ('at', 'ax25', 'dl', 'eon', 'in', 'in6',
                             'inarp', 'ipx', 'iso', 'ns', 'un', 'x25',
                             'rose', 'ash', 'ec', 'll', 'atmpvc', 'atmsvc',
                             'dn', 'irda', 'llc')
                result = []
                for sockaddr in sockaddrs:
                    testrig = """
                    #include <sys/types.h>
                    #include <sys/socket.h>
                    #include <sys/un.h>
                    #include <net/if.h>
                    #include <netinet/in.h>
                    %(includes)s

                    int main (void) {
                      struct sockaddr_%(sockaddr)s sa;
                      return 0;
                    }
                    """ % { 'includes': '\n'.join(["#include <%s>" % header
                                                   for header
                                                   in optional_headers]),
                            'sockaddr': sockaddr }

                    if self.test_build(testrig):
                        result.append(sockaddr)

            if result:
                output('%s. %s' % (' '.join(result), cached))
                for sockaddr in result:
                    self.compiler.define_macro('HAVE_SOCKADDR_%s' \
                                               % sockaddr.upper(), 1)
            else:
                output('none! %s' % cached)

            results['have_sockaddrs'] = result

        # Save the results to our config.cache file
        myfile = open(cache_file, 'wb')
        try:
            pickle.dump(results, myfile)
        finally:
            myfile.close()

# Don't bother detecting socket ioctls on Windows
if not getattr(sys, 'getwindowsversion', None):
    setuptools.command.build_ext.build_ext = my_build_ext

readme_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                           'README.rst')
long_desc = open(readme_path, 'r').read()

setup (name='netifaces',
       version=__version__,
       description="Portable network interface information.",
       license="MIT License",
       long_description=long_desc,
       author='Alastair Houghton',
       author_email='alastair@alastairs-place.net',
       url='http://alastairs-place.net/netifaces',
       classifiers=[
    'Development Status :: 4 - Beta',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Topic :: System :: Networking',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.5',
    'Programming Language :: Python :: 2.6',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    ],
       ext_modules=[iface_mod])
<commit_msg>Set the zip-safe flag.<commit_after>import setuptools
import os
import sys
import distutils.spawn
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.errors import *
import pickle

if sys.version_info[0] == 2:
    def output(*args, **kwargs):
        end = kwargs.get('end', '\n')
        f = kwargs.get('file', sys.stdout)
        f.write(' '.join(str(a) for a in args))
        f.write(end)
else:
    output = getattr(__builtins__, 'print')

__version__ = "0.10.0"

# Disable hard links, otherwise building distributions fails on OS X
try:
    del os.link
except:
    pass

# On Windows, we need ws2_32 and iphlpapi
if getattr(sys, 'getwindowsversion', None):
    libraries = ['ws2_32', 'iphlpapi']
    def_macros = [('WIN32', 1)]
else:
    mos = getattr(sys, 'platform', None)
    libraries = []
    if mos.startswith('sunos'):
        libraries = ['socket', 'nsl']
    def_macros = []

def_macros.append(("NETIFACES_VERSION", __version__))

iface_mod = Extension('netifaces', sources=['netifaces.c'],
                      libraries=libraries,
                      define_macros=def_macros)

#
#  There must be a better way to do this...
#
class my_build_ext(build_ext):
    def build_extensions(self):
        self.check_requirements()
        build_ext.build_extensions(self)

    def test_build(self, contents, link=True, execute=False, libraries=None,
                   include_dirs=None, library_dirs=None):
        name = os.path.join(self.build_temp, 'conftest-%s.c' % self.conftestidx)
        self.conftestidx += 1
        if os.path.exists(name):
            os.unlink(name)
        thefile = open(name, 'w')
        thefile.write(contents)
        thefile.close()

        sys.stdout.flush()
        sys.stderr.flush()
        mystdout = os.dup(1)
        mystderr = os.dup(2)
        result = True
        try:
            os.dup2(self.ctout, 1)
            os.dup2(self.ctout, 2)
            try:
                objects = self.compiler.compile([name],
                                                output_dir=self.build_temp,
                                                include_dirs=include_dirs,
                                                debug=self.debug)
                if link:
                    self.compiler.link_executable(objects,
                                                  'conftest',
                                                  output_dir=self.build_temp,
                                                  library_dirs=library_dirs,
                                                  libraries=libraries,
                                                  debug=self.debug)
                    if execute:
                        abspath = os.path.abspath(os.path.join(self.build_temp,
                                                               'conftest'))
                        pipe = os.popen(abspath, 'r')
                        result = pipe.read().strip()
                        status = pipe.close()
                        if status is None:
                            status = 0
                        if result == '':
                            result = True
                        if status != 0:
                            result = False

            finally:
                os.dup2(mystdout, 1)
                os.dup2(mystderr, 2)
        except CompileError:
            return False
        except DistutilsExecError:
            return False
        return result

    def check_requirements(self):
        # Load the cached config data from a previous run if possible; compiling
        # things to test for features is slow
        cache_file = os.path.join(self.build_temp, 'config.cache')
        if os.path.exists(cache_file):
            myfile = open(cache_file, 'rb')
            try:
                results = pickle.load(myfile)
            finally:
                myfile.close()
        else:
            results = {}

        self.conftestidx = 0

        output("checking for getifaddrs...", end='')

        result = results.get('have_getifaddrs', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            if not os.path.exists(self.build_temp):
                os.makedirs(self.build_temp)
            outname = os.path.join(self.build_temp, 'conftest.out')
            self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)
            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <ifaddrs.h>
            int main(void) {
              struct ifaddrs *addrs;
              int ret;
              ret = getifaddrs(&addrs);
              freeifaddrs (addrs);
              return 0;
            }
            """
            if self.test_build(testrig):
                result = True
            else:
                result = False

        if result:
            output("found. %s" % cached)
            self.compiler.define_macro('HAVE_GETIFADDRS', 1)
        else:
            output("not found. %s" % cached)

        results['have_getifaddrs'] = result

        output("checking for getnameinfo...", end='')

        result = results.get('have_getnameinfo', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            if not os.path.exists(self.build_temp):
                os.makedirs(self.build_temp)
            outname = os.path.join(self.build_temp, 'conftest2.out')
            self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)
            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <arpa/inet.h>
            #include <netdb.h>
            #include <stdlib.h>
            int main(void) {
              struct sockaddr_in sin;
              char buffer[256];
              int ret;

              sin.sin_family = AF_INET;
              sin.sin_port = 0;
              sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);

              ret = getnameinfo ((struct sockaddr *)&sin, sizeof (sin),
                                 buffer, sizeof (buffer),
                                 NULL, 0,
                                 NI_NUMERICHOST);

              return 0;
            }
            """
            if self.test_build(testrig,libraries=libraries):
                result = True
            else:
                result = False

        if result:
            output("found. %s" % cached)
            self.compiler.define_macro('HAVE_GETNAMEINFO', 1)
        else:
            output("not found. %s" % cached)

        results['have_getnameinfo'] = result

        if not results['have_getifaddrs']:
            output("checking for socket IOCTLs...", end='')

            result = results.get('have_socket_ioctls', None)
            if result is not None:
                cached = '(cached)'
            else:
                cached = ''

                if not os.path.exists(self.build_temp):
                    os.makedirs(self.build_temp)
                outname = os.path.join(self.build_temp, 'conftest3.out')
                self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)

                result = []
                ioctls = ('SIOCGIFCONF',
                          'SIOCGSIZIFCONF',
                          'SIOCGIFHWADDR',
                          'SIOCGIFADDR',
                          'SIOCGIFFLAGS',
                          'SIOCGIFDSTADDR',
                          'SIOCGIFBRDADDR',
                          'SIOCGIFNETMASK',
                          'SIOCGLIFNUM',
                          'SIOCGLIFCONF',
                          'SIOCGLIFFLAGS')
                added_includes = ""
                if mos.startswith('sunos'):
                    added_includes = """
                     #include <unistd.h>
                     #include <stropts.h>
                     #include <sys/sockio.h>
                    """

                for ioctl in ioctls:
                    testrig = """
                    #include <sys/types.h>
                    #include <sys/socket.h>
                    #include <sys/ioctl.h>
                    #include <net/if.h>
                    #include <netinet/in.h>
                    #include <arpa/inet.h>
                    %(addedinc)s
                    int main(void) {
                        int fd = socket (AF_INET, SOCK_DGRAM, IPPROTO_IP);
                        struct ifreq ifreq;

                        ioctl(fd, %(ioctl)s, &ifreq);

                        return 0;
                    }
                    """ % { 'ioctl': ioctl , 'addedinc': added_includes}

                    if self.test_build(testrig,libraries=libraries):
                        result.append(ioctl)

            if result:
                output("%r. %s" % (result, cached))
                for ioctl in result:
                    self.compiler.define_macro('HAVE_%s' % ioctl, 1)
                self.compiler.define_macro('HAVE_SOCKET_IOCTLS', 1)
            else:
                output("not found. %s" % cached)

            results['have_socket_ioctls'] = result

        output("checking for optional header files...", end='')

        result = results.get('have_headers', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            result =[]
            headers = ('net/if_dl.h', 'netash/ash.h',
                       'netatalk/at.h', 'netax25/ax25.h',
                       'neteconet/ec.h', 'netipx/ipx.h',
                       'netpacket/packet.h', 'netrose/rose.h',
                       'linux/irda.h', 'linux/atm.h',
                       'linux/llc.h', 'linux/tipc.h',
                       'linux/dn.h')

            for header in headers:
                testrig = """
                #include <sys/types.h>
                #include <sys/socket.h>
                #include <net/if.h>
                #include <%s>
                int main (void) { return 0; }
                """ % header

                if self.test_build(testrig, link=False):
                    result.append(header)

        if result:
            output("%s. %s" % (' '.join(result), cached))
            for header in result:
                macro = header.upper().replace('.', '_').replace('/', '_')
                self.compiler.define_macro('HAVE_%s' % macro, 1)
        else:
            output("none found. %s" % cached)

        optional_headers = result
        results['have_headers'] = result

        output("checking whether struct sockaddr has a length field...", end='')

        result = results.get('have_sockaddr_sa_len', None)
        if result is not None:
            cached = '(cached)'
        else:
            cached = ''

            testrig = """
            #include <sys/types.h>
            #include <sys/socket.h>
            #include <net/if.h>

            int main (void) {
              struct sockaddr sa;
              sa.sa_len = 5;
              return 0;
            }
            """

            result = self.test_build(testrig)

        if result:
            output('yes. %s' % cached)
            self.compiler.define_macro('HAVE_SOCKADDR_SA_LEN', 1)
        else:
            output('no. %s' % cached)

        results['have_sockaddr_sa_len'] = result

        if not results['have_sockaddr_sa_len']:
            # GAK! On certain stupid platforms (Linux), there's no sa_len.
            # Macho Linux programmers apparently think that it's not needed,
            # however, unfortunately, getifaddrs() doesn't return the
            # lengths, because they're in the sa_len field on just about
            # everything but Linux.
            output("checking which sockaddr_xxx structs are defined...", end='')

            result = results.get('have_sockaddrs', None)
            if result is not None:
                cached = '(cached)'
            else:
                cached = ''

                if not os.path.exists(self.build_temp):
                    os.makedirs(self.build_temp)
                outname = os.path.join(self.build_temp, 'conftest4.out')
                self.ctout = os.open(outname, os.O_RDWR | os.O_CREAT | os.O_TRUNC)

                sockaddrs = ('at', 'ax25', 'dl', 'eon', 'in', 'in6',
                             'inarp', 'ipx', 'iso', 'ns', 'un', 'x25',
                             'rose', 'ash', 'ec', 'll', 'atmpvc', 'atmsvc',
                             'dn', 'irda', 'llc')
                result = []
                for sockaddr in sockaddrs:
                    testrig = """
                    #include <sys/types.h>
                    #include <sys/socket.h>
                    #include <sys/un.h>
                    #include <net/if.h>
                    #include <netinet/in.h>
                    %(includes)s

                    int main (void) {
                      struct sockaddr_%(sockaddr)s sa;
                      return 0;
                    }
                    """ % { 'includes': '\n'.join(["#include <%s>" % header
                                                   for header
                                                   in optional_headers]),
                            'sockaddr': sockaddr }

                    if self.test_build(testrig):
                        result.append(sockaddr)

            if result:
                output('%s. %s' % (' '.join(result), cached))
                for sockaddr in result:
                    self.compiler.define_macro('HAVE_SOCKADDR_%s' \
                                               % sockaddr.upper(), 1)
            else:
                output('none! %s' % cached)

            results['have_sockaddrs'] = result

        # Save the results to our config.cache file
        myfile = open(cache_file, 'wb')
        try:
            pickle.dump(results, myfile)
        finally:
            myfile.close()

# Don't bother detecting socket ioctls on Windows
if not getattr(sys, 'getwindowsversion', None):
    setuptools.command.build_ext.build_ext = my_build_ext

readme_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                           'README.rst')
long_desc = open(readme_path, 'r').read()

setup (name='netifaces',
       version=__version__,
       zip_safe=True,
       description="Portable network interface information.",
       license="MIT License",
       long_description=long_desc,
       author='Alastair Houghton',
       author_email='alastair@alastairs-place.net',
       url='http://alastairs-place.net/netifaces',
       classifiers=[
    'Development Status :: 4 - Beta',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: MIT License',
    'Topic :: System :: Networking',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.5',
    'Programming Language :: Python :: 2.6',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    ],
       ext_modules=[iface_mod])
<|endoftext|>


<commit_before>from setuptools import setup

setup(
    name='pyuploadcare',
    version='0.18',
    description='UploadCare.com API library',
    author='Valentin Golev',
    author_email='v.golev@gmail.com',
    url='https://github.com/uploadcare/pyuploadcare',
    packages=['pyuploadcare', 'pyuploadcare.dj'],
    package_data={
        'pyuploadcare.dj': [
            'static/uploadcare/assets/uploaders/*.js',
        ]
    },
    entry_points={
        'console_scripts': [
            'ucare = pyuploadcare.ucare_cli:main',
        ],
    },
    install_requires=['requests>=1.0'],
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
)
<commit_msg>Add argparse to requirements in setup.py<commit_after># coding: utf-8
import sys

from setuptools import setup

PY_VERSION = sys.version_info[0], sys.version_info[1]

requirements = ['requests>=1.0']

if PY_VERSION == (2, 6):
    requirements.append('argparse')

setup(
    name='pyuploadcare',
    version='0.18',
    description='UploadCare.com API library',
    author='Valentin Golev',
    author_email='v.golev@gmail.com',
    url='https://github.com/uploadcare/pyuploadcare',
    packages=['pyuploadcare', 'pyuploadcare.dj'],
    package_data={
        'pyuploadcare.dj': [
            'static/uploadcare/assets/uploaders/*.js',
        ]
    },
    entry_points={
        'console_scripts': [
            'ucare = pyuploadcare.ucare_cli:main',
        ],
    },
    install_requires=requirements,
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
    ],
)
<|endoftext|>


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

import os
import sys
import time
from lxml import etree
from geom import *

class Osmxml(object):
    def __init__(self, filename, sequentialOutputMode=False, \
                 noUploadFalse=True, osmVersion=False, timestamp=False,\
                 significantDigits=9, roundingDigits=7):
        self.filename = filename
        self.sequentialOutputMode = sequentialOutputMode
        self.noUploadFalse = noUploadFalse
        self.significantDigits = significantDigits
        self.roundingDigits = roundingDigits

        if sequentialOutputMode:
            self.fileNode = open(filename + '_nodes', 'w')
            self.fileWay = open(filename + '_ways', 'w+')
            self.fileRelation = open(filename + '_relations', 'w+')
        else:
            self.fileNode = open(filename, 'w')
            self.fileWay = self.fileRelation = self.fileNode

        self.attributes = {}
        if osmVersion:
            self.attributes.update({'version' : '1'})
        if timestamp:
            self.attributes.update({'timestamp' : int(time.mktime(time.localtime()))})
        self.isPython2 = sys.version_info < (3, 0)
        self.outputHeader()

    def outputHeader(self):
        f = self.fileNode
        if self.noUploadFalse:
            f.write('<?xml version="1.0"?>\n<osm version="0.6" generator="uvmogr2osm">\n')
        else:
            f.write('<?xml version="1.0"?>\n<osm version="0.6" upload="false" generator="uvmogr2osm">\n')

    def outputNodes(self, nodes, featuresmap):
        f = self.fileNode
        for node in nodes:
            xmlattrs = {'visible': 'true', 'id': str(node.id), 'lat': str(node.y * 10 ** -self.significantDigits),
                        'lon': str(node.x * 10 ** -self.significantDigits)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('node', xmlattrs)

            if node in featuresmap:
                for (key, value) in featuresmap[node].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)
            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputWays(self, ways, featuresmap):
        f = self.fileWay
        for way in ways:
            xmlattrs = {'visible': 'true', 'id': str(way.id)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('way', xmlattrs)

            for node in way.points:
                nd = etree.Element('nd', {'ref': str(node.id)})
                xmlobject.append(nd)
            if way in featuresmap:
                for (key, value) in featuresmap[way].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)

            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputRelations(self, relations, featuresmap):
        f = self.fileRelation
        for relation in relations:
            xmlattrs = {'visible': 'true', 'id': str(relation.id)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('relation', xmlattrs)

            for (member, role) in relation.members:
                member = etree.Element('member', {'type': 'way', 'ref': str(member.id), 'role': role})
                xmlobject.append(member)

            tag = etree.Element('tag', {'k': 'type', 'v': 'multipolygon'})
            xmlobject.append(tag)
            if relation in featuresmap:
                for (key, value) in featuresmap[relation].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)

            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputFooter(self):
        f = self.fileRelation
        f.write('</osm>')

    def output(self, geometries, features):
        # First, set up a few data structures for optimization purposes
        nodes = [geom for geom in geometries if type(geom) == Point]
        ways = [geom for geom in geometries if type(geom) == Way]
        relations = [geom for geom in geometries if type(geom) == Relation]
        featuresmap = {feature.geometry: feature for feature in features}
        self.outputNodes(nodes, featuresmap)
        self.outputWays(ways, featuresmap)
        self.outputRelations(relations, featuresmap)

    def finish(self):
        node = self.fileNode
        way = self.fileWay
        relation = self.fileRelation
        limit = 50000000

        self.outputFooter()
        # merge separate files
        if self.sequentialOutputMode:
            way.seek(0)
            data = way.read(limit)
            while data:
                node.write(data)
                data = way.read(limit)
            way.close()
            relation.seek(0)
            data = relation.read(limit)
            while data:
                node.write(data)
                data = relation.read(limit)
            relation.close()
            os.rename(self.filename + '_nodes', self.filename)
            os.remove(self.filename + '_ways')
            os.remove(self.filename + '_relations')
        node.close()
<commit_msg>fix wrong timestamp.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import time
from lxml import etree
from geom import *
from datetime import datetime

class Osmxml(object):
    def __init__(self, filename, sequentialOutputMode=False, \
                 noUploadFalse=True, osmVersion=False, timestamp=False,\
                 significantDigits=9, roundingDigits=7):
        self.filename = filename
        self.sequentialOutputMode = sequentialOutputMode
        self.noUploadFalse = noUploadFalse
        self.significantDigits = significantDigits
        self.roundingDigits = roundingDigits

        if sequentialOutputMode:
            self.fileNode = open(filename + '_nodes', 'w')
            self.fileWay = open(filename + '_ways', 'w+')
            self.fileRelation = open(filename + '_relations', 'w+')
        else:
            self.fileNode = open(filename, 'w')
            self.fileWay = self.fileRelation = self.fileNode

        self.attributes = {}
        if osmVersion:
            self.attributes.update({'version' : '1'})
        if timestamp:
            self.attributes.update({'timestamp' : datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')})
        self.isPython2 = sys.version_info < (3, 0)
        self.outputHeader()

    def outputHeader(self):
        f = self.fileNode
        if self.noUploadFalse:
            f.write('<?xml version="1.0"?>\n<osm version="0.6" generator="uvmogr2osm">\n')
        else:
            f.write('<?xml version="1.0"?>\n<osm version="0.6" upload="false" generator="uvmogr2osm">\n')

    def outputNodes(self, nodes, featuresmap):
        f = self.fileNode
        for node in nodes:
            xmlattrs = {'visible': 'true', 'id': str(node.id), 'lat': str(node.y * 10 ** -self.significantDigits),
                        'lon': str(node.x * 10 ** -self.significantDigits)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('node', xmlattrs)

            if node in featuresmap:
                for (key, value) in featuresmap[node].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)
            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputWays(self, ways, featuresmap):
        f = self.fileWay
        for way in ways:
            xmlattrs = {'visible': 'true', 'id': str(way.id)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('way', xmlattrs)

            for node in way.points:
                nd = etree.Element('nd', {'ref': str(node.id)})
                xmlobject.append(nd)
            if way in featuresmap:
                for (key, value) in featuresmap[way].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)

            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputRelations(self, relations, featuresmap):
        f = self.fileRelation
        for relation in relations:
            xmlattrs = {'visible': 'true', 'id': str(relation.id)}
            xmlattrs.update(self.attributes)

            xmlobject = etree.Element('relation', xmlattrs)

            for (member, role) in relation.members:
                member = etree.Element('member', {'type': 'way', 'ref': str(member.id), 'role': role})
                xmlobject.append(member)

            tag = etree.Element('tag', {'k': 'type', 'v': 'multipolygon'})
            xmlobject.append(tag)
            if relation in featuresmap:
                for (key, value) in featuresmap[relation].tags.items():
                    tag = etree.Element('tag', {'k': key, 'v': value})
                    xmlobject.append(tag)

            if self.isPython2:
                f.write(etree.tostring(xmlobject))
            else:
                f.write(etree.tostring(xmlobject, encoding='unicode'))
            f.write('\n')

    def outputFooter(self):
        f = self.fileRelation
        f.write('</osm>')

    def output(self, geometries, features):
        # First, set up a few data structures for optimization purposes
        nodes = [geom for geom in geometries if type(geom) == Point]
        ways = [geom for geom in geometries if type(geom) == Way]
        relations = [geom for geom in geometries if type(geom) == Relation]
        featuresmap = {feature.geometry: feature for feature in features}
        self.outputNodes(nodes, featuresmap)
        self.outputWays(ways, featuresmap)
        self.outputRelations(relations, featuresmap)

    def finish(self):
        node = self.fileNode
        way = self.fileWay
        relation = self.fileRelation
        limit = 50000000

        self.outputFooter()
        # merge separate files
        if self.sequentialOutputMode:
            way.seek(0)
            data = way.read(limit)
            while data:
                node.write(data)
                data = way.read(limit)
            way.close()
            relation.seek(0)
            data = relation.read(limit)
            while data:
                node.write(data)
                data = relation.read(limit)
            relation.close()
            os.rename(self.filename + '_nodes', self.filename)
            os.remove(self.filename + '_ways')
            os.remove(self.filename + '_relations')
        node.close()
<|endoftext|>


<commit_before>import re
import sys

from io import open

try:
    from setuptools import setup, find_packages

except ImportError:
    print('''
Error: pyinfra needs setuptools in order to install:

using pip: pip install setuptools
using a package manager (apt, yum, etc), normally named: python-setuptools
    '''.strip())

    sys.exit(1)

INSTALL_REQUIRES = (
    'gevent>=1.5',
    'paramiko>=2.2,<3',  # 2.2 (2017) adds Ed25519Key
    'click>2',
    'colorama<1',  # Windows color support for click
    'jinja2>2,<3',
    'python-dateutil>2,<3',
    'six>1,<2',
    'setuptools',
    'configparser',
    'pywinrm',
    'distro==1.5.0',
)

ANSIBLE_REQUIRES = (  # extras for parsing Ansible inventory
    'pyyaml',
)

TEST_REQUIRES = ANSIBLE_REQUIRES + (
    # Unit testing
    'pytest==4.6.6',
    'pytest-cov==2.8.1',
    'coverage==4.5.4',
    'mock==3.0.5',
    'codecov==2.1.8',

    # Linting
    'flake8==3.8.3',
    'flake8-commas==2.0.0',
    'flake8-quotes==3.2.0',
    'flake8-import-order==0.18.1',
)

DOCS_REQUIRES = (
    'pyinfra-guzzle_sphinx_theme==0.10',
    'recommonmark==0.5.0',
    'sphinx==2.2.1 ; python_version >= "3"',
)

DEV_REQUIRES = TEST_REQUIRES + DOCS_REQUIRES + (
    # Releasing
    'wheel',
    'twine',

    # Dev debugging
    'ipython',
    'ipdb==0.10.3',
    'ipdbplugin==1.4.5',

    # Lint spellchecking, dev only (don't fail CI)
    'flake8-spellcheck==0.12.1 ; python_version >= "3"',
)

def get_version_from_changelog():
    # Regex matching pattern followed by 3 numerical values separated by '.'
    pattern = re.compile(r'# v(?P<version>[0-9]+\.[0-9]+(\.[0-9]+(\.[a-z0-9]+)?)?)')

    with open('CHANGELOG.md', 'r') as fn:
        for line in fn.readlines():
            match = pattern.fullmatch(line.strip())
            if match:
                return ''.join(match.group('version'))
    raise RuntimeError('No version found in CHANGELOG.md')

def get_readme_contents():
    with open('README.md', 'r', encoding='utf-8') as f:
        return f.read()

if __name__ == '__main__':
    setup(
        version=get_version_from_changelog(),
        name='pyinfra',
        description='pyinfra automates/provisions/manages/deploys infrastructure.',
        long_description=get_readme_contents(),
        long_description_content_type='text/markdown',
        author='Nick / Fizzadar',
        author_email='pointlessrambler@gmail.com',
        license='MIT',
        url='https://pyinfra.com',
        project_urls={
            'Documentation': 'https://docs.pyinfra.com',
            'GitHub': 'https://github.com/Fizzadar/pyinfra',
        },
        packages=find_packages(exclude=['tests']),
        entry_points={
            'console_scripts': (
                'pyinfra=pyinfra_cli.__main__:execute_pyinfra',
            ),
            'pyinfra.connectors': [
                'ansible = pyinfra.api.connectors.ansible',
                'chroot = pyinfra.api.connectors.chroot',
                'docker = pyinfra.api.connectors.docker',
                'local = pyinfra.api.connectors.local',
                'mech = pyinfra.api.connectors.mech',
                'ssh = pyinfra.api.connectors.ssh',
                'dockerssh = pyinfra.api.connectors.dockerssh',
                'vagrant = pyinfra.api.connectors.vagrant',
                'winrm = pyinfra.api.connectors.winrm',
            ],
        },
        install_requires=INSTALL_REQUIRES,
        extras_require={
            'test': TEST_REQUIRES,
            'docs': DOCS_REQUIRES,
            'dev': DEV_REQUIRES,
            'ansible': ANSIBLE_REQUIRES,
        },
        include_package_data=True,
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: System Administrators',
            'Intended Audience :: Information Technology',
            'License :: OSI Approved :: MIT License',
            'Operating System :: OS Independent',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.5',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
            'Programming Language :: Python :: 3.9',
            'Topic :: System :: Systems Administration',
            'Topic :: System :: Installation/Setup',
            'Topic :: Utilities',
        ],
    )
<commit_msg>Don't use `re.fullmatch` as Python 3.4 only.<commit_after>import re
import sys

from io import open

try:
    from setuptools import setup, find_packages

except ImportError:
    print('''
Error: pyinfra needs setuptools in order to install:

using pip: pip install setuptools
using a package manager (apt, yum, etc), normally named: python-setuptools
    '''.strip())

    sys.exit(1)

INSTALL_REQUIRES = (
    'gevent>=1.5',
    'paramiko>=2.2,<3',  # 2.2 (2017) adds Ed25519Key
    'click>2',
    'colorama<1',  # Windows color support for click
    'jinja2>2,<3',
    'python-dateutil>2,<3',
    'six>1,<2',
    'setuptools',
    'configparser',
    'pywinrm',
    'distro==1.5.0',
)

ANSIBLE_REQUIRES = (  # extras for parsing Ansible inventory
    'pyyaml',
)

TEST_REQUIRES = ANSIBLE_REQUIRES + (
    # Unit testing
    'pytest==4.6.6',
    'pytest-cov==2.8.1',
    'coverage==4.5.4',
    'mock==3.0.5',
    'codecov==2.1.8',

    # Linting
    'flake8==3.8.3',
    'flake8-commas==2.0.0',
    'flake8-quotes==3.2.0',
    'flake8-import-order==0.18.1',
)

DOCS_REQUIRES = (
    'pyinfra-guzzle_sphinx_theme==0.10',
    'recommonmark==0.5.0',
    'sphinx==2.2.1 ; python_version >= "3"',
)

DEV_REQUIRES = TEST_REQUIRES + DOCS_REQUIRES + (
    # Releasing
    'wheel',
    'twine',

    # Dev debugging
    'ipython',
    'ipdb==0.10.3',
    'ipdbplugin==1.4.5',

    # Lint spellchecking, dev only (don't fail CI)
    'flake8-spellcheck==0.12.1 ; python_version >= "3"',
)

def get_version_from_changelog():
    # Regex matching pattern followed by 3 numerical values separated by '.'
    pattern = re.compile(r'^# v(?P<version>[0-9]+\.[0-9]+(\.[0-9]+(\.[a-z0-9]+)?)?)$')

    with open('CHANGELOG.md', 'r') as fn:
        for line in fn.readlines():
            match = pattern.match(line.strip())
            if match:
                return ''.join(match.group('version'))
    raise RuntimeError('No version found in CHANGELOG.md')

def get_readme_contents():
    with open('README.md', 'r', encoding='utf-8') as f:
        return f.read()

if __name__ == '__main__':
    setup(
        version=get_version_from_changelog(),
        name='pyinfra',
        description='pyinfra automates/provisions/manages/deploys infrastructure.',
        long_description=get_readme_contents(),
        long_description_content_type='text/markdown',
        author='Nick / Fizzadar',
        author_email='pointlessrambler@gmail.com',
        license='MIT',
        url='https://pyinfra.com',
        project_urls={
            'Documentation': 'https://docs.pyinfra.com',
            'GitHub': 'https://github.com/Fizzadar/pyinfra',
        },
        packages=find_packages(exclude=['tests']),
        entry_points={
            'console_scripts': (
                'pyinfra=pyinfra_cli.__main__:execute_pyinfra',
            ),
            'pyinfra.connectors': [
                'ansible = pyinfra.api.connectors.ansible',
                'chroot = pyinfra.api.connectors.chroot',
                'docker = pyinfra.api.connectors.docker',
                'local = pyinfra.api.connectors.local',
                'mech = pyinfra.api.connectors.mech',
                'ssh = pyinfra.api.connectors.ssh',
                'dockerssh = pyinfra.api.connectors.dockerssh',
                'vagrant = pyinfra.api.connectors.vagrant',
                'winrm = pyinfra.api.connectors.winrm',
            ],
        },
        install_requires=INSTALL_REQUIRES,
        extras_require={
            'test': TEST_REQUIRES,
            'docs': DOCS_REQUIRES,
            'dev': DEV_REQUIRES,
            'ansible': ANSIBLE_REQUIRES,
        },
        include_package_data=True,
        classifiers=[
            'Development Status :: 5 - Production/Stable',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'Intended Audience :: System Administrators',
            'Intended Audience :: Information Technology',
            'License :: OSI Approved :: MIT License',
            'Operating System :: OS Independent',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.5',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
            'Programming Language :: Python :: 3.9',
            'Topic :: System :: Systems Administration',
            'Topic :: System :: Installation/Setup',
            'Topic :: Utilities',
        ],
    )
<|endoftext|>


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

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 :: Internet :: WWW/HTTP :: Dynamic Content',
    'Topic :: Software Development',
    'Topic :: Software Development :: Libraries :: Application Frameworks',
]

setup(
    author="Patrick Lauber",
    author_email="digi@treepy.com",
    name='django-cms',
    version=cms.__version__,
    description='An Advanced Django CMS',
    long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(),
    url='https://www.django-cms.org/',
    license='BSD License',
    platforms=['OS Independent'],
    classifiers=CLASSIFIERS,
    install_requires=[
        'Django>=1.3.1,<1.5',
        'django-classy-tags>=0.3.4.1',
        'south>=0.7.2',
        'html5lib',
        'django-mptt==0.5.2',
        'django-sekizai>=0.6.1',
    ],
    tests_require=[
        'django-reversion==1.6',
        'Pillow==1.7.7',
        'Sphinx==1.1.3',
        'Jinja2==2.6',
        'Pygments==1.5',

    ],
    packages=find_packages(exclude=["project","project.*"]),
    include_package_data=True,
    zip_safe = False,
    test_suite = 'runtests.main',
)
<commit_msg>laxed the required mptt version a bit, we now support >=0.5.1, <0.6<commit_after>from setuptools import setup, find_packages
import os
import cms

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 :: Internet :: WWW/HTTP :: Dynamic Content',
    'Topic :: Software Development',
    'Topic :: Software Development :: Libraries :: Application Frameworks',
]

setup(
    author="Patrick Lauber",
    author_email="digi@treepy.com",
    name='django-cms',
    version=cms.__version__,
    description='An Advanced Django CMS',
    long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(),
    url='https://www.django-cms.org/',
    license='BSD License',
    platforms=['OS Independent'],
    classifiers=CLASSIFIERS,
    install_requires=[
        'Django>=1.3.1,<1.5',
        'django-classy-tags>=0.3.4.1',
        'south>=0.7.2',
        'html5lib',
        'django-mptt>=0.5.1,<0.6',
        'django-sekizai>=0.6.1',
    ],
    tests_require=[
        'django-reversion==1.6',
        'Pillow==1.7.7',
        'Sphinx==1.1.3',
        'Jinja2==2.6',
        'Pygments==1.5',

    ],
    packages=find_packages(exclude=["project","project.*"]),
    include_package_data=True,
    zip_safe = False,
    test_suite = 'runtests.main',
)
<|endoftext|>


<commit_before>from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys

class osx_install_data(install_data):
    # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
    # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix
    # for this in distutils.command.install_data#306. It fixes install_lib but not
    # install_data, which is why we roll our own install_data class.

    def finalize_options(self):
        # By the time finalize_options is called, install.install_lib is set to the
        # fixed directory, so we set the installdir to install_lib. The
        # install_data class uses ('install_data', 'install_dir') instead.
        self.set_undefined_options('install', ('install_lib', 'install_dir'))
        install_data.finalize_options(self)

if sys.platform == "darwin":
    cmdclasses = {'install_data': osx_install_data}
else:
    cmdclasses = {'install_data': install_data}

def fullsplit(path, result=None):
    """
    Split a pathname into components (the opposite of os.path.join) in a
    platform-neutral way.
    """
    if result is None:
        result = []
    head, tail = os.path.split(path)
    if head == '':
        return [tail] + result
    if head == path:
        return result
    return fullsplit(head, [tail] + result)

# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

# 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)
django_dir = 'django'

for dirpath, dirnames, filenames in os.walk(django_dir):
    # Ignore dirnames that start with '.'
    for i, dirname in enumerate(dirnames):
        if dirname.startswith('.'): del dirnames[i]
    if '__init__.py' in filenames:
        packages.append('.'.join(fullsplit(dirpath)))
    elif filenames:
        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])

# Small hack for working with bdist_wininst.
# See http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':
    for file_info in data_files:
        file_info[0] = '\\PURELIB\\%s' % file_info[0]

# Dynamically calculate the version based on django.VERSION.
version = __import__('django').get_version()
if u'SVN' in version:
    version = ' '.join(version.split(' ')[:-1])

setup(
    name = "Django",
    version = version.replace(' ', '-'),
    url = 'http://www.djangoproject.com/',
    author = 'Django Software Foundation',
    author_email = 'foundation@djangoproject.com',
    description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
    download_url = 'http://media.djangoproject.com/releases/1.2/Django-1.2.tar.gz',
    packages = packages,
    cmdclass = cmdclasses,
    data_files = data_files,
    scripts = ['django/bin/django-admin.py'],
    classifiers = ['Development Status :: 4 - Beta',
                   'Environment :: Web Environment',
                   'Framework :: Django',
                   'Intended Audience :: Developers',
                   'License :: OSI Approved :: BSD License',
                   'Operating System :: OS Independent',
                   'Programming Language :: Python',
                   'Topic :: Internet :: WWW/HTTP',
                   'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
                   'Topic :: Internet :: WWW/HTTP :: WSGI',
                   'Topic :: Software Development :: Libraries :: Application Frameworks',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                   ],
)
<commit_msg>Flip PyPI classifier from beta to stable.<commit_after>from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys

class osx_install_data(install_data):
    # On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
    # which is wrong. Python 2.5 supplied with MacOS 10.5 has an Apple-specific fix
    # for this in distutils.command.install_data#306. It fixes install_lib but not
    # install_data, which is why we roll our own install_data class.

    def finalize_options(self):
        # By the time finalize_options is called, install.install_lib is set to the
        # fixed directory, so we set the installdir to install_lib. The
        # install_data class uses ('install_data', 'install_dir') instead.
        self.set_undefined_options('install', ('install_lib', 'install_dir'))
        install_data.finalize_options(self)

if sys.platform == "darwin":
    cmdclasses = {'install_data': osx_install_data}
else:
    cmdclasses = {'install_data': install_data}

def fullsplit(path, result=None):
    """
    Split a pathname into components (the opposite of os.path.join) in a
    platform-neutral way.
    """
    if result is None:
        result = []
    head, tail = os.path.split(path)
    if head == '':
        return [tail] + result
    if head == path:
        return result
    return fullsplit(head, [tail] + result)

# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
    scheme['data'] = scheme['purelib']

# 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)
django_dir = 'django'

for dirpath, dirnames, filenames in os.walk(django_dir):
    # Ignore dirnames that start with '.'
    for i, dirname in enumerate(dirnames):
        if dirname.startswith('.'): del dirnames[i]
    if '__init__.py' in filenames:
        packages.append('.'.join(fullsplit(dirpath)))
    elif filenames:
        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])

# Small hack for working with bdist_wininst.
# See http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':
    for file_info in data_files:
        file_info[0] = '\\PURELIB\\%s' % file_info[0]

# Dynamically calculate the version based on django.VERSION.
version = __import__('django').get_version()
if u'SVN' in version:
    version = ' '.join(version.split(' ')[:-1])

setup(
    name = "Django",
    version = version.replace(' ', '-'),
    url = 'http://www.djangoproject.com/',
    author = 'Django Software Foundation',
    author_email = 'foundation@djangoproject.com',
    description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
    download_url = 'http://media.djangoproject.com/releases/1.2/Django-1.2.tar.gz',
    packages = packages,
    cmdclass = cmdclasses,
    data_files = data_files,
    scripts = ['django/bin/django-admin.py'],
    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 :: Internet :: WWW/HTTP',
                   'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
                   'Topic :: Internet :: WWW/HTTP :: WSGI',
                   'Topic :: Software Development :: Libraries :: Application Frameworks',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                   ],
)
<|endoftext|>


<commit_before>#!/usr/bin/python

from distutils.core import setup

setup(name='Feedme',
      version='1.0',
      description='Rss Podcast Tracker',
      author='Forrest Alvarez',
      py_modules=['feedme'],
      install_require = ['flask', 'feedstail', 'Flask-OAuth'],
     )
<commit_msg>Add pymad to setup<commit_after>#!/usr/bin/python

from distutils.core import setup

setup(name='Feedme',
      version='1.0',
      description='Rss Podcast Tracker',
      author='Forrest Alvarez',
      py_modules=['feedme'],
      install_require = ['flask', 'feedstail', 'Flask-OAuth', 'pymad'],
     )
<|endoftext|>


<commit_before>import sys
import os

try:
    from setuptools import setup, find_packages
except ImportError:
    from distutils.core import setup
import pkg_resources

# Shortcut for building/publishing to Pypi
if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist bdist_wheel upload')
    sys.exit()

# For making things look nice on pypi:
try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError, RuntimeError):
    long_description = 'Tool for annotating patterns of genetic inheritance in Variant Call Format (VCF) files.'

setup(name='genmod',
    version='3.4.4',
    description='Annotate genetic inheritance models in variant files',
    author = 'Mans Magnusson',
    author_email = 'mans.magnusson@scilifelab.se',
    url = 'http://github.com/moonso/genmod',
    license = 'MIT License',
    install_requires=[
        'ped_parser >= 1.6.2',
        'pytabix',
        'pytest',
        'interval_tree >= 0.3.2',
        'click',
        'configobj',
        'intervaltree',
        'extract_vcf >= 0.4.2'
    ],
    packages=find_packages(
        exclude=('tests*', 'docs', 'examples', 'configs')
    ),
    package_data = {
        'genmod': ['annotations/*.db']
    },
    entry_points= { "console_scripts" : [
        "genmod = genmod.commands.run_genmod:cli",
        ]
    },
    keywords = ['inheritance', 'vcf', 'variants'],
    classifiers = [
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Unix",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Bio-Informatics",
    ],
    long_description = long_description,
)<commit_msg>Bumped version to 3.4.5<commit_after>import sys
import os

try:
    from setuptools import setup, find_packages
except ImportError:
    from distutils.core import setup
import pkg_resources

# Shortcut for building/publishing to Pypi
if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist bdist_wheel upload')
    sys.exit()

# For making things look nice on pypi:
try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError, RuntimeError):
    long_description = 'Tool for annotating patterns of genetic inheritance in Variant Call Format (VCF) files.'

setup(name='genmod',
    version='3.4.5',
    description='Annotate genetic inheritance models in variant files',
    author = 'Mans Magnusson',
    author_email = 'mans.magnusson@scilifelab.se',
    url = 'http://github.com/moonso/genmod',
    license = 'MIT License',
    install_requires=[
        'ped_parser >= 1.6.2',
        'pytabix',
        'pytest',
        'interval_tree >= 0.3.2',
        'click',
        'configobj',
        'intervaltree',
        'extract_vcf >= 0.4.2'
    ],
    packages=find_packages(
        exclude=('tests*', 'docs', 'examples', 'configs')
    ),
    package_data = {
        'genmod': ['annotations/*.db']
    },
    entry_points= { "console_scripts" : [
        "genmod = genmod.commands.run_genmod:cli",
        ]
    },
    keywords = ['inheritance', 'vcf', 'variants'],
    classifiers = [
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Unix",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Bio-Informatics",
    ],
    long_description = long_description,
)<|endoftext|>