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

fix line endings

上级 1180f1e1
environment:
USER:
secure: fXgF9uyy6sT0JoVOR7BoqA==
PASS:
secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys=
matrix:
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
matrix:
fast_finish: true
build_script:
- cmd: |
"%PYTHON%/python.exe" -m pip install --upgrade pip
"%PYTHON%/python.exe" -m pip install --upgrade setuptools
set "CI_BUILD=1" && "%PYTHON%/python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose
before_test:
- ps: |
cd ${Env:APPVEYOR_BUILD_FOLDER}\tests
$env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command"
&"${Env:PYTHON}/python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl")
if ($LastExitCode -ne 0) {throw $LastExitCode}
test_script:
- cmd: |
cd %APPVEYOR_BUILD_FOLDER%\tests
"%PYTHON%/python.exe" -m unittest test
artifacts:
- path: dist\opencv*.whl
name: wheels
deploy_script:
- ps: |
if (${Env:APPVEYOR_REPO_TAG} -eq "true") {
cd ${Env:APPVEYOR_BUILD_FOLDER}
if (${Env:ENABLE_CONTRIB} -eq 0) {
if (${Env:ENABLE_HEADLESS} -eq 0) {
echo "This is a default build. Deployment will be done to PyPI entry opencv-python."
}
else {
echo "This is a headless build. Deployment will be done to PyPI entry opencv-python-headless."
}
}
else {
if (${Env:ENABLE_HEADLESS} -eq 0) {
echo "This is a contrib build. Deployment will be done to PyPI entry opencv-contrib-python."
}
else {
echo "This is a headless contrib build. Deployment will be done to PyPI entry opencv-contrib-python-headless."
}
}
&"${Env:PYTHON}/python.exe" -m pip install twine
&"${Env:PYTHON}/python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv*
}
else {
echo "Tag not set, deployment skipped."
}
environment:
USER:
secure: fXgF9uyy6sT0JoVOR7BoqA==
PASS:
secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys=
matrix:
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 0
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 0
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python36-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python37-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python38-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
- PYTHON: "C:/Python39-x64"
ENABLE_CONTRIB: 1
ENABLE_HEADLESS: 1
matrix:
fast_finish: true
build_script:
- cmd: |
"%PYTHON%/python.exe" -m pip install --upgrade pip
"%PYTHON%/python.exe" -m pip install --upgrade setuptools
set "CI_BUILD=1" && "%PYTHON%/python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose
before_test:
- ps: |
cd ${Env:APPVEYOR_BUILD_FOLDER}\tests
$env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command"
&"${Env:PYTHON}/python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl")
if ($LastExitCode -ne 0) {throw $LastExitCode}
test_script:
- cmd: |
cd %APPVEYOR_BUILD_FOLDER%\tests
"%PYTHON%/python.exe" -m unittest test
artifacts:
- path: dist\opencv*.whl
name: wheels
deploy_script:
- ps: |
if (${Env:APPVEYOR_REPO_TAG} -eq "true") {
cd ${Env:APPVEYOR_BUILD_FOLDER}
if (${Env:ENABLE_CONTRIB} -eq 0) {
if (${Env:ENABLE_HEADLESS} -eq 0) {
echo "This is a default build. Deployment will be done to PyPI entry opencv-python."
}
else {
echo "This is a headless build. Deployment will be done to PyPI entry opencv-python-headless."
}
}
else {
if (${Env:ENABLE_HEADLESS} -eq 0) {
echo "This is a contrib build. Deployment will be done to PyPI entry opencv-contrib-python."
}
else {
echo "This is a headless contrib build. Deployment will be done to PyPI entry opencv-contrib-python-headless."
}
}
&"${Env:PYTHON}/python.exe" -m pip install twine
&"${Env:PYTHON}/python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv*
}
else {
echo "Tag not set, deployment skipped."
}
import importlib
import os
import sys
from .cv2 import *
from .data import *
# wildcard import above does not import "private" variables like __version__
# this makes them available
globals().update(importlib.import_module("cv2.cv2").__dict__)
ci_and_not_headless = False
try:
from .version import ci_build, headless
ci_and_not_headless = ci_build and not headless
except:
pass
# the Qt plugin is included currently only in the pre-built wheels
if (
sys.platform == "darwin" or sys.platform.startswith("linux")
) and ci_and_not_headless:
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "plugins"
)
# Qt will throw warning on Linux if fonts are not found
if sys.platform.startswith("linux") and ci_and_not_headless:
os.environ["QT_QPA_FONTDIR"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "fonts"
)
import importlib
import os
import sys
from .cv2 import *
from .data import *
# wildcard import above does not import "private" variables like __version__
# this makes them available
globals().update(importlib.import_module("cv2.cv2").__dict__)
ci_and_not_headless = False
try:
from .version import ci_build, headless
ci_and_not_headless = ci_build and not headless
except:
pass
# the Qt plugin is included currently only in the pre-built wheels
if (
sys.platform == "darwin" or sys.platform.startswith("linux")
) and ci_and_not_headless:
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "plugins"
)
# Qt will throw warning on Linux if fonts are not found
if sys.platform.startswith("linux") and ci_and_not_headless:
os.environ["QT_QPA_FONTDIR"] = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "qt", "fonts"
)
import sys
import os
import subprocess
if __name__ == "__main__":
contrib = sys.argv[1]
headless = sys.argv[2]
ci_build = sys.argv[3]
opencv_version = ""
# dig out 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]
break
# used in local dev releases
git_hash = (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
.splitlines()[0]
.decode()
)
# this outputs the annotated tag if we are exactly on a tag, otherwise <tag>-<n>-g<shortened sha-1>
try:
tag = (
subprocess.check_output(
["git", "describe", "--tags"], stderr=subprocess.STDOUT
)
.splitlines()[0]
.decode()
.split("-")
)
except subprocess.CalledProcessError as e:
# no tags reachable (e.g. on a topic branch in a fork), see
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
if e.output.rstrip() == b"fatal: No names found, cannot describe anything.":
tag = []
else:
print(e.output)
raise
if len(tag) == 1:
# tag identifies the build and should be a sequential revision number
version = tag[0]
opencv_version += ".{}".format(version)
else:
# local version identifier, not to be published on PyPI
version = git_hash
opencv_version += "+{}".format(version)
with open("cv2/version.py", "w") as f:
f.write('opencv_version = "{}"\n'.format(opencv_version))
f.write("contrib = {}\n".format(contrib))
f.write("headless = {}\n".format(headless))
f.write("ci_build = {}".format(ci_build))
import sys
import os
import subprocess
if __name__ == "__main__":
contrib = sys.argv[1]
headless = sys.argv[2]
ci_build = sys.argv[3]
opencv_version = ""
# dig out 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]
break
# used in local dev releases
git_hash = (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
.splitlines()[0]
.decode()
)
# this outputs the annotated tag if we are exactly on a tag, otherwise <tag>-<n>-g<shortened sha-1>
try:
tag = (
subprocess.check_output(
["git", "describe", "--tags"], stderr=subprocess.STDOUT
)
.splitlines()[0]
.decode()
.split("-")
)
except subprocess.CalledProcessError as e:
# no tags reachable (e.g. on a topic branch in a fork), see
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
if e.output.rstrip() == b"fatal: No names found, cannot describe anything.":
tag = []
else:
print(e.output)
raise
if len(tag) == 1:
# tag identifies the build and should be a sequential revision number
version = tag[0]
opencv_version += ".{}".format(version)
else:
# local version identifier, not to be published on PyPI
version = git_hash
opencv_version += "+{}".format(version)
with open("cv2/version.py", "w") as f:
f.write('opencv_version = "{}"\n'.format(opencv_version))
f.write("contrib = {}\n".format(contrib))
f.write("headless = {}\n".format(headless))
f.write("ci_build = {}".format(ci_build))
此差异已折叠。
import unittest
import sys
class OpenCVTest(unittest.TestCase):
""" Simple functionality tests. """
def test_import(self):
""" Test that the cv2 module can be imported. """
import cv2
def test_video_capture(self):
import cv2
cap = cv2.VideoCapture("SampleVideo_1280x720_1mb.mp4")
self.assertTrue(cap.isOpened())
import unittest
import sys
class OpenCVTest(unittest.TestCase):
""" Simple functionality tests. """
def test_import(self):
""" Test that the cv2 module can be imported. """
import cv2
def test_video_capture(self):
import cv2
cap = cv2.VideoCapture("SampleVideo_1280x720_1mb.mp4")
self.assertTrue(cap.isOpened())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册