setup.py 2.24 KB
Newer Older
Jérémy Bobbio's avatar
Jérémy Bobbio committed
1
#!/usr/bin/env python3
Jérémy Bobbio's avatar
Jérémy Bobbio committed
2

Mattia Rizzolo's avatar
Mattia Rizzolo committed
3 4
from __future__ import print_function

Chris Lamb's avatar
Chris Lamb committed
5
import sys
Chris Lamb's avatar
Chris Lamb committed
6 7
import diffoscope

Jérémy Bobbio's avatar
Jérémy Bobbio committed
8
from setuptools import setup, find_packages
9
from setuptools.command.test import test as TestCommand
Jérémy Bobbio's avatar
Jérémy Bobbio committed
10

11

12 13
if sys.version_info < (3, 5):
    print("diffoscope requires at least python 3.5", file=sys.stderr)
Mattia Rizzolo's avatar
Mattia Rizzolo committed
14
    sys.exit(1)
15 16


17 18 19 20
class PyTest(TestCommand):
    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

    def initialize_options(self):
21
        super().initialize_options()
22 23 24
        self.pytest_args = []

    def finalize_options(self):
25
        super().finalize_options()
26 27

    def run_tests(self):
Chris Lamb's avatar
Chris Lamb committed
28
        # Inline import, otherwise the eggs aren't loaded
29 30 31 32
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)

Chris Lamb's avatar
Chris Lamb committed
33

34 35 36 37 38 39 40 41 42
setup(
    name='diffoscope',
    version=diffoscope.VERSION,
    description='in-depth comparison of files, archives, and directories',
    long_description=open('README.rst', encoding='utf-8').read(),
    author='Lunar',
    author_email='lunar@debian.org',
    license='GPL-3+',
    url='https://diffoscope.org/',
Ximin Luo's avatar
Ximin Luo committed
43
    packages=find_packages(exclude=['tests', 'tests.*']),
44
    tests_require=['pytest'],
45
    cmdclass={'test': PyTest},
46 47
    entry_points={
        'console_scripts': [
48
            'diffoscope=diffoscope.main:main'
49 50 51 52 53 54
        ],
    },
    install_requires=[
        'python-magic',
        'libarchive-c',
    ],
55 56
    extras_require={
        'distro_detection': ['distro'],
57 58 59 60 61 62 63
        'cmdline': ['argcomplete', 'progressbar'],
        'comparators': [
            'binwalk',
            'defusedxml',
            'guestfs',
            'jsondiff',
            'python-debian',
64
            'pypdf2',
65 66 67 68
            'pyxattr',
            'rpm-python',
            'tlsh',
        ],
69
    },
70
    python_requires='>=3.5',
71 72 73 74 75 76 77 78
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
        'Operating System :: POSIX',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
79
        'Programming Language :: Python :: 3.6',
80
        'Programming Language :: Python :: 3.7',
81 82 83
        'Topic :: Utilities',
    ],
)