setup.py 2.1 KB
Newer Older
O
Olli-Pekka Heinisuo 已提交
1
from setuptools import setup
2 3
from setuptools.dist import Distribution
import pip
O
Olli-Pekka Heinisuo 已提交
4 5
import os
import sys
6
import io
7 8 9

long_description = ""

10 11
with io.open('README.rst', encoding="utf-8") as f:
    long_description = f.read()
O
Olli-Pekka Heinisuo 已提交
12

13 14
# cv_version.py should be generated by running find_version.py
from cv_version import opencv_version
15

16 17 18 19 20 21 22 23 24
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. """
O
Olli-Pekka Heinisuo 已提交
25
    def has_ext_modules(self):
26 27
        return True

28 29 30
    def is_pure(self):
        return False

O
Olli-Pekka Heinisuo 已提交
31 32 33
package_data = {}

if os.name == 'posix':
O
fixes  
Olli-Pekka Heinisuo 已提交
34
    package_data['cv2'] = ['*.so']
O
Olli-Pekka Heinisuo 已提交
35
else:
36
    package_data['cv2'] = ['*.pyd', '*.dll']
O
Olli-Pekka Heinisuo 已提交
37 38 39

setup(name='opencv-python',
      version=opencv_version,
40 41 42 43
      url='https://github.com/skvark/opencv-python',
      license='MIT',
      description='Wrapper package for OpenCV python bindings.',
      long_description = long_description,
44
      distclass=BinaryDistribution,
O
Olli-Pekka Heinisuo 已提交
45 46
      packages=['cv2'],
      package_data=package_data,
47 48
      maintainer="Olli-Pekka Heinisuo",
      include_package_data=True,
49
      install_requires="numpy>=%s" % numpy_version,
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
      classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Intended Audience :: Education',
        'Intended Audience :: Information Technology',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Operating System :: Unix',
        'Programming Language :: Python',
        'Programming Language :: C++',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Scientific/Engineering',
        'Topic :: Scientific/Engineering :: Image Recognition',
        'Topic :: Software Development',
        ]
69
      )