diff --git a/conda/opencv/run_test.py b/conda/opencv/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9599bcc168d9c63d6ef152f2d3c49c56d6c7dd93 --- /dev/null +++ b/conda/opencv/run_test.py @@ -0,0 +1,30 @@ +import sys + +# couple of imports to see if packages are working +import cv2 +import pkg_resources + + +def test_pytorch(): + 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('pytorch', 'torch') + _check_package('torchvision') + + +# test if pytorch installation is sane +test_pytorch() +test_setuptools_integrity() \ No newline at end of file