-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsetup.py
59 lines (50 loc) · 1.39 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
#!/usr/bin/env python3
import sys
from glob import glob
from setuptools import setup, find_packages
from setuptools.extension import Extension
from pyv4l2 import __version__
try:
sys.argv.remove('--use-cython')
USE_CYTHON = True
except ValueError:
USE_CYTHON = False
extension_name = 'pyx' if USE_CYTHON else 'c'
extensions = [
Extension(
'pyv4l2.frame',
["pyv4l2/frame.%s" % extension_name],
libraries=["v4l2", ]
),
Extension(
'pyv4l2.control',
["pyv4l2/control.%s" % extension_name],
libraries=["v4l2", ]
)
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
setup(
name='pyv4l2',
version=__version__,
description='Simple v4l2 for pyv4l2',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Cython',
'Programming Language :: C',
'Topic :: Software Development :: Libraries'
],
author='duanhongyi',
author_email='duanhongyi@doopai.com',
url='https://github.com/duanhongyi/pyv4l2',
license='GNU Lesser General Public License v3 (LGPLv3)',
setup_requires=['Cython >= 0.18', ],
extras_require={
'examples': ['pillow', 'numpy'],
},
packages=find_packages(),
ext_modules=extensions,
)