setup.py 1.65 KB
Newer Older
1
import sys
2 3
import setuptools
from setuptools.command.test import test as TestCommand
4

5 6 7
__package_name__ = 'portalocker'
__author__ = 'Rick van Hattem'
__email__ = 'wolph@wol.ph'
8
__version__ = '0.5.7'
9 10
__description__ = '''Wraps the portalocker recipe for easy usage'''
__url__ = 'https://github.com/WoLpH/portalocker'
11

12 13 14 15 16
extra = {}
if sys.version_info >= (3, 0):
    extra.update(use_2to3=True)


17
class PyTest(TestCommand):
18

19 20 21 22
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = ['tests']
        self.test_suite = True
23

24
    def run_tests(self):
25
        # import here, cause outside the eggs aren't loaded
26 27 28
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)
29

30

31 32 33 34 35
if __name__ == '__main__':
    setuptools.setup(
        name=__package_name__,
        version=__version__,
        description=__description__,
36
        long_description=open('README.rst').read(),
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
        classifiers=[
            'Intended Audience :: Developers',
            'Programming Language :: Python',
            'Programming Language :: Python :: 2.5',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.1',
        ],
        keywords='locking, locks, with statement, windows, linux, unix',
        author=__author__,
        author_email=__email__,
        url=__url__,
        license='PSF',
        packages=setuptools.find_packages(exclude=['ez_setup', 'examples']),
        zip_safe=False,
        platforms=['any'],
        cmdclass={'test': PyTest},
        **extra
    )