1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4#         PySceneDetect: Python-Based Video Scene Detector
5#   ---------------------------------------------------------------
6#     [  Site: http://www.bcastell.com/projects/PySceneDetect/   ]
7#     [  Github: https://github.com/Breakthrough/PySceneDetect/  ]
8#     [  Documentation: http://pyscenedetect.readthedocs.org/    ]
9#
10# Copyright (C) 2014-2020 Brandon Castellano <http://www.bcastell.com>.
11#
12
13""" PySceneDetect setup.py
14
15To install PySceneDetect:
16
17    python setup.py install
18
19To run the PySceneDetect unit tests (requires testvideo.mp4, link below):
20
21    python setup.py test
22
23You can obtain the required testvideo.mp4 from the PySceneDetect [resources
24branch](https://github.com/Breakthrough/PySceneDetect/tree/resources) on Github,
25or the following URL:
26
27    https://raw.githubusercontent.com/Breakthrough/PySceneDetect/resources/tests/testvideo.mp4
28
29"""
30
31# Standard Library Imports
32import sys
33
34from setuptools import setup
35
36
37# TODO: Come up with plan/time for deprecation of Python 2.7.
38if sys.version_info < (2, 7) or (sys.version_info >= (3, 0) and sys.version_info < (3, 3)):
39    print('PySceneDetect requires at least Python 2.7 or 3.3 to run.')
40    sys.exit(1)
41
42
43def get_requires():
44    # type: () -> List[str]
45    """ Get Requires: Returns a list of required packages. """
46    return [
47        'Click',
48        'numpy',
49        'tqdm'
50    ]
51
52def get_extra_requires():
53    # type: () -> Dict[str, List[str]]
54    """ Get Extra Requires: Returns a list of extra/optional packages. """
55    return {
56        # TODO: Abstract this into a function that generates this
57        # dictionary based on a list of compatible Python & opencv-python
58        # package versions (will need to use the output for requirements.txt).
59        # TODO: Is there a tool that can do this automagically?
60        'opencv:python_version <= "3.5"':
61            ['opencv-python<=4.2.0.32'],
62        'opencv:python_version > "3.5"':
63            ['opencv-python'],
64
65        'opencv-headless:python_version <= "3.5"':
66            ['opencv-python-headless<=4.2.0.32'],
67        'opencv-headless:python_version > "3.5"':
68            ['opencv-python-headless'],
69    }
70
71
72setup(
73    name='scenedetect',
74    version='0.5.4.1',
75    description="A cross-platform, OpenCV-based video scene detection program and Python library. ",
76    long_description=open('package-info.rst').read(),
77    author='Brandon Castellano',
78    author_email='brandon248@gmail.com',
79    url='https://github.com/Breakthrough/PySceneDetect',
80    license="BSD 3-Clause",
81    keywords="video computer-vision analysis",
82    install_requires=get_requires(),
83    extras_require=get_extra_requires(),
84    setup_requires=['pytest-runner'],
85    tests_require=['pytest'],
86    packages=['scenedetect',
87              'scenedetect.cli',
88              'scenedetect.detectors',
89              'scenedetect.thirdparty'],
90    package_data={'': ['../LICENSE', '../USAGE.md', '../package-info.rst']},
91    #include_package_data = True,           # Must leave this to the default.
92    #test_suite="unitest.py",               # Auto-detects tests from setup.cfg
93    entry_points={"console_scripts": ["scenedetect=scenedetect:main"]},
94    classifiers=[
95        'Development Status :: 5 - Production/Stable',
96        'Environment :: Console',
97        'Environment :: Console :: Curses',
98        'Intended Audience :: Developers',
99        'Intended Audience :: End Users/Desktop',
100        'Intended Audience :: System Administrators',
101        'License :: OSI Approved :: MIT License',
102        'Operating System :: OS Independent',
103        'Programming Language :: Python :: 2',
104        'Programming Language :: Python :: 2.7',
105        'Programming Language :: Python :: 3',
106        'Programming Language :: Python :: 3.5',
107        'Programming Language :: Python :: 3.6',
108        'Programming Language :: Python :: 3.7',
109        'Programming Language :: Python :: 3.8',
110        'Topic :: Multimedia :: Video',
111        'Topic :: Multimedia :: Video :: Conversion',
112        'Topic :: Multimedia :: Video :: Non-Linear Editor',
113        'Topic :: Utilities'
114    ]
115)
116