Skip to content
Snippets Groups Projects
Commit c639de2c authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Add test for package integrity

parent 4e3fd1f8
No related branches found
No related tags found
1 merge request!466Fix run exports in opencv
......@@ -41,7 +41,7 @@ source:
sha256: 78884f64b564a3b06dc6ee731ed33b60c6d8cd864cea07f21d94ba0f90c7b310 # [unix]
build:
number: 0
number: 1
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}_{{ PKG_BUILDNUM }}
run_exports:
# https://abi-laboratory.pro/index.php?view=timeline&l=opencv
......@@ -175,6 +175,9 @@ outputs:
run:
- {{ pin_subpackage('libopencv', exact=True) }}
- {{ pin_subpackage('py-opencv', exact=True) }}
- {{ pin_compatible('setuptools') }}
test:
script: run_test_opencv.py
- name: py-opencv
build:
......
import sys
# couple of imports to see if packages are working
import cv2
import pkg_resources
def test_opencv():
import cv2
print("opencv version: ", cv2.__version__)
def _check_package(name, pyname=None):
"""Checks if a Python package can be `require()`'d"""
pyname = pyname or name
print(f"Checking Python setuptools integrity for {name} (pyname: {pyname})")
pkg_resources.require(pyname)
def test_setuptools_integrity():
_check_package('opencv', 'cv2')
# test if opencv installation is sane
test_opencv()
test_setuptools_integrity()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment