Skip to content
Snippets Groups Projects
Commit 2cbd7feb authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[bob-devel] Improve bob-devel test to implement setuptools integrity tests for certain packages

parent a3358239
No related branches found
No related tags found
1 merge request!459Improve bob-devel test to implement setuptools integrity tests for certain packages
Pipeline #45696 passed
......@@ -2,6 +2,7 @@ import sys
# couple of imports to see if packages are working
import numpy
import pkg_resources
def test_pytorch():
......@@ -14,6 +15,20 @@ def test_pytorch():
assert out.shape[1] == 1000
if sys.platform.startswith("linux"):
# test if pytorch installation is sane
test_pytorch()
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment