提交 a13313c8 编写于 作者: O Olli-Pekka Heinisuo

add support for new package, contrib modules seem to be working now with static build on Windows

上级 c4c52ca4
......@@ -121,5 +121,4 @@ artifacts:
name: wheels
deploy_script:
- cd %APPVEYOR_BUILD_FOLDER%
- if "%APPVEYOR_REPO_TAG%"=="true" ("%PYTHON%/python.exe" -m twine upload -u %USER% -p %PASS% --skip-existing dist/opencv*) else (echo "Tag not set, deployment skipped.")
- deploy.cmd
\ No newline at end of file
cd %APPVEYOR_BUILD_FOLDER%
if %ENABLE_CONTRIB% EQU 1 (
echo "This is contrib build. Deplyoment will be done to to PyPI entry opencv-contrib-python."
if "%APPVEYOR_REPO_TAG%"=="true" ("%PYTHON%/python.exe" -m twine upload -u %USER% -p %PASS% --skip-existing dist/opencv*) else (echo "Tag not set, deployment skipped.")
) else (
echo "This is default build. Deplyoment will be done to to PyPI entry opencv-python."
if "%APPVEYOR_REPO_TAG%"=="true" ("%PYTHON%/python.exe" -m twine upload -u %USER% -p %PASS% --skip-existing dist/opencv*) else (echo "Tag not set, deployment skipped.")
)
\ No newline at end of file
......@@ -5,6 +5,15 @@ import os
import sys
import io
contrib_build = False
package_name = "opencv-python"
if int(os.getenv('ENABLE_CONTRIB', 0)) == 1:
contrib_build = True
if contrib_build:
package_name = "opencv-contrib-python"
long_description = ""
with io.open('README.rst', encoding="utf-8") as f:
......@@ -20,6 +29,14 @@ for package in pip.get_installed_distributions():
if package.key == "numpy":
numpy_version = package.version
package_data = {}
if os.name == 'posix':
package_data['cv2'] = ['*.so']
else:
package_data['cv2'] = ['*.pyd', '*.dll']
class BinaryDistribution(Distribution):
""" Forces BinaryDistribution. """
def has_ext_modules(self):
......@@ -28,19 +45,12 @@ class BinaryDistribution(Distribution):
def is_pure(self):
return False
package_data = {}
if os.name == 'posix':
package_data['cv2'] = ['*.so']
else:
package_data['cv2'] = ['*.pyd', '*.dll']
setup(name='opencv-python',
setup(name=package_name,
version=opencv_version,
url='https://github.com/skvark/opencv-python',
license='MIT',
description='Wrapper package for OpenCV python bindings.',
long_description = long_description,
long_description=long_description,
distclass=BinaryDistribution,
packages=['cv2'],
package_data=package_data,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册