Commit d911bfa5 authored by Vincent POLLET's avatar Vincent POLLET

Add test for package integrity

parent 4e3fd1f8
Pipeline #47335 passed with stage
in 10 minutes and 21 seconds
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment