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

Fix package name, find OpenCV version from sources

上级 17b4052a
......@@ -43,38 +43,38 @@ build_script:
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\lib\RELEASE\*.pyd" cv2
C:\Python27\python.exe setup.py bdist_wheel --opencv-version 0.0.0
C:\Python27\python.exe setup.py bdist_wheel
del cv2\*.pyd
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\lib\RELEASE\*.pyd" cv2
C:\Python27-x64\python.exe setup.py bdist_wheel --opencv-version 0.0.0
C:\Python27-x64\python.exe setup.py bdist_wheel
del cv2\*.pyd
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\lib\python3\Release\*.pyd" cv2
C:\Python35\python.exe setup.py bdist_wheel --opencv-version 0.0.0
C:\Python35\python.exe setup.py bdist_wheel
del cv2\*.pyd
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\lib\python3\Release\*.pyd" cv2
C:\Python35-x64\python.exe setup.py bdist_wheel --opencv-version 0.0.0
C:\Python35-x64\python.exe setup.py bdist_wheel
del cv2\*.pyd
before_test:
- cmd: >-
C:\Python27\Scripts\pip.exe install --no-index --find-links=dist cv2
C:\Python27\Scripts\pip.exe install --no-index --find-links=dist opencv-python
C:\Python27-x64\Scripts\pip.exe install --no-index --find-links=dist cv2
C:\Python27-x64\Scripts\pip.exe install --no-index --find-links=dist opencv-python
C:\Python35\Scripts\pip.exe install --no-index --find-links=dist cv2
C:\Python35\Scripts\pip.exe install --no-index --find-links=dist opencv-python
C:\Python35-x64\Scripts\pip.exe install --no-index --find-links=dist cv2
C:\Python35-x64\Scripts\pip.exe install --no-index --find-links=dist opencv-python
test_script:
- cmd: >-
......
......@@ -11,17 +11,25 @@ for package in pip.get_installed_distributions():
if package.key == "numpy":
numpy_version = package.version
# Get OpenCV version from command line args
opencv_version = ""
# dig the version from OpenCV sources
version_file_path = "opencv/modules/core/include/opencv2/core/version.hpp"
with open(version_file_path, 'r') as f:
for line in f:
words = line.split()
if "CV_VERSION_MAJOR" in words:
opencv_version += words[2]
opencv_version += "."
if "CV_VERSION_MINOR" in words:
opencv_version += words[2]
opencv_version += "."
if "CV_VERSION_REVISION" in words:
opencv_version += words[2]
# a bit hacky...
if "--opencv-version" in sys.argv:
index = sys.argv.index('--opencv-version')
sys.argv.pop(index)
opencv_version = sys.argv.pop(index)
else:
print("Error: no version info (--opencv-version missing), exiting.")
exit(1)
class BinaryDistribution(Distribution):
""" Forces BinaryDistribution. """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册