Skip to content

Commit a13313c

Browse files
committed
add support for new package, contrib modules seem to be working now with static build on Windows
1 parent c4c52ca commit a13313c

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,4 @@ artifacts:
121121
name: wheels
122122

123123
deploy_script:
124-
- cd %APPVEYOR_BUILD_FOLDER%
125-
- 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.")
124+
- deploy.cmd

deploy.cmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cd %APPVEYOR_BUILD_FOLDER%
2+
3+
if %ENABLE_CONTRIB% EQU 1 (
4+
5+
echo "This is contrib build. Deplyoment will be done to to PyPI entry opencv-contrib-python."
6+
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.")
7+
8+
) else (
9+
10+
echo "This is default build. Deplyoment will be done to to PyPI entry opencv-python."
11+
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.")
12+
13+
)

setup.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
import sys
66
import io
77

8+
contrib_build = False
9+
package_name = "opencv-python"
10+
11+
if int(os.getenv('ENABLE_CONTRIB', 0)) == 1:
12+
contrib_build = True
13+
14+
if contrib_build:
15+
package_name = "opencv-contrib-python"
16+
817
long_description = ""
918

1019
with io.open('README.rst', encoding="utf-8") as f:
@@ -20,6 +29,14 @@
2029
if package.key == "numpy":
2130
numpy_version = package.version
2231

32+
package_data = {}
33+
34+
if os.name == 'posix':
35+
package_data['cv2'] = ['*.so']
36+
else:
37+
package_data['cv2'] = ['*.pyd', '*.dll']
38+
39+
2340
class BinaryDistribution(Distribution):
2441
""" Forces BinaryDistribution. """
2542
def has_ext_modules(self):
@@ -28,19 +45,12 @@ def has_ext_modules(self):
2845
def is_pure(self):
2946
return False
3047

31-
package_data = {}
32-
33-
if os.name == 'posix':
34-
package_data['cv2'] = ['*.so']
35-
else:
36-
package_data['cv2'] = ['*.pyd', '*.dll']
37-
38-
setup(name='opencv-python',
48+
setup(name=package_name,
3949
version=opencv_version,
4050
url='https://github.com/skvark/opencv-python',
4151
license='MIT',
4252
description='Wrapper package for OpenCV python bindings.',
43-
long_description = long_description,
53+
long_description=long_description,
4454
distclass=BinaryDistribution,
4555
packages=['cv2'],
4656
package_data=package_data,

0 commit comments

Comments
 (0)