<commit_before>"""
blowdrycss setup module.

Repository: https://github.com/nueverest/blowdrycss
Docs: http://blowdrycss.readthedocs.org/en/latest/index.html

setup.py references:
https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/
http://peterdowns.com/posts/first-time-with-pypi.html
https://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/

If the reStructuredText for the long_description does not turn out correctly, then test it here:
http://rst.ninjs.org

Setup Guide: https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#register-your-project

Steps:
pip install wheel
pip install twine

Delete the old .egg-info, build, and dist from the project root.

unittest reference: https://docs.python.org/2/library/unittest.html
python -m unittest discover -s blowdrycss -p "test_*.py"
python setup.py clean --all
python setup.py sdist bdist bdist_wheel
python setup.py test

Test it to see if it works

Activate a test virtualenv.
pip freeze                  # ensure blowdrycss is not already installed.
pip uninstall blowdrycss    # uninstall if it is already installed.
python setup.py install     # install the latest
blowdrycss                  # run it

[If it is the first time, then do this otherwise skip to next step.]
Go here: https://pypi.python.org/pypi?%3Aaction=submit_form
Choose Option 2: Upload PKG-INFO
Click "Add Package Info"

Create a new folder in ``build_archive`` named after the current version number.
Copy the new egg, build, and dist.

Back to the command line run:
twine upload dist/*

"""

# python 2.7
from __future__ import unicode_literals
from io import open
# builtins
from setuptools import setup, find_packages     # Always prefer setuptools over distutils

__author__ = 'chad nelson'
__project__ = 'blowdrycss'

# Get readme.rst from sphinx docs.
try:
    with open('readme.rst', encoding='utf-8') as f:
        long_description = f.read()
except (IOError, ImportError):
    # default description
    long_description = 'Rapid styling tool used to auto-generate DRY CSS files from encoded class selectors.'

# Get current version number.
version = {}
with open('version.py') as _file:
    exec(_file.read(), version)

setup(
    name='blowdrycss',

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

    description='The revolutionary CSS compiler',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/nueverest/blowdrycss',
    download_url='https://github.com/nueverest/blowdrycss/archive/master.zip',

    # Author details
    author=version['__author__'],
    author_email='nu.everest@gmail.com',

    # License
    license='MIT',

    # Classifier Reference: https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 3 - Alpha',                  # 3 - Alpha, 4 - Beta, 5 - Production/Stable
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Natural Language :: English',
        'Operating System :: OS Independent',

        # Topics
        'Topic :: Artistic Software',
        'Topic :: Internet',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: Site Management',
        'Topic :: Software Development',
        'Topic :: Software Development :: Build Tools',
        'Topic :: Software Development :: Code Generators',
        'Topic :: Software Development :: Compilers',
        'Topic :: Software Development :: Pre-processors',
        'Topic :: Text Processing',
        'Topic :: Text Processing :: Filters',
        'Topic :: Text Processing :: General',
        'Topic :: Text Processing :: Markup',
        'Topic :: Text Processing :: Markup :: HTML',
        'Topic :: Utilities',

        # License
        'License :: OSI Approved :: MIT License',

        # Python version support.
        'Programming Language :: Python :: 2',
        # 'Programming Language :: Python :: 2.6',  # Not compatible with cssutils, pypandoc, or sphinx
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    # What does your project relate to?
    keywords=(
        'blowdry blowdrycss css compiler pre-compiler pre-processor generator dry cascading style sheets html ' +
        'encoded class selector parser optimizer internet'
    ),

    # Packages - reference: https://pythonhosted.org/setuptools/setuptools.html#using-find-packages
    #package_dir={'': 'blowdrycss'},
    #packages=find_packages('blowdrycss', exclude=['*.settings', '*.settings.*', 'settings.*', 'settings']),
    #packages=find_packages(exclude=['*.settings']),   # THIS ONE WORKED BUT IS NO LONGER NEEDED
    packages=find_packages(),

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

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

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install blowdrycss -e .[auto_save, docs, testing]
    extras_require={
        'auto_save': ['watchdog>=0.8.3', ],
        'docs': ['sphinx>=1.3.3', ],
        'testing': ['coverage>=4.0.2', ],
        'development': [
            'watchdog>=0.8.3',
            'sphinx>=1.3.3',
            'unittest', 'coverage>=4.0.2',
            'wheel>=0.26.0', 'twine>=1.6.5',
        ],
    },

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

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

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    entry_points={
        'console_scripts': [
            'blowdrycss=blowdrycss.blowdry:main',
        ],
    },

    # unit_tests
    test_suite="blowdrycss.unit_tests",
    tests_require=['coverage', ],
)
<commit_msg>Expanded setup.py documentation.<commit_after>"""
blowdrycss setup module.

Repository: https://github.com/nueverest/blowdrycss
Docs: http://blowdrycss.readthedocs.org/en/latest/index.html

setup.py references:
https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/
http://peterdowns.com/posts/first-time-with-pypi.html
https://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/

If the reStructuredText for the long_description does not turn out correctly, then test it here:
http://rst.ninjs.org

Setup Guide: https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#register-your-project

Steps:
pip install wheel
pip install twine

Delete the old .egg-info, build, and dist from the project root.

Activate a test virtualenv.
unittest reference: https://docs.python.org/2/library/unittest.html
python -m unittest discover -s blowdrycss -p "test_*.py"
python setup.py clean --all
python setup.py sdist bdist bdist_wheel
python setup.py test

Test it to see if it works

pip freeze                  # ensure blowdrycss is not already installed.
pip uninstall blowdrycss    # uninstall if it is already installed.
python setup.py install     # install the latest
blowdrycss                  # run it

[If it is the first time, then do this otherwise skip to next step.]
Reference: `How to setup a .pypirc file <http://stackoverflow.com/a/35087459/1783439>`__.

Create a file named `.pypirc` in your home directory.

On Linux, OS X, or Unix: `~/.pypirc`
On Windows (Typically): `C:\Users\USERNAME\.pypirc`

Contents of `.pypirc` ::

    [distutils]
    index-servers =
        pypi
        pypitest

    [pypitest]
    repository = https://testpypi.python.org/pypi
    username = <your user name goes here>
    password = <your password goes here>

    [pypi]
    repository = https://pypi.python.org/pypi
    username = <your user name goes here>
    password = <your password goes here>

Create a new folder inside of the ``archive`` folder named after the current version number
e.g. `blowdrycss\archive\0.1.1`.
Copy the new egg, build, and dist into this new folder.

[Test on testPyPi First.]
python setup.py register -r pypitest

Complete testing on testPyPi.

Back at the command line run (to upload to official PyPi):
twine upload dist/*

[Supplemental: manual registration how to]
testpypi here: https://testpypi.python.org/pypi?%3Aaction=submit_form
pypi here: https://pypi.python.org/pypi?%3Aaction=submit_form

"""

# python 2.7
from __future__ import unicode_literals
from io import open
# builtins
from setuptools import setup, find_packages     # Always prefer setuptools over distutils

__author__ = 'chad nelson'
__project__ = 'blowdrycss'

# Get readme.rst from sphinx docs.
try:
    with open('readme.rst', encoding='utf-8') as f:
        long_description = f.read()
except (IOError, ImportError):
    # default description
    long_description = 'Rapid styling tool used to auto-generate DRY CSS files from encoded class selectors.'

# Get current version number.
version = {}
with open('version.py') as _file:
    exec(_file.read(), version)

setup(
    name='blowdrycss',

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

    description='The revolutionary CSS compiler',
    long_description=long_description,

    # The project's main homepage.
    url='https://github.com/nueverest/blowdrycss',
    download_url='https://github.com/nueverest/blowdrycss/archive/master.zip',

    # Author details
    author=version['__author__'],
    author_email='nu.everest@gmail.com',

    # License
    license='MIT',

    # Classifier Reference: https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 3 - Alpha',                  # 3 - Alpha, 4 - Beta, 5 - Production/Stable
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Natural Language :: English',
        'Operating System :: OS Independent',

        # Topics
        'Topic :: Artistic Software',
        'Topic :: Internet',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Internet :: WWW/HTTP :: Site Management',
        'Topic :: Software Development',
        'Topic :: Software Development :: Build Tools',
        'Topic :: Software Development :: Code Generators',
        'Topic :: Software Development :: Compilers',
        'Topic :: Software Development :: Pre-processors',
        'Topic :: Text Processing',
        'Topic :: Text Processing :: Filters',
        'Topic :: Text Processing :: General',
        'Topic :: Text Processing :: Markup',
        'Topic :: Text Processing :: Markup :: HTML',
        'Topic :: Utilities',

        # License
        'License :: OSI Approved :: MIT License',

        # Python version support.
        'Programming Language :: Python :: 2',
        # 'Programming Language :: Python :: 2.6',  # Not compatible with cssutils, pypandoc, or sphinx
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    # What does your project relate to?
    keywords=(
        'blowdry blowdrycss css compiler pre-compiler pre-processor generator dry cascading style sheets html ' +
        'encoded class selector parser optimizer internet'
    ),

    # Packages - reference: https://pythonhosted.org/setuptools/setuptools.html#using-find-packages
    #package_dir={'': 'blowdrycss'},
    #packages=find_packages('blowdrycss', exclude=['*.settings', '*.settings.*', 'settings.*', 'settings']),
    #packages=find_packages(exclude=['*.settings']),   # THIS ONE WORKED BUT IS NO LONGER NEEDED
    packages=find_packages(),

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

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

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install blowdrycss -e .[auto_save, docs, testing]
    extras_require={
        'auto_save': ['watchdog>=0.8.3', ],
        'docs': ['sphinx>=1.3.3', ],
        'testing': ['coverage>=4.0.2', ],
        'development': [
            'watchdog>=0.8.3',
            'sphinx>=1.3.3',
            'unittest', 'coverage>=4.0.2',
            'wheel>=0.26.0', 'twine>=1.6.5',
        ],
    },

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

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

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    entry_points={
        'console_scripts': [
            'blowdrycss=blowdrycss.blowdry:main',
        ],
    },

    # unit_tests
    test_suite="blowdrycss.unit_tests",
    tests_require=['coverage', ],
)
<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='aio-pika',
    version='0.5.1',
    author="Dmitry Orlov <me@mosquito.su>",
    author_email="me@mosquito.su",
    license="Apache Software License",
    description="Wrapper for the PIKA for asyncio and humans.",
    long_description=open("README.rst").read(),
    platforms="all",
    classifiers=(
        'License :: OSI Approved :: Apache Software License',
        'Topic :: Internet',
        'Topic :: Software Development',
        'Topic :: Software Development :: Libraries',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: MacOS',
        'Operating System :: POSIX',
        'Operating System :: Microsoft',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
    ),
    packages=find_packages(exclude=['tests']),
    install_requires=[
        'asyncio',
        'shortuuid',
        'pika<0.11',
        'slimurl>=0.7.6',
    ],
)
<commit_msg>[fix] bump<commit_after>from setuptools import setup, find_packages

setup(
    name='aio-pika',
    version='0.5.2',
    author="Dmitry Orlov <me@mosquito.su>",
    author_email="me@mosquito.su",
    license="Apache Software License",
    description="Wrapper for the PIKA for asyncio and humans.",
    long_description=open("README.rst").read(),
    platforms="all",
    classifiers=(
        'License :: OSI Approved :: Apache Software License',
        'Topic :: Internet',
        'Topic :: Software Development',
        'Topic :: Software Development :: Libraries',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: MacOS',
        'Operating System :: POSIX',
        'Operating System :: Microsoft',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
    ),
    packages=find_packages(exclude=['tests']),
    install_requires=[
        'asyncio',
        'shortuuid',
        'pika<0.11',
        'slimurl>=0.7.6',
    ],
)
<|endoftext|>


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

from setuptools import setup, find_packages
import os

def _read(fn):
    path = os.path.join(os.path.dirname(__file__), fn)
    return open(path).read()

setup(
    name='spotify-ripper',
    version='2.2.5',
    packages=find_packages(exclude=["tests"]),
    scripts=['spotify_ripper/main.py'],
    include_package_data=True,
    zip_safe=False,

    # Executable
    entry_points={
        'console_scripts': [
            'spotify-ripper = main:main',
        ],
    },

    # Additional data
    package_data={
        '': ['README.rst', 'LICENCE']
    },

    # Requirements
    install_requires=[
        'pyspotify==2.0.0b4',
        'colorama>=0.3.3',
        'mutagen==1.29',
        'requests>=2.3.0',
        'schedule>=0.3.1',
    ],

    # Metadata
    author='James Newell',
    author_email='james.newell@gmail.com',
    description='a small ripper for Spotify that rips Spotify URIs '
                'to audio files',
    license='MIT',
    keywords="spotify ripper mp3 ogg vorbis flac opus acc mp4 m4a",
    url='https://github.com/jrnewell/spotify-ripper',
    download_url='https://github.com/jrnewell/spotify-ripper/tarball/2.2.5',
    classifiers=[
        'Topic :: Multimedia :: Sound/Audio',
        'Topic :: Multimedia :: Sound/Audio :: Capture/Recording',
        'License :: OSI Approved :: MIT License',
        'Environment :: Console',
        "Intended Audience :: Developers",
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],
    long_description=_read('README.rst'),
)
<commit_msg>bump version to 2.2.6<commit_after>#!/usr/bin/env python
# coding=utf-8

from setuptools import setup, find_packages
import os

def _read(fn):
    path = os.path.join(os.path.dirname(__file__), fn)
    return open(path).read()

setup(
    name='spotify-ripper',
    version='2.2.6',
    packages=find_packages(exclude=["tests"]),
    scripts=['spotify_ripper/main.py'],
    include_package_data=True,
    zip_safe=False,

    # Executable
    entry_points={
        'console_scripts': [
            'spotify-ripper = main:main',
        ],
    },

    # Additional data
    package_data={
        '': ['README.rst', 'LICENCE']
    },

    # Requirements
    install_requires=[
        'pyspotify==2.0.0b4',
        'colorama>=0.3.3',
        'mutagen==1.29',
        'requests>=2.3.0',
        'schedule>=0.3.1',
    ],

    # Metadata
    author='James Newell',
    author_email='james.newell@gmail.com',
    description='a small ripper for Spotify that rips Spotify URIs '
                'to audio files',
    license='MIT',
    keywords="spotify ripper mp3 ogg vorbis flac opus acc mp4 m4a",
    url='https://github.com/jrnewell/spotify-ripper',
    download_url='https://github.com/jrnewell/spotify-ripper/tarball/2.2.6',
    classifiers=[
        'Topic :: Multimedia :: Sound/Audio',
        'Topic :: Multimedia :: Sound/Audio :: Capture/Recording',
        'License :: OSI Approved :: MIT License',
        'Environment :: Console',
        "Intended Audience :: Developers",
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],
    long_description=_read('README.rst'),
)
<|endoftext|>


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

import os
from setuptools import setup

def read(*paths):
    """ read files """
    with open(os.path.join(*paths), 'r') as filename:
        return filename.read()

install_requires = read('requirements.txt').splitlines()
try:
    import argparse
except ImportError:
    install_requires.append('argparse')

setup(
    name="slacker-cli",
    version="0.2.7",
    description="Send messages to slack from command line",
    long_description=(read('README.rst')),
    url="https://github.com/juanpabloaj/slacker-cli",
    install_requires=install_requires,
    license='MIT',
    author="JuanPablo AJ",
    author_email="jpabloaj@gmail.com",
    packages=['slacker_cli'],
    test_suite="tests",
    entry_points={
        'console_scripts': [
            'slacker=slacker_cli:main',
        ],
    },
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4'
    ]
)
<commit_msg>bump to 0.3.0<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
from setuptools import setup

def read(*paths):
    """ read files """
    with open(os.path.join(*paths), 'r') as filename:
        return filename.read()

install_requires = read('requirements.txt').splitlines()
try:
    import argparse
except ImportError:
    install_requires.append('argparse')

setup(
    name="slacker-cli",
    version="0.3.0",
    description="Send messages to slack from command line",
    long_description=(read('README.rst')),
    url="https://github.com/juanpabloaj/slacker-cli",
    install_requires=install_requires,
    license='MIT',
    author="JuanPablo AJ",
    author_email="jpabloaj@gmail.com",
    packages=['slacker_cli'],
    test_suite="tests",
    entry_points={
        'console_scripts': [
            'slacker=slacker_cli:main',
        ],
    },
    classifiers=[
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4'
    ]
)
<|endoftext|>


<commit_before>"""Setup script for version_query package."""

import setup_boilerplate

class Package(setup_boilerplate.Package):

    """Package metadata."""

    name = 'version-query'
    description = 'Package version query toolkit for Python'
    download_url = 'https://github.com/mbdevpl/version-query'
    classifiers = [
        'Development Status :: 1 - Planning',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Natural Language :: English',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3 :: Only',
        'Topic :: Utilities']
    keywords = ['abstract syntax tree', 'ast', 'parser', 'xml']

if __name__ == '__main__':
    Package.setup()
<commit_msg>updated dev status<commit_after>"""Setup script for version_query package."""

import setup_boilerplate

class Package(setup_boilerplate.Package):

    """Package metadata."""

    name = 'version-query'
    description = 'Package version query toolkit for Python'
    download_url = 'https://github.com/mbdevpl/version-query'
    classifiers = [
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Natural Language :: English',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3 :: Only',
        'Topic :: Utilities']
    keywords = ['abstract syntax tree', 'ast', 'parser', 'xml']

if __name__ == '__main__':
    Package.setup()
<|endoftext|>


<commit_before>#!/usr/bin/env python
"""
This script uses Setuptools (http://pythonhosted.org/setuptools/), a
collection of enhancements to the standard Python distutils.
"""

import re
import sys
import os
import shutil
from setuptools import setup, Command, find_packages
from setuptools.command.test import test as TestCommand

# Make sure I have the right Python version.
if sys.version_info[:2] < (3, 4):
    print("Diofant requires Python 3.4 or newer. Python %d.%d detected" % sys.version_info[:2])
    sys.exit(-1)

class clean(Command):
    """Cleans *.pyc and debian trashs, so you should get the same copy as
    is in the VCS.
    """

    description = "remove build files"
    user_options = [("all", "a", "the same")]

    def initialize_options(self):
        self.all = None

    def finalize_options(self):
        pass

    def run(self):
        dir_setup = os.path.dirname(os.path.realpath(__file__))
        curr_dir = os.getcwd()
        for root, dirs, files in os.walk(dir_setup):
            for file in files:
                if file.endswith('.pyc') and os.path.isfile:
                    os.remove(os.path.join(root, file))

        os.chdir(dir_setup)
        names = ["python-build-stamp-2.4", "MANIFEST", "build", "dist", "doc/_build", ".coverage", ".cache"]

        for f in names:
            if os.path.isfile(f):
                os.remove(f)
            elif os.path.isdir(f):
                shutil.rmtree(f)

        os.chdir(curr_dir)

class test(TestCommand):
    """Runs all tests."""

    description = "run all tests and doctests"
    user_options = [('cov', None, "gatter coverage information"),
                    ('mark=', "m", "run tests matching given mark expression")]

    def initialize_options(self):
        TestCommand.initialize_options(self)
        self.cov = None
        self.mark = None

    def finalize_options(self):
        TestCommand.finalize_options(self)
        try:
            # New setuptools don't need this anymore
            self.test_args = []
            self.test_suite = True
        except AttributeError:
            pass
        self.pytest_args = []
        if self.cov is not None:
            self.pytest_args.extend(["--cov", "diofant"])
        if self.mark is not None:
            self.pytest_args.extend(["-m", self.mark])

    def run_tests(self):
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)

with open('diofant/__init__.py') as f:
    source = f.read()
    long_description = source.split('"""')[1]

    for line in source.splitlines():
        m = re.match('^__version__ = "([0-9a.]+)".*$', line)
        if m:
            __version__ = m.group(1)

setup(name='Diofant',
      version=__version__,
      description='Computer algebra system (CAS) in Python',
      long_description=long_description,
      maintainer='Sergey B Kirpichev',
      license='BSD',
      keywords="Math CAS",
      url='http://diofant.rtfd.io',
      packages=find_packages(),
      ext_modules=[],
      cmdclass={'test': test,
                'clean': clean},
      classifiers=[
          'Development Status :: 3 - Alpha',
          'Intended Audience :: Developers',
          'Intended Audience :: Education',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: BSD License',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Topic :: Scientific/Engineering',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Physics',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.4',
          'Programming Language :: Python :: 3.5',
      ],
      tests_require=['pytest>=2.7.0', 'flake8>=2.5.5', 'pep8-naming', 'pytest-cov'],
      install_requires=['mpmath>=0.19', 'strategies>=0.2.3', 'cachetools'],
      setup_requires=['setuptools>=5.5.1', 'pip>=6.0'],
      extras_require={
          'exports': ["numpy", "scipy", "Theano"],
          'gmpy': ["gmpy2"],
          'plot': ["pyparsing!=2.1.2", "matplotlib"],
          'interactive': ["ipython>=2.3.0"],
      }
)
<commit_msg>setup.py: Use python_requires option<commit_after>#!/usr/bin/env python3
"""
This script uses Setuptools (http://pythonhosted.org/setuptools/), a
collection of enhancements to the standard Python distutils.
"""

import re
import sys
import os
import shutil
from setuptools import setup, Command, find_packages
from setuptools.command.test import test as TestCommand

# Make sure I have the right Python version.  We can drop this
# when setuptools 24.2.1 enter into the Debian stable.
if sys.version_info[:2] < (3, 4):
    print('Diofant requires Python 3.4 or newer. '
          'Python %d.%d detected' % sys.version_info[:2])
    sys.exit(-1)

class clean(Command):
    """Cleans *.pyc and debian trashs, so you should get the same copy as
    is in the VCS.
    """

    description = "remove build files"
    user_options = [("all", "a", "the same")]

    def initialize_options(self):
        self.all = None

    def finalize_options(self):
        pass

    def run(self):
        dir_setup = os.path.dirname(os.path.realpath(__file__))
        curr_dir = os.getcwd()
        for root, dirs, files in os.walk(dir_setup):
            for file in files:
                if file.endswith('.pyc') and os.path.isfile:
                    os.remove(os.path.join(root, file))

        os.chdir(dir_setup)
        names = ["python-build-stamp-2.4", "MANIFEST", "build", "dist", "doc/_build", ".coverage", ".cache"]

        for f in names:
            if os.path.isfile(f):
                os.remove(f)
            elif os.path.isdir(f):
                shutil.rmtree(f)

        os.chdir(curr_dir)

class test(TestCommand):
    """Runs all tests."""

    description = "run all tests and doctests"
    user_options = [('cov', None, "gatter coverage information"),
                    ('mark=', "m", "run tests matching given mark expression")]

    def initialize_options(self):
        TestCommand.initialize_options(self)
        self.cov = None
        self.mark = None

    def finalize_options(self):
        TestCommand.finalize_options(self)
        try:
            # New setuptools don't need this anymore
            self.test_args = []
            self.test_suite = True
        except AttributeError:
            pass
        self.pytest_args = []
        if self.cov is not None:
            self.pytest_args.extend(["--cov", "diofant"])
        if self.mark is not None:
            self.pytest_args.extend(["-m", self.mark])

    def run_tests(self):
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)

with open('diofant/__init__.py') as f:
    source = f.read()
    long_description = source.split('"""')[1]

    for line in source.splitlines():
        m = re.match('^__version__ = "([0-9a.]+)".*$', line)
        if m:
            __version__ = m.group(1)

setup(name='Diofant',
      version=__version__,
      description='Computer algebra system (CAS) in Python',
      long_description=long_description,
      maintainer='Sergey B Kirpichev',
      license='BSD',
      keywords="Math CAS",
      url='http://diofant.rtfd.io',
      packages=find_packages(),
      ext_modules=[],
      cmdclass={'test': test,
                'clean': clean},
      classifiers=[
          'Development Status :: 3 - Alpha',
          'Intended Audience :: Developers',
          'Intended Audience :: Education',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: BSD License',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Topic :: Scientific/Engineering',
          'Topic :: Scientific/Engineering :: Mathematics',
          'Topic :: Scientific/Engineering :: Physics',
          'Programming Language :: Python :: 3',
          'Programming Language :: Python :: 3.4',
          'Programming Language :: Python :: 3.5',
      ],
      python_requires='>=3.4',
      tests_require=['pytest>=2.7.0', 'flake8>=2.5.5', 'pep8-naming', 'pytest-cov'],
      install_requires=['mpmath>=0.19', 'strategies>=0.2.3', 'cachetools'],
      setup_requires=['setuptools>=5.5.1', 'pip>=6.0'],
      extras_require={
          'exports': ["numpy", "scipy", "Theano"],
          'gmpy': ["gmpy2"],
          'plot': ["pyparsing!=2.1.2", "matplotlib"],
          'interactive': ["ipython>=2.3.0"],
      }
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup
from os import path as op

def _read(filename):
    """Read a file and return its contents."""
    try:
        return open(op.join(op.abspath(op.dirname(__file__)), filename)).read()
    except IOError:
        return ''

req_path = 'requirements.txt'
install_requires = [ln for ln in _read(req_path).split('\n') if ln and not ln.startswith('#')]
print repr(install_requires)

setup(
    name='circlecli',
    version='1.2.3',
    url='https://github.com/TheRealJoeLinux/circlecli',
    description=_read('DESCRIPTION'),
    long_description=_read('README.md'),
    author='Joey Espinosa',
    author_email='jlouis.espinosa@gmail.com',
    license='MIT License',
    keywords=['circleci', 'cicd', 'rest', 'api', 'cli', 'command', 'command-line'],
    install_requires=install_requires,
    py_modules=['circlecli'],
    classfiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Environment :: Console',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: OS Independent',
        'Operating System :: POSIX',
        'Operating System :: Unix',
        'Topic :: Utilities',
    ],
    scripts=['bin/circlecli'],
    use_2to3=True,
)
<commit_msg>Incrementing version to v1.2.4<commit_after>#!/usr/bin/env python
from setuptools import setup
from os import path as op

def _read(filename):
    """Read a file and return its contents."""
    try:
        return open(op.join(op.abspath(op.dirname(__file__)), filename)).read()
    except IOError:
        return ''

req_path = 'requirements.txt'
install_requires = [ln for ln in _read(req_path).split('\n') if ln and not ln.startswith('#')]
print repr(install_requires)

setup(
    name='circlecli',
    version='1.2.4',
    url='https://github.com/TheRealJoeLinux/circlecli',
    description=_read('DESCRIPTION'),
    long_description=_read('README.md'),
    author='Joey Espinosa',
    author_email='jlouis.espinosa@gmail.com',
    license='MIT License',
    keywords=['circleci', 'cicd', 'rest', 'api', 'cli', 'command', 'command-line'],
    install_requires=install_requires,
    py_modules=['circlecli'],
    classfiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Environment :: Console',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: OS Independent',
        'Operating System :: POSIX',
        'Operating System :: Unix',
        'Topic :: Utilities',
    ],
    scripts=['bin/circlecli'],
    use_2to3=True,
)
<|endoftext|>


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

from setuptools import setup, find_packages
import os, sys

PACKAGE_NAME = "windmill"
PACKAGE_VERSION = "0.3.8pre"

SUMMARY = 'Web testing framework intended for complete automation of user interface testing, with strong test debugging and recording capabilities.'

DESCRIPTION = """Windmill is an Open Source AJAX Web UI Testing framework that was originally built to automate testing for the Chandler Server Project at OSAF. After spending time with Selenium we realized we had a variety of needs that weren't being fulfilled and built Windmill from the ground up.

Windmill implements cross browser testing, in-browser recording and playback, and functionality for fast accurate debugging and test environment integration.

We are a relatively young project, but as far as we know we already implement a larger set of a browser testability than Selenium. We welcome any and all interest and contribution, as we work diligently at adding new features and keeping up with your bugs.

Thanks for your interest and participation!
"""

if os.name == 'nt' or sys.platform == 'cygwin':
    simplejson = 'simplejson == 1.6'
else:
    simplejson = 'simplejson >= 1.7.1'

setup(name=PACKAGE_NAME,
      version=PACKAGE_VERSION,
      description=SUMMARY,
      long_description=DESCRIPTION,
      author='Open Source Applications Foundation',
      author_email='windmill-dev@osafoundation.org',
      url='http://windmill.osafoundation.org/',
      license='http://www.apache.org/licenses/LICENSE-2.0',
      include_package_data = True,
      packages = find_packages(exclude=['test', 'test.test_live']),
      package_data = {'': ['*.js', '*.css', '*.html', '*.txt', ],},
      scripts=[os.path.join(os.path.dirname(__file__),'scripts','windmill')],
      platforms =['Any'],
      install_requires = ['CherryPy >= 3.0.2',
                          simplejson,
                          'wsgi_jsonrpc >= 0.2.2',
                          'wsgi_xmlrpc >= 0.2.3',
                          'wsgi_fileserver >= 0.2.3',
                          'functest >= 0.7.1',
                          ],
      classifiers=['Development Status :: 4 - Beta',
                   'Environment :: Console',
                   'Intended Audience :: Developers',
                   'License :: OSI Approved :: Apache Software License',
                   'Operating System :: OS Independent',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                  ],
     )

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

from setuptools import setup, find_packages
import os, sys

PACKAGE_NAME = "windmill"
PACKAGE_VERSION = "0.3.8pre"

SUMMARY = 'Web testing framework intended for complete automation of user interface testing, with strong test debugging and recording capabilities.'

DESCRIPTION = """Windmill is an Open Source AJAX Web UI Testing framework that was originally built to automate testing for the Chandler Server Project at OSAF. After spending time with Selenium we realized we had a variety of needs that weren't being fulfilled and built Windmill from the ground up.

Windmill implements cross browser testing, in-browser recording and playback, and functionality for fast accurate debugging and test environment integration.

We are a relatively young project, but as far as we know we already implement a larger set of a browser testability than Selenium. We welcome any and all interest and contribution, as we work diligently at adding new features and keeping up with your bugs.

Thanks for your interest and participation!
"""

setup(name=PACKAGE_NAME,
      version=PACKAGE_VERSION,
      description=SUMMARY,
      long_description=DESCRIPTION,
      author='Open Source Applications Foundation',
      author_email='windmill-dev@osafoundation.org',
      url='http://windmill.osafoundation.org/',
      license='http://www.apache.org/licenses/LICENSE-2.0',
      include_package_data = True,
      packages = find_packages(exclude=['test', 'test.test_live']),
      package_data = {'': ['*.js', '*.css', '*.html', '*.txt', ],},
      scripts=[os.path.join(os.path.dirname(__file__),'scripts','windmill')],
      platforms =['Any'],
      install_requires = ['CherryPy >= 3.0.2',
                          'simplejson >= 1.7.1',
                          'wsgi_jsonrpc >= 0.2.2',
                          'wsgi_xmlrpc >= 0.2.3',
                          'wsgi_fileserver >= 0.2.3',
                          'functest >= 0.7.1',
                          ],
      classifiers=['Development Status :: 4 - Beta',
                   'Environment :: Console',
                   'Intended Audience :: Developers',
                   'License :: OSI Approved :: Apache Software License',
                   'Operating System :: OS Independent',
                   'Topic :: Software Development :: Libraries :: Python Modules',
                  ],
     )

<|endoftext|>


<commit_before>from setuptools import setup, find_packages

setup(
    name='vumi-wikipedia',
    version='0.2.1',
    description='Vumi Wikipedia App',
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'vumi>=0.5',
        'unidecode',
    ],

    url='http://github.com/praekelt/vumi-wikipedia',
    license='BSD',
    long_description=open('README', 'r').read(),
    maintainer='Praekelt Foundation',
    maintainer_email='dev@praekelt.com',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: System :: Networking',
    ],
)
<commit_msg>Bump version to 0.2.2a0 post-release.<commit_after>from setuptools import setup, find_packages

setup(
    name='vumi-wikipedia',
    version='0.2.2a0',
    description='Vumi Wikipedia App',
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'vumi>=0.5',
        'unidecode',
    ],

    url='http://github.com/praekelt/vumi-wikipedia',
    license='BSD',
    long_description=open('README', 'r').read(),
    maintainer='Praekelt Foundation',
    maintainer_email='dev@praekelt.com',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: System :: Networking',
    ],
)
<|endoftext|>


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

# Copyright 2011 Andrew Ryrie (amr66)

from distutils.core import setup

setup(name='pyroven',
      version='1.0',
      packages=['pyroven'],
      )
<commit_msg>Dropped version down to 0.9<commit_after>#!/usr/bin/env python

# Copyright 2011 Andrew Ryrie (amr66)

from distutils.core import setup

setup(name='pyroven',
      version='0.9',
      packages=['pyroven'],
      )
<|endoftext|>


<commit_before>from setuptools import setup, find_packages
setup(
    name = "pyopenshift",
    version = "0.2",
    packages = find_packages(),
    install_requires = ['requests'],

    package_data = {
        # If any package contains *.txt or *.rst files, include them:
        '': ['README', '*.rst', '*.txt'],
    },

    # metadata for upload to PyPI
    author = "Peter Ruan",
    author_email = "pruan@redhat.com",
    description = "This is a python interface for the new Openshift REST API.",
    license = "Unknown",
    keywords = "PaaS Redhat OpenShift",
    url = "https://github.com/openshift/python-interface",   # project home page, if any

    # could also include long_description, download_url, classifiers, etc.
    entry_points = """
    [console_scripts]
    oshift = oshift:command_line
    """,
)
<commit_msg>updated license information in setup.py<commit_after>from setuptools import setup, find_packages
setup(
    name = "pyopenshift",
    version = "0.2",
    packages = find_packages(),
    install_requires = ['requests'],

    package_data = {
        # If any package contains *.txt or *.rst files, include them:
        '': ['README', '*.rst', '*.txt'],
    },

    # metadata for upload to PyPI
    author = "Peter Ruan",
    author_email = "pruan@redhat.com",
    description = "This is a python interface for the new Openshift REST API.",
    license = "Aache v2",
    keywords = "PaaS Redhat OpenShift",
    url = "https://github.com/openshift/python-interface",   # project home page, if any

    # could also include long_description, download_url, classifiers, etc.
    entry_points = """
    [console_scripts]
    oshift = oshift:command_line
    """,
)
<|endoftext|>


<commit_before>"""Setup script for octave_kernel package.
"""
DISTNAME = 'octave_kernel'
DESCRIPTION = 'A Jupyter kernel for Octave.'
LONG_DESCRIPTION = open('README.rst', 'rb').read().decode('utf-8')
MAINTAINER = 'Steven Silvester'
MAINTAINER_EMAIL = 'steven.silvester@ieee.org'
URL = 'http://github.com/calsto/octave_kernel'
LICENSE = 'BSD'
REQUIRES = ["metakernel (>=0.17.4)", "jupyter_client (>=4.3.0)", "ipykernel"]
INSTALL_REQUIRES = ["metakernel >=0.17.4", "jupyter_client >=4.3.0", "ipykernel"]
PACKAGES = [DISTNAME]
PACKAGE_DATA = {DISTNAME: ['*.m']}
CLASSIFIERS = """\
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: System :: Shells
"""
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

with open('octave_kernel/__init__.py', 'rb') as fid:
    for line in fid:
        line = line.decode('utf-8')
        if line.startswith('__version__'):
            version = line.strip().split()[-1][1:-1]
            break

setup(
    name=DISTNAME,
    version=version,
    maintainer=MAINTAINER,
    maintainer_email=MAINTAINER_EMAIL,
    packages=PACKAGES,
    package_data=PACKAGE_DATA,
    url=URL,
    download_url=URL,
    license=LICENSE,
    platforms=["Any"],
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    classifiers=list(filter(None, CLASSIFIERS.split('\n'))),
    requires=REQUIRES,
    install_requires=INSTALL_REQUIRES
 )
<commit_msg>Update setup.py<commit_after>"""Setup script for octave_kernel package.
"""
DISTNAME = 'octave_kernel'
DESCRIPTION = 'A Jupyter kernel for Octave.'
LONG_DESCRIPTION = open('README.rst', 'rb').read().decode('utf-8')
MAINTAINER = 'Steven Silvester'
MAINTAINER_EMAIL = 'steven.silvester@ieee.org'
URL = 'http://github.com/calsto/octave_kernel'
LICENSE = 'BSD'
REQUIRES = ["metakernel (>=0.18.0)", "jupyter_client (>=4.3.0)", "ipykernel"]
INSTALL_REQUIRES = ["metakernel >=0.18.0", "jupyter_client >=4.3.0", "ipykernel"]
PACKAGES = [DISTNAME]
PACKAGE_DATA = {DISTNAME: ['*.m']}
CLASSIFIERS = """\
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: System :: Shells
"""
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

with open('octave_kernel/__init__.py', 'rb') as fid:
    for line in fid:
        line = line.decode('utf-8')
        if line.startswith('__version__'):
            version = line.strip().split()[-1][1:-1]
            break

setup(
    name=DISTNAME,
    version=version,
    maintainer=MAINTAINER,
    maintainer_email=MAINTAINER_EMAIL,
    packages=PACKAGES,
    package_data=PACKAGE_DATA,
    url=URL,
    download_url=URL,
    license=LICENSE,
    platforms=["Any"],
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    classifiers=list(filter(None, CLASSIFIERS.split('\n'))),
    requires=REQUIRES,
    install_requires=INSTALL_REQUIRES
 )
<|endoftext|>


<commit_before>#!/usr/bin/python

from distutils.core import setup, Extension, Command
from distutils.command.build import build
from distutils.command.clean import clean
from distutils.command.sdist import sdist
from distutils.dir_util import remove_tree
from distutils.util import get_platform
from distutils.spawn import spawn
from distutils.errors import DistutilsExecError
import distutils

import sys
import os
import os.path
import re
import time

MIN_LIBVIRT = "0.9.11"
MIN_LIBVIRT_LXC = "1.0.2"

# Hack to stop 'pip install' failing with error
# about missing 'build' dir.
if not os.path.exists("build"):
    os.mkdir("build")

_pkgcfg = -1
def get_pkgcfg(do_fail=True):
    global _pkgcfg
    if _pkgcfg == -1:
        _pkgcfg = distutils.spawn.find_executable("pkg-config")
    if _pkgcfg is None and do_fail:
        raise Exception("pkg-config binary is required to compile libvirt-python")
    return _pkgcfg

def check_minimum_libvirt_version():
    spawn([get_pkgcfg(),
           "--print-errors",
           "--atleast-version=%s" % MIN_LIBVIRT,
           "libvirt"])

def have_libvirt_lxc():
    try:
        spawn([get_pkgcfg(),
               "--atleast-version=%s" % MIN_LIBVIRT_LXC,
             "libvirt"])
        return True
    except DistutilsExecError:
        return False

def get_pkgconfig_data(args, mod, required=True):
    """Run pkg-config to and return content associated with it"""
    f = os.popen("%s %s %s" % (get_pkgcfg(), " ".join(args), mod))

    line = f.readline()
    if line is not None:
        line = line.strip()

    if line is None or line == "":
        if required:
            raise Exception("Cannot determine '%s' from libvirt pkg-config file" % " ".join(args))
        else:
            return ""

    return line

def get_api_xml_files():
    """Check with pkg-config that libvirt is present and extract
    the API XML file paths we need from it"""

    libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], "libvirt")

    offset = libvirt_api.index("-api.xml")
    libvirt_qemu_api = libvirt_api[0:offset] + "-qemu-api.xml"

    offset = libvirt_api.index("-api.xml")
    libvirt_lxc_api = libvirt_api[0:offset] + "-lxc-api.xml"

    return (libvirt_api, libvirt_qemu_api, libvirt_lxc_api)

def get_module_lists():
    """
    Determine which modules we are actually building, and all their
    required config
    """
    if get_pkgcfg(do_fail=False) is None:
        return [], []

    c_modules = []
    py_modules = []
    ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False)
    cflags = get_pkgconfig_data(["--cflags"], "libvirt", False)

    module = Extension('libvirtmod',
                       sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'],
                       libraries = [ "virt" ],
                       include_dirs = [ "." ])
    if cflags != "":
        module.extra_compile_args.append(cflags)
    if ldflags != "":
        module.extra_link_args.append(ldflags)

    c_modules.append(module)
    py_modules.append("libvirt")

    moduleqemu = Extension('libvirtmod_qemu',
                           sources = ['libvirt-qemu-override.c', 'build/libvirt-qemu.c', 'typewrappers.c', 'libvirt-utils.c'],
                           libraries = [ "virt-qemu" ],
                           include_dirs = [ "." ])
    if cflags != "":
        moduleqemu.extra_compile_args.append(cflags)
    if ldflags != "":
        moduleqemu.extra_link_args.append(ldflags)

    c_modules.append(moduleqemu)
    py_modules.append("libvirt_qemu")

    if have_libvirt_lxc():
        modulelxc = Extension('libvirtmod_lxc',
                              sources = ['libvirt-lxc-override.c', 'build/libvirt-lxc.c', 'typewrappers.c', 'libvirt-utils.c'],
                              libraries = [ "virt-lxc" ],
                              include_dirs = [ "." ])
        if cflags != "":
            modulelxc.extra_compile_args.append(cflags)
        if ldflags != "":
            modulelxc.extra_link_args.append(ldflags)

        c_modules.append(modulelxc)
        py_modules.append("libvirt_lxc")

    return c_modules, py_modules

###################
# Custom commands #
###################

class my_build(build):

    def run(self):
        check_minimum_libvirt_version()
        apis = get_api_xml_files()

        self.spawn([sys.executable, "generator.py", "libvirt", apis[0]])
        self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]])
        if have_libvirt_lxc():
            self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]])

        build.run(self)

class my_sdist(sdist):
    user_options = sdist.user_options

    description = "Update libvirt-python.spec; build sdist-tarball."

    def initialize_options(self):
        self.snapshot = None
        sdist.initialize_options(self)

    def finalize_options(self):
        if self.snapshot is not None:
            self.snapshot = 1
        sdist.finalize_options(self)

    def gen_rpm_spec(self):
        f1 = open('libvirt-python.spec.in', 'r')
        f2 = open('libvirt-python.spec', 'w')
        for line in f1:
            f2.write(line
                     .replace('@PY_VERSION@', self.distribution.get_version())
                     .replace('@C_VERSION@', MIN_LIBVIRT))
        f1.close()
        f2.close()

    def gen_authors(self):
        f = os.popen("git log --pretty=format:'%aN <%aE>'")
        authors = []
        for line in f:
            authors.append("   " + line.strip())

        authors.sort(key=str.lower)

        f1 = open('AUTHORS.in', 'r')
        f2 = open('AUTHORS', 'w')
        for line in f1:
            f2.write(line.replace('@AUTHORS@', "\n".join(authors)))
        f1.close()
        f2.close()

    def gen_changelog(self):
        f1 = os.popen("git log '--pretty=format:%H:%ct %an  <%ae>%n%n%s%n%b%n'")
        f2 = open("ChangeLog", 'w')

        for line in f1:
            m = re.match(r'([a-f0-9]+):(\d+)\s(.*)', line)
            if m:
                t = time.gmtime(int(m.group(2)))
                f2.write("%04d-%02d-%02d %s\n" % (t.tm_year, t.tm_mon, t.tm_mday, m.group(3)))
            else:
                if re.match(r'Signed-off-by', line):
                    continue
                f2.write("    " + line.strip() + "\n")

        f1.close()
        f2.close()

    def run(self):
        if not os.path.exists("build"):
            os.mkdir("build")

        if os.path.exists(".git"):
            try:
                self.gen_rpm_spec()
                self.gen_authors()
                self.gen_changelog()

                sdist.run(self)

            finally:
                files = ["libvirt-python.spec",
                         "AUTHORS",
                         "ChangeLog"]
                for f in files:
                    if os.path.exists(f):
                        os.unlink(f)
        else:
            sdist.run(self)

class my_rpm(Command):
    user_options = []

    description = "Build src and noarch rpms."

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        """
        Run sdist, then 'rpmbuild' the tar.gz
        """

        self.run_command('sdist')
        os.system('rpmbuild -ta --clean dist/libvirt-python-%s.tar.gz' %
                  self.distribution.get_version())

class my_test(Command):
    user_options = [
        ('build-base=', 'b',
         "base directory for build library"),
        ('build-platlib=', None,
         "build directory for platform-specific distributions"),
        ('plat-name=', 'p',
         "platform name to build for, if supported "
         "(default: %s)" % get_platform()),
    ]

    description = "Run test suite."

    def initialize_options(self):
        self.build_base = 'build'
        self.build_platlib = None
        self.plat_name = None

    def finalize_options(self):
        if self.plat_name is None:
            self.plat_name = get_platform()

        plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3])

        if hasattr(sys, 'gettotalrefcount'):
            plat_specifier += '-pydebug'

        if self.build_platlib is None:
            self.build_platlib = os.path.join(self.build_base,
                                              'lib' + plat_specifier)

    def run(self):
        """
        Run test suite
        """

        apis = get_api_xml_files()

        if "PYTHONPATH" in os.environ:
            os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"]
        else:
            os.environ["PYTHONPATH"] = self.build_platlib
        self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
        self.spawn([sys.executable, "/usr/bin/nosetests"])

class my_clean(clean):
    def run(self):
        clean.run(self)

        if os.path.exists("build"):
            remove_tree("build")

##################
# Invoke setup() #
##################

_c_modules, _py_modules = get_module_lists()

setup(name = 'libvirt-python',
      version = '1.2.10',
      url = 'http://www.libvirt.org',
      maintainer = 'Libvirt Maintainers',
      maintainer_email = 'libvir-list@redhat.com',
      description = 'The libvirt virtualization API',
      ext_modules = _c_modules,
      py_modules = _py_modules,
      package_dir = {
          '': 'build'
      },
      cmdclass = {
          'build': my_build,
          'clean': my_clean,
          'sdist': my_sdist,
          'rpm': my_rpm,
          'test': my_test
      })
<commit_msg>setup.py: fix rpm build to return 1 on error<commit_after>#!/usr/bin/python

from distutils.core import setup, Extension, Command
from distutils.command.build import build
from distutils.command.clean import clean
from distutils.command.sdist import sdist
from distutils.dir_util import remove_tree
from distutils.util import get_platform
from distutils.spawn import spawn
from distutils.errors import DistutilsExecError
import distutils

import sys
import os
import os.path
import re
import time

MIN_LIBVIRT = "0.9.11"
MIN_LIBVIRT_LXC = "1.0.2"

# Hack to stop 'pip install' failing with error
# about missing 'build' dir.
if not os.path.exists("build"):
    os.mkdir("build")

_pkgcfg = -1
def get_pkgcfg(do_fail=True):
    global _pkgcfg
    if _pkgcfg == -1:
        _pkgcfg = distutils.spawn.find_executable("pkg-config")
    if _pkgcfg is None and do_fail:
        raise Exception("pkg-config binary is required to compile libvirt-python")
    return _pkgcfg

def check_minimum_libvirt_version():
    spawn([get_pkgcfg(),
           "--print-errors",
           "--atleast-version=%s" % MIN_LIBVIRT,
           "libvirt"])

def have_libvirt_lxc():
    try:
        spawn([get_pkgcfg(),
               "--atleast-version=%s" % MIN_LIBVIRT_LXC,
             "libvirt"])
        return True
    except DistutilsExecError:
        return False

def get_pkgconfig_data(args, mod, required=True):
    """Run pkg-config to and return content associated with it"""
    f = os.popen("%s %s %s" % (get_pkgcfg(), " ".join(args), mod))

    line = f.readline()
    if line is not None:
        line = line.strip()

    if line is None or line == "":
        if required:
            raise Exception("Cannot determine '%s' from libvirt pkg-config file" % " ".join(args))
        else:
            return ""

    return line

def get_api_xml_files():
    """Check with pkg-config that libvirt is present and extract
    the API XML file paths we need from it"""

    libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], "libvirt")

    offset = libvirt_api.index("-api.xml")
    libvirt_qemu_api = libvirt_api[0:offset] + "-qemu-api.xml"

    offset = libvirt_api.index("-api.xml")
    libvirt_lxc_api = libvirt_api[0:offset] + "-lxc-api.xml"

    return (libvirt_api, libvirt_qemu_api, libvirt_lxc_api)

def get_module_lists():
    """
    Determine which modules we are actually building, and all their
    required config
    """
    if get_pkgcfg(do_fail=False) is None:
        return [], []

    c_modules = []
    py_modules = []
    ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False)
    cflags = get_pkgconfig_data(["--cflags"], "libvirt", False)

    module = Extension('libvirtmod',
                       sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'],
                       libraries = [ "virt" ],
                       include_dirs = [ "." ])
    if cflags != "":
        module.extra_compile_args.append(cflags)
    if ldflags != "":
        module.extra_link_args.append(ldflags)

    c_modules.append(module)
    py_modules.append("libvirt")

    moduleqemu = Extension('libvirtmod_qemu',
                           sources = ['libvirt-qemu-override.c', 'build/libvirt-qemu.c', 'typewrappers.c', 'libvirt-utils.c'],
                           libraries = [ "virt-qemu" ],
                           include_dirs = [ "." ])
    if cflags != "":
        moduleqemu.extra_compile_args.append(cflags)
    if ldflags != "":
        moduleqemu.extra_link_args.append(ldflags)

    c_modules.append(moduleqemu)
    py_modules.append("libvirt_qemu")

    if have_libvirt_lxc():
        modulelxc = Extension('libvirtmod_lxc',
                              sources = ['libvirt-lxc-override.c', 'build/libvirt-lxc.c', 'typewrappers.c', 'libvirt-utils.c'],
                              libraries = [ "virt-lxc" ],
                              include_dirs = [ "." ])
        if cflags != "":
            modulelxc.extra_compile_args.append(cflags)
        if ldflags != "":
            modulelxc.extra_link_args.append(ldflags)

        c_modules.append(modulelxc)
        py_modules.append("libvirt_lxc")

    return c_modules, py_modules

###################
# Custom commands #
###################

class my_build(build):

    def run(self):
        check_minimum_libvirt_version()
        apis = get_api_xml_files()

        self.spawn([sys.executable, "generator.py", "libvirt", apis[0]])
        self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]])
        if have_libvirt_lxc():
            self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]])

        build.run(self)

class my_sdist(sdist):
    user_options = sdist.user_options

    description = "Update libvirt-python.spec; build sdist-tarball."

    def initialize_options(self):
        self.snapshot = None
        sdist.initialize_options(self)

    def finalize_options(self):
        if self.snapshot is not None:
            self.snapshot = 1
        sdist.finalize_options(self)

    def gen_rpm_spec(self):
        f1 = open('libvirt-python.spec.in', 'r')
        f2 = open('libvirt-python.spec', 'w')
        for line in f1:
            f2.write(line
                     .replace('@PY_VERSION@', self.distribution.get_version())
                     .replace('@C_VERSION@', MIN_LIBVIRT))
        f1.close()
        f2.close()

    def gen_authors(self):
        f = os.popen("git log --pretty=format:'%aN <%aE>'")
        authors = []
        for line in f:
            authors.append("   " + line.strip())

        authors.sort(key=str.lower)

        f1 = open('AUTHORS.in', 'r')
        f2 = open('AUTHORS', 'w')
        for line in f1:
            f2.write(line.replace('@AUTHORS@', "\n".join(authors)))
        f1.close()
        f2.close()

    def gen_changelog(self):
        f1 = os.popen("git log '--pretty=format:%H:%ct %an  <%ae>%n%n%s%n%b%n'")
        f2 = open("ChangeLog", 'w')

        for line in f1:
            m = re.match(r'([a-f0-9]+):(\d+)\s(.*)', line)
            if m:
                t = time.gmtime(int(m.group(2)))
                f2.write("%04d-%02d-%02d %s\n" % (t.tm_year, t.tm_mon, t.tm_mday, m.group(3)))
            else:
                if re.match(r'Signed-off-by', line):
                    continue
                f2.write("    " + line.strip() + "\n")

        f1.close()
        f2.close()

    def run(self):
        if not os.path.exists("build"):
            os.mkdir("build")

        if os.path.exists(".git"):
            try:
                self.gen_rpm_spec()
                self.gen_authors()
                self.gen_changelog()

                sdist.run(self)

            finally:
                files = ["libvirt-python.spec",
                         "AUTHORS",
                         "ChangeLog"]
                for f in files:
                    if os.path.exists(f):
                        os.unlink(f)
        else:
            sdist.run(self)

class my_rpm(Command):
    user_options = []

    description = "Build src and noarch rpms."

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        """
        Run sdist, then 'rpmbuild' the tar.gz
        """

        self.run_command('sdist')
        self.spawn(["/usr/bin/rpmbuild", "-ta", "--clean",
            "dist/libvirt-python-%s.tar.gz" % self.distribution.get_version()])

class my_test(Command):
    user_options = [
        ('build-base=', 'b',
         "base directory for build library"),
        ('build-platlib=', None,
         "build directory for platform-specific distributions"),
        ('plat-name=', 'p',
         "platform name to build for, if supported "
         "(default: %s)" % get_platform()),
    ]

    description = "Run test suite."

    def initialize_options(self):
        self.build_base = 'build'
        self.build_platlib = None
        self.plat_name = None

    def finalize_options(self):
        if self.plat_name is None:
            self.plat_name = get_platform()

        plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3])

        if hasattr(sys, 'gettotalrefcount'):
            plat_specifier += '-pydebug'

        if self.build_platlib is None:
            self.build_platlib = os.path.join(self.build_base,
                                              'lib' + plat_specifier)

    def run(self):
        """
        Run test suite
        """

        apis = get_api_xml_files()

        if "PYTHONPATH" in os.environ:
            os.environ["PYTHONPATH"] = self.build_platlib + ":" + os.environ["PYTHONPATH"]
        else:
            os.environ["PYTHONPATH"] = self.build_platlib
        self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
        self.spawn([sys.executable, "/usr/bin/nosetests"])

class my_clean(clean):
    def run(self):
        clean.run(self)

        if os.path.exists("build"):
            remove_tree("build")

##################
# Invoke setup() #
##################

_c_modules, _py_modules = get_module_lists()

setup(name = 'libvirt-python',
      version = '1.2.10',
      url = 'http://www.libvirt.org',
      maintainer = 'Libvirt Maintainers',
      maintainer_email = 'libvir-list@redhat.com',
      description = 'The libvirt virtualization API',
      ext_modules = _c_modules,
      py_modules = _py_modules,
      package_dir = {
          '': 'build'
      },
      cmdclass = {
          'build': my_build,
          'clean': my_clean,
          'sdist': my_sdist,
          'rpm': my_rpm,
          'test': my_test
      })
<|endoftext|>


<commit_before>from setuptools import setup

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

setup(
    name='zxcvbn',
    version='4.4.25',
    packages=['zxcvbn'],
    url='https://github.com/dwolfhub/zxcvbn-python',
    download_url='https://github.com/dwolfhub/zxcvbn-python/tarball/v4.4.25',
    license='MIT',
    author='Daniel Wolf',
    author_email='danielrwolf5@gmail.com',
    long_description=long_description,
    keywords=['zxcvbn', 'password', 'security'],
    entry_points={
        'console_scripts': [
            'zxcvbn = zxcvbn.__main__:cli'
         ]
    },
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Security',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)
<commit_msg>upgrading to version 4.4.27<commit_after>from setuptools import setup

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

setup(
    name='zxcvbn',
    version='4.4.27',
    packages=['zxcvbn'],
    url='https://github.com/dwolfhub/zxcvbn-python',
    download_url='https://github.com/dwolfhub/zxcvbn-python/tarball/v4.4.27',
    license='MIT',
    author='Daniel Wolf',
    author_email='danielrwolf5@gmail.com',
    long_description=long_description,
    keywords=['zxcvbn', 'password', 'security'],
    entry_points={
        'console_scripts': [
            'zxcvbn = zxcvbn.__main__:cli'
         ]
    },
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Security',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)
<|endoftext|>


<commit_before># Copyright 2014 Google Inc. All Rights Reserved.

# 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.
"""Setup script for OpenHTF."""

import errno
import glob
import os
import platform
import subprocess
import sys

from distutils.command.build import build
from distutils.command.clean import clean
from distutils.cmd import Command
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test

class CleanCommand(clean):
  """Custom logic for the clean command."""

  def run(self):
    clean.run(self)
    targets = [
        './dist',
        './*.egg-info',
        './openhtf/output/proto/*_pb2.py',
        './openhtf/**/*.pyc',
    ]
    os.system('shopt -s globstar; rm -vrf %s' % ' '.join(targets))

class BuildProtoCommand(Command):
  """Custom setup command to build protocol buffers."""
  description = 'Builds the proto files into python files.'
  user_options = [('protoc=', None, 'Path to the protoc compiler.'),
                  ('protodir=', None, 'Path to protobuf install.'),
                  ('indir=', 'i', 'Directory containing input .proto files.'),
                  ('outdir=', 'o', 'Where to output .py files.')]

  def initialize_options(self):
    self.skip_proto = False
    try:
      prefix = subprocess.check_output(
          'pkg-config --variable prefix protobuf'.split()).strip().decode('utf-8')
    except (subprocess.CalledProcessError, OSError):
      if platform.system() == 'Linux':
        # Default to /usr?
        prefix = '/usr'
      elif platform.system() in ['Mac', 'Darwin']:
        # Default to /usr/local for Homebrew
        prefix = '/usr/local'
      else:
        print('Warning: mfg-inspector output is not fully implemented for '
              'Windows. OpenHTF will be installed without it.')
        self.skip_proto = True

    maybe_protoc = os.path.join(prefix, 'bin', 'protoc')
    if os.path.isfile(maybe_protoc) and os.access(maybe_protoc, os.X_OK):
        self.protoc = maybe_protoc
    else:
        print('Warning: protoc not found at %s' % maybe_protoc)
        print('setup will attempt to run protoc with no prefix.')
        self.protoc = 'protoc'

    self.protodir = os.path.join(prefix, 'include')
    self.indir = os.getcwd()
    self.outdir = os.getcwd()

  def finalize_options(self):
    pass

  def run(self):
    if self.skip_proto:
      print('Skipping building protocol buffers.')
      return

    # Build regular proto files.
    protos = glob.glob(
        os.path.join(self.indir, 'openhtf', 'output', 'proto', '*.proto'))

    if protos:
      print('Attempting to build proto files:\n%s' % '\n'.join(protos))
      cmd = [
          self.protoc,
          '--proto_path', self.indir,
          '--proto_path', self.protodir,
          '--python_out', self.outdir,
      ] + protos
      try:
        subprocess.check_call(cmd)
      except OSError as e:
        if e.errno == errno.ENOENT:
          print('Could not find the protobuf compiler at \'%s\'' % self.protoc)
          if sys.platform.startswith('linux'):
            print('On many Linux systems, this is fixed by installing the '
                  '"protobuf-compiler" and "libprotobuf-dev" packages.')
          elif sys.platform == 'darwin':
            print('On Mac, protobuf is often installed via homebrew.')
        raise
      except subprocess.CalledProcessError:
        print('Could not build proto files.')
        print('This could be due to missing helper files. On many Linux '
              'systems, this is fixed by installing the '
              '"libprotobuf-dev" package.')
        raise
    else:
      print('Found no proto files to build.')

# Make building protos part of building overall.
build.sub_commands.insert(0, ('build_proto', None))

INSTALL_REQUIRES = [
    'colorama>=0.3.9,<1.0',
    'contextlib2>=0.5.1,<1.0',
    'future>=0.16.0',
    'mutablerecords>=0.4.1,<2.0',
    'oauth2client>=1.5.2,<2.0',
    'protobuf>=3.0.0,<4.0',
    'PyYAML>=3.13,<4.0',
    'pyOpenSSL>=17.1.0,<18.0',
    'sockjs-tornado>=1.0.3,<2.0',
    'tornado>=4.3,<5.0',
]
# Not all versions of setuptools support semicolon syntax for specifying
# platform-specific dependencies, so we do it the old school way.
if sys.version_info < (3,4):
  INSTALL_REQUIRES.append('enum34>=1.1.2,<2.0')

class PyTestCommand(test):
  # Derived from
  # https://github.com/chainreactionmfg/cara/blob/master/setup.py
  user_options = [
      ('pytest-args=', None, 'Arguments to pass to py.test'),
      ('pytest-cov=', None, 'Enable coverage. Choose output type: '
       'term, html, xml, annotate, or multiple with comma separation'),
  ]

  def initialize_options(self):
    test.initialize_options(self)
    self.pytest_args = 'test'
    self.pytest_cov = None

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

  def run_tests(self):
    self.run_command('build_proto')

    import pytest
    cov = ''
    if self.pytest_cov is not None:
      outputs = ' '.join('--cov-report %s' % output
                         for output in self.pytest_cov.split(','))
      cov = ' --cov openhtf ' + outputs

    sys.argv = [sys.argv[0]]
    print('invoking pytest.main with %s' % (self.pytest_args + cov))
    sys.exit(pytest.main(self.pytest_args + cov))

setup(
    name='openhtf',
    version='1.3.0',
    description='OpenHTF, the open hardware testing framework.',
    author='John Hawley',
    author_email='madsci@google.com',
    maintainer='Joe Ethier',
    maintainer_email='jethier@google.com',
    packages=find_packages(exclude='examples'),
    package_data={'openhtf': ['output/proto/*.proto',
                              'output/web_gui/dist/*',
                              'output/web_gui/dist/css/*',
                              'output/web_gui/dist/js/*',
                              'output/web_gui/dist/img/*',
                              'output/web_gui/*']},
    cmdclass={
        'build_proto': BuildProtoCommand,
        'clean': CleanCommand,
        'test': PyTestCommand,
    },
    install_requires=INSTALL_REQUIRES,
    extras_require={
        'usb_plugs': [
            'libusb1>=1.3.0,<2.0',
            'M2Crypto>=0.22.3,<1.0',
        ],
        'update_units': [
            'xlrd>=1.0.0,<2.0',
        ],
        'serial_collection_plug': [
            'pyserial>=3.3.0,<4.0',
        ],
    },
    setup_requires=[
        'wheel>=0.29.0,<1.0',
    ],
    tests_require=[
        'mock>=2.0.0',
        'pandas>=0.22.0',
        'pytest>=2.9.2',
        'pytest-cov>=2.2.1',
    ],
)
<commit_msg>Fixes Travis CI config. (#852)<commit_after># Copyright 2014 Google Inc. All Rights Reserved.

# 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.
"""Setup script for OpenHTF."""

import errno
import glob
import os
import platform
import subprocess
import sys

from distutils.command.build import build
from distutils.command.clean import clean
from distutils.cmd import Command
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test

class CleanCommand(clean):
  """Custom logic for the clean command."""

  def run(self):
    clean.run(self)
    targets = [
        './dist',
        './*.egg-info',
        './openhtf/output/proto/*_pb2.py',
        './openhtf/**/*.pyc',
    ]
    os.system('shopt -s globstar; rm -vrf %s' % ' '.join(targets))

class BuildProtoCommand(Command):
  """Custom setup command to build protocol buffers."""
  description = 'Builds the proto files into python files.'
  user_options = [('protoc=', None, 'Path to the protoc compiler.'),
                  ('protodir=', None, 'Path to protobuf install.'),
                  ('indir=', 'i', 'Directory containing input .proto files.'),
                  ('outdir=', 'o', 'Where to output .py files.')]

  def initialize_options(self):
    self.skip_proto = False
    try:
      prefix = subprocess.check_output(
          'pkg-config --variable prefix protobuf'.split()).strip().decode('utf-8')
    except (subprocess.CalledProcessError, OSError):
      if platform.system() == 'Linux':
        # Default to /usr?
        prefix = '/usr'
      elif platform.system() in ['Mac', 'Darwin']:
        # Default to /usr/local for Homebrew
        prefix = '/usr/local'
      else:
        print('Warning: mfg-inspector output is not fully implemented for '
              'Windows. OpenHTF will be installed without it.')
        self.skip_proto = True

    maybe_protoc = os.path.join(prefix, 'bin', 'protoc')
    if os.path.isfile(maybe_protoc) and os.access(maybe_protoc, os.X_OK):
        self.protoc = maybe_protoc
    else:
        print('Warning: protoc not found at %s' % maybe_protoc)
        print('setup will attempt to run protoc with no prefix.')
        self.protoc = 'protoc'

    self.protodir = os.path.join(prefix, 'include')
    self.indir = os.getcwd()
    self.outdir = os.getcwd()

  def finalize_options(self):
    pass

  def run(self):
    if self.skip_proto:
      print('Skipping building protocol buffers.')
      return

    # Build regular proto files.
    protos = glob.glob(
        os.path.join(self.indir, 'openhtf', 'output', 'proto', '*.proto'))

    if protos:
      print('Attempting to build proto files:\n%s' % '\n'.join(protos))
      cmd = [
          self.protoc,
          '--proto_path', self.indir,
          '--proto_path', self.protodir,
          '--python_out', self.outdir,
      ] + protos
      try:
        subprocess.check_call(cmd)
      except OSError as e:
        if e.errno == errno.ENOENT:
          print('Could not find the protobuf compiler at \'%s\'' % self.protoc)
          if sys.platform.startswith('linux'):
            print('On many Linux systems, this is fixed by installing the '
                  '"protobuf-compiler" and "libprotobuf-dev" packages.')
          elif sys.platform == 'darwin':
            print('On Mac, protobuf is often installed via homebrew.')
        raise
      except subprocess.CalledProcessError:
        print('Could not build proto files.')
        print('This could be due to missing helper files. On many Linux '
              'systems, this is fixed by installing the '
              '"libprotobuf-dev" package.')
        raise
    else:
      print('Found no proto files to build.')

# Make building protos part of building overall.
build.sub_commands.insert(0, ('build_proto', None))

INSTALL_REQUIRES = [
    'colorama>=0.3.9,<1.0',
    'contextlib2>=0.5.1,<1.0',
    'future>=0.16.0',
    'mutablerecords>=0.4.1,<2.0',
    'oauth2client>=1.5.2,<2.0',
    'protobuf>=3.0.0,<4.0',
    'PyYAML>=3.13,<4.0',
    'pyOpenSSL>=17.1.0,<18.0',
    'sockjs-tornado>=1.0.3,<2.0',
    'tornado>=4.3,<5.0',
]
# Not all versions of setuptools support semicolon syntax for specifying
# platform-specific dependencies, so we do it the old school way.
if sys.version_info < (3,4):
  INSTALL_REQUIRES.append('enum34>=1.1.2,<2.0')

class PyTestCommand(test):
  # Derived from
  # https://github.com/chainreactionmfg/cara/blob/master/setup.py
  user_options = [
      ('pytest-args=', None, 'Arguments to pass to py.test'),
      ('pytest-cov=', None, 'Enable coverage. Choose output type: '
       'term, html, xml, annotate, or multiple with comma separation'),
  ]

  def initialize_options(self):
    test.initialize_options(self)
    self.pytest_args = ['test']
    self.pytest_cov = None

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

  def run_tests(self):
    self.run_command('build_proto')

    import pytest
    cov = []
    if self.pytest_cov is not None:
      outputs = []
      for output in self.pytest_cov.split(','):
        outputs.extend(['--cov-report', output])
      cov = ['--cov', 'openhtf'] + outputs

    sys.argv = [sys.argv[0]]
    print('invoking pytest.main with %s' % (self.pytest_args + cov))
    sys.exit(pytest.main(self.pytest_args + cov))

setup(
    name='openhtf',
    version='1.3.0',
    description='OpenHTF, the open hardware testing framework.',
    author='John Hawley',
    author_email='madsci@google.com',
    maintainer='Joe Ethier',
    maintainer_email='jethier@google.com',
    packages=find_packages(exclude='examples'),
    package_data={'openhtf': ['output/proto/*.proto',
                              'output/web_gui/dist/*',
                              'output/web_gui/dist/css/*',
                              'output/web_gui/dist/js/*',
                              'output/web_gui/dist/img/*',
                              'output/web_gui/*']},
    cmdclass={
        'build_proto': BuildProtoCommand,
        'clean': CleanCommand,
        'test': PyTestCommand,
    },
    install_requires=INSTALL_REQUIRES,
    extras_require={
        'usb_plugs': [
            'libusb1>=1.3.0,<2.0',
            'M2Crypto>=0.22.3,<1.0',
        ],
        'update_units': [
            'xlrd>=1.0.0,<2.0',
        ],
        'serial_collection_plug': [
            'pyserial>=3.3.0,<4.0',
        ],
    },
    setup_requires=[
        'wheel>=0.29.0,<1.0',
    ],
    tests_require=[
        'mock>=2.0.0',
        'pandas>=0.22.0',
        'pytest>=2.9.2',
        'pytest-cov>=2.2.1',
    ],
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from distutils.core import setup

setup(
    name='django-payfast',
    version='0.1.2',
    author='Mikhail Korobov',
    author_email='kmike84@gmail.com',

    packages=['payfast', 'payfast.migrations'],

    url='http://bitbucket.org/kmike/django-payfast/',
    download_url = 'http://bitbucket.org/kmike/django-payfast/get/tip.gz',
    license = 'MIT license',
    description = 'A pluggable Django application for integrating netcash.co.za payment system.',
    long_description = open('README.rst').read().decode('utf8'),

    classifiers=(
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ),
)
<commit_msg>Copy-pasted text is fixed<commit_after>#!/usr/bin/env python
from distutils.core import setup

setup(
    name='django-payfast',
    version='0.1.2',
    author='Mikhail Korobov',
    author_email='kmike84@gmail.com',

    packages=['payfast', 'payfast.migrations'],

    url='http://bitbucket.org/kmike/django-payfast/',
    download_url = 'http://bitbucket.org/kmike/django-payfast/get/tip.gz',
    license = 'MIT license',
    description = 'A pluggable Django application for integrating payfast.co.za payment system.',
    long_description = open('README.rst').read().decode('utf8'),

    classifiers=(
        'Development Status :: 3 - Alpha',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ),
)
<|endoftext|>


<commit_before>import glob
import os
import subprocess

from distribute_setup import use_setuptools
use_setuptools(version="0.6.34")
from setuptools import setup, find_packages, Extension

try:
    from numpy.distutils.misc_util import get_numpy_include_dirs
except ImportError:
    print("numpy.distutils.misc_util cannot be imported. Attempting to "
          "install...")
    subprocess.call(["easy_install", "numpy"])
    from numpy.distutils.misc_util import get_numpy_include_dirs

def get_spglib_ext():
    """
    Set up spglib extension.
    """
    spglibs = glob.glob(os.path.join("dependencies", "spglib*"))
    if len(spglibs) == 0:
        raise ValueError("No spglib found in dependencies.")
    spglibdir = spglibs[0]

    # set rest of spglib
    spgsrcdir = os.path.join(spglibdir, "src")
    include_dirs = [spgsrcdir]
    sources = ["cell.c", "debug.c", "hall_symbol.c", "kpoint.c", "lattice.c",
               "mathfunc.c", "pointgroup.c", "primitive.c", "refinement.c",
               "sitesym_database.c", "site_symmetry.c", "spacegroup.c",
               "spin.c", "spg_database.c", "spglib.c", "symmetry.c"]
    sources = [os.path.join(spgsrcdir, srcfile) for srcfile in sources]
    return Extension("pymatgen._spglib",
                     include_dirs=include_dirs + get_numpy_include_dirs(),
                     sources=[os.path.join(spglibdir, "_spglib.c")] + sources)

with open("README.rst") as f:
    long_desc = f.read()
    ind = long_desc.find("\n")
    long_desc = long_desc[ind + 1:]

setup(
    name="pymatgen",
    packages=find_packages(),
    version="2.8.8",
    install_requires=["numpy>=1.5", "pyhull>=1.4.3", "PyCifRW>=3.3",
                      "requests>=1.0", "pybtex>=0.16", "pyyaml>=3.0"],
    extras_require={"electronic_structure": ["scipy>=0.10"],
                    "plotting": ["matplotlib>=1.1"],
                    "ase_adaptor": ["ase>=3.3"],
                    "vis": ["vtk>=6.0.0"],
                    "abinitio": ["pydispatcher>=2.0", "apscheduler>=2.1.1"]},
    package_data={"pymatgen.core": ["*.json"],
                  "pymatgen.analysis": ["bvparam_1991.json", "icsd_bv.json"],
                  "pymatgen.io": ["*.cfg", "*.json"],
                  "pymatgen.entries": ["*.cfg"],
                  "pymatgen.structure_prediction": ["data/*.json"],
                  "pymatgen.vis": ["ElementColorSchemes.cfg"]},
    author="Shyue Ping Ong, Anubhav Jain, Michael Kocher, Geoffroy Hautier,"
    "William Davidson Richards, Stephen Dacek, Dan Gunter, Shreyas Cholia, "
    "Matteo Giantomassi, Vincent L Chevrier, Rickard Armiento",
    author_email="ongsp@ucsd.edu, anubhavj@mit.edu, mpkocher@lbnl.gov, "
    "geoffroy.hautier@uclouvain.be, wrichard@mit.edu, sdacek@mit.edu, "
    "dkgunter@lbl.gov, scholia@lbl.gov, gmatteo@gmail.com, "
    "vincentchevrier@gmail.com, armiento@mit.edu",
    maintainer="Shyue Ping Ong",
    url="https://github.com/materialsproject/pymatgen/",
    license="MIT",
    description="Python Materials Genomics is a robust materials "
                "analysis code that defines core object representations for "
                "structures and molecules with support for many electronic "
                "structure codes. It is currently the core analysis code "
                "powering the Materials Project (www.materialsproject.org).",
    long_description=long_desc,
    keywords=["VASP", "gaussian", "ABINIT", "nwchem", "materials", "project",
              "electronic", "structure", "analysis", "phase", "diagrams"],
    classifiers=[
        "Programming Language :: Python :: 2.7",
        "Development Status :: 4 - Beta",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Topic :: Scientific/Engineering :: Information Analysis",
        "Topic :: Scientific/Engineering :: Physics",
        "Topic :: Scientific/Engineering :: Chemistry",
        "Topic :: Software Development :: Libraries :: Python Modules"
    ],
    ext_modules=[get_spglib_ext()],
    scripts=[os.path.join("scripts", f) for f in os.listdir("scripts")]
)
<commit_msg>Fix Tersoff potentials for gulp. Whoever write command line utlities better make sure their code runs EVERYWHERE and not just on their own computer.<commit_after>import glob
import os
import subprocess

from distribute_setup import use_setuptools
use_setuptools(version="0.6.34")
from setuptools import setup, find_packages, Extension

try:
    from numpy.distutils.misc_util import get_numpy_include_dirs
except ImportError:
    print("numpy.distutils.misc_util cannot be imported. Attempting to "
          "install...")
    subprocess.call(["easy_install", "numpy"])
    from numpy.distutils.misc_util import get_numpy_include_dirs

def get_spglib_ext():
    """
    Set up spglib extension.
    """
    spglibs = glob.glob(os.path.join("dependencies", "spglib*"))
    if len(spglibs) == 0:
        raise ValueError("No spglib found in dependencies.")
    spglibdir = spglibs[0]

    # set rest of spglib
    spgsrcdir = os.path.join(spglibdir, "src")
    include_dirs = [spgsrcdir]
    sources = ["cell.c", "debug.c", "hall_symbol.c", "kpoint.c", "lattice.c",
               "mathfunc.c", "pointgroup.c", "primitive.c", "refinement.c",
               "sitesym_database.c", "site_symmetry.c", "spacegroup.c",
               "spin.c", "spg_database.c", "spglib.c", "symmetry.c"]
    sources = [os.path.join(spgsrcdir, srcfile) for srcfile in sources]
    return Extension("pymatgen._spglib",
                     include_dirs=include_dirs + get_numpy_include_dirs(),
                     sources=[os.path.join(spglibdir, "_spglib.c")] + sources)

with open("README.rst") as f:
    long_desc = f.read()
    ind = long_desc.find("\n")
    long_desc = long_desc[ind + 1:]

setup(
    name="pymatgen",
    packages=find_packages(),
    version="2.8.8",
    install_requires=["numpy>=1.5", "pyhull>=1.4.3", "PyCifRW>=3.3",
                      "requests>=1.0", "pybtex>=0.16", "pyyaml>=3.0"],
    extras_require={"electronic_structure": ["scipy>=0.10"],
                    "plotting": ["matplotlib>=1.1"],
                    "ase_adaptor": ["ase>=3.3"],
                    "vis": ["vtk>=6.0.0"],
                    "abinitio": ["pydispatcher>=2.0", "apscheduler>=2.1.1"]},
    package_data={"pymatgen.core": ["*.json"],
                  "pymatgen.analysis": ["bvparam_1991.json", "icsd_bv.json"],
                  "pymatgen.io": ["*.cfg", "*.json"],
                  "pymatgen.entries": ["*.cfg"],
                  "pymatgen.structure_prediction": ["data/*.json"],
                  "pymatgen.vis": ["ElementColorSchemes.cfg"],
                  "pymatgen.command_line": ["OxideTersoffPotentials"]},
    author="Shyue Ping Ong, Anubhav Jain, Michael Kocher, Geoffroy Hautier,"
    "William Davidson Richards, Stephen Dacek, Dan Gunter, Shreyas Cholia, "
    "Matteo Giantomassi, Vincent L Chevrier, Rickard Armiento",
    author_email="ongsp@ucsd.edu, anubhavj@mit.edu, mpkocher@lbnl.gov, "
    "geoffroy.hautier@uclouvain.be, wrichard@mit.edu, sdacek@mit.edu, "
    "dkgunter@lbl.gov, scholia@lbl.gov, gmatteo@gmail.com, "
    "vincentchevrier@gmail.com, armiento@mit.edu",
    maintainer="Shyue Ping Ong",
    url="https://github.com/materialsproject/pymatgen/",
    license="MIT",
    description="Python Materials Genomics is a robust materials "
                "analysis code that defines core object representations for "
                "structures and molecules with support for many electronic "
                "structure codes. It is currently the core analysis code "
                "powering the Materials Project (www.materialsproject.org).",
    long_description=long_desc,
    keywords=["VASP", "gaussian", "ABINIT", "nwchem", "materials", "project",
              "electronic", "structure", "analysis", "phase", "diagrams"],
    classifiers=[
        "Programming Language :: Python :: 2.7",
        "Development Status :: 4 - Beta",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Topic :: Scientific/Engineering :: Information Analysis",
        "Topic :: Scientific/Engineering :: Physics",
        "Topic :: Scientific/Engineering :: Chemistry",
        "Topic :: Software Development :: Libraries :: Python Modules"
    ],
    ext_modules=[get_spglib_ext()],
    scripts=[os.path.join("scripts", f) for f in os.listdir("scripts")]
)
<|endoftext|>