forked from scikit-video/scikit-video
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
106 lines (91 loc) · 3.59 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env python
descr = """\
This library provides easy access to common as well as
state-of-the-art video processing routines. Check out the
website for more details.
"""
DISTNAME = 'scikit-video'
DESCRIPTION = 'Video Processing in Python'
LONG_DESCRIPTION = descr
MAINTAINER = 'Todd Goodall',
MAINTAINER_EMAIL = '[email protected]',
URL = 'http://scikit-video.org/'
LICENSE = 'BSD'
DOWNLOAD_URL = 'https://github.com/scikit-video/scikit-video'
PACKAGE_NAME = 'scikit-video'
EXTRA_INFO = dict(
install_requires=['numpy', 'scipy', 'pillow'],
classifiers=['Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Topic :: Multimedia :: Video',
'Topic :: Scientific/Engineering']
)
import os
import sys
import subprocess
import setuptools
from setuptools import setup
# https://packaging.python.org/guides/single-sourcing-package-version/
import codecs
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def configuration(parent_package='', top_path=None, package_name=PACKAGE_NAME):
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
from numpy.distutils.misc_util import Configuration
config = Configuration(None, parent_package, top_path)
# Avoid non-useful msg: "Ignoring attempt to set 'name' (from ... "
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)
config.add_subpackage('skvideo')
return config
# Documentation building command
try:
from sphinx.setup_command import BuildDoc as SphinxBuildDoc
class BuildDoc(SphinxBuildDoc):
"""Run in-place build before Sphinx doc build"""
def run(self):
ret = subprocess.call([sys.executable, sys.argv[0], 'build_ext', '-i'])
if ret != 0:
raise RuntimeError("Building Scipy failed!")
SphinxBuildDoc.run(self)
cmdclass = {'build_sphinx': BuildDoc}
except ImportError:
cmdclass = {}
# Call the setup function
if __name__ == "__main__":
setup(configuration=configuration,
packages=setuptools.find_packages(),
name=DISTNAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
license=LICENSE,
url=URL,
download_url=DOWNLOAD_URL,
long_description=LONG_DESCRIPTION,
include_package_data=True,
test_suite="nose.collector",
cmdclass=cmdclass,
version=find_version("skvideo", "__init__.py"),
package_data={'': ['data/*']},
**EXTRA_INFO)