Source

Python Keyring Lib / setup.py

Full commit
jo...@Kang-Zhang… df8e9b7 




Kang Zhang dd16b30 
jo...@Kang-Zhang… df8e9b7 

Jonathan Ballet b7df08f 
Jason R. Coombs a0e2e10 
Kang Zhang 3728fd4 
Jason R. Coombs ff29f80 







Jason R. Coombs a0e2e10 








Jason R. Coombs 4335acb 


Jason R. Coombs a0e2e10 
Patrick Mézard 932d2cc 
Jason R. Coombs 4335acb 






Jason R. Coombs 2dc286f 


Jason R. Coombs 0b38f48 
Jason R. Coombs cd3728f 
Jason R. Coombs 57843a6 
Jason R. Coombs c998152 
Jason R. Coombs 2dc286f 



Jason R. Coombs 161e644 
Jason R. Coombs 2dc286f 



Jason R. Coombs bb4e3db 

Jason R. Coombs 6092b5a 
Jason R. Coombs bb4e3db 
Jason R. Coombs 51c69b7 
Jason R. Coombs bb4e3db 
Jason R. Coombs dd75825 



Jason R. Coombs 2dc286f 
Jason R. Coombs ff3a254 
Jason R. Coombs 77b74c8 







Jason R. Coombs bb4e3db 


Jason R. Coombs 2dc286f 




Jonathan Ballet d509004 




Jason R. Coombs bb4e3db 
Kang Zhang f0fcee8 
Jonathan Ballet 9e608cc 
Jason R. Coombs ff29f80 
Jason R. Coombs d82346c 



Jonathan Ballet 9e608cc 
Jason R. Coombs bb4e3db 
Jason R. Coombs ff29f80 
#!/usr/bin/env python
# encoding: utf-8
"""
setup.py

Setup the Keyring Lib for Python.
"""

import sys
import codecs

try:
    import setuptools
    setup_mod = setuptools
    "where to find setup()"
except ImportError:
    import distutils.core
    setup_mod = distutils.core

def load(filename):
    """
    Read a text file and decode it.
    """
    f = codecs.open(filename, encoding='utf-8')
    try:
        result = f.read()
    finally:
        f.close()
    if not encodes_as_ascii(result):
        # see https://bitbucket.org/kang/python-keyring-lib/issue/55
        raise ValueError("distutils requires ASCII")
    return result

def encodes_as_ascii(string):
    try:
        string.encode('ascii')
    except UnicodeEncodeError:
        return False
    return True


test_requirements = [
    'pytest',
    'gdata',
    'python-keyczar',
    'fs',
    'mock',
]
"dependencies for running tests"

if sys.version_info < (2, 7) or (
        sys.version_info >= (3, 0) and sys.version_info < (3, 1)):
    # Require unittest2 for Python which doesn't contain the new unittest
    # module (appears in Python 2.7 and Python 3.1)
    test_requirements.append('unittest2')

setup_params = dict(
    name = 'keyring',
    version = "1.2",
    description = "Store and access your passwords safely.",
    url = "http://bitbucket.org/kang/python-keyring-lib",
    keywords = "keyring Keychain GnomeKeyring Kwallet password storage",
    author = "Kang Zhang",
    author_email = "jobo.zh@gmail.com",
    maintainer = 'Jason R. Coombs',
    maintainer_email = 'jaraco@jaraco.com',
    license = "PSF",
    long_description = load('README.rst') + load('CHANGES.rst'),
    classifiers = [
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "Programming Language :: Python :: 2.5",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
    ],
    platforms = ["Many"],
    packages = ['keyring', 'keyring.tests', 'keyring.util',
                'keyring.backends'],
    extras_require = {'test': test_requirements},
    tests_require = test_requirements,
    setup_requires = [
        'pytest-runner',
    ],
    entry_points = {
        'console_scripts': [
            'keyring=keyring.cli:main',
        ],
    },
)


if sys.version_info >= (3, 0):
    setup_params.update(
        use_2to3=True,
    )


if __name__ == '__main__':
    setup_mod.setup(**setup_params)