forked from opencv/opencv-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
40 lines (32 loc) · 981 Bytes
/
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
from setuptools import setup
from setuptools.dist import Distribution
import pip
import os
import sys
# cv_version.py should be generated by running find_version.py
from cv_version import opencv_version
numpy_version = ""
# Get required numpy version
for package in pip.get_installed_distributions():
if package.key == "numpy":
numpy_version = package.version
class BinaryDistribution(Distribution):
""" Forces BinaryDistribution. """
def has_ext_modules(asd):
return True
def is_pure(self):
return False
package_data = {}
if os.name == 'posix':
package_data['cv2'] = ['*.so']
else:
package_data['cv2'] = ['*.pyd']
setup(name='opencv-python',
version=opencv_version,
description='OpenCV',
distclass=BinaryDistribution,
packages=['cv2'],
package_data=package_data,
include_package_data=True,
install_requires="numpy==%s" % numpy_version,
)