M2Crypto uses still python setup.py test
for calling its test suite. When I tried to switch to python -munittest discover -v
I get this error:
[ 25s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-M2Crypto-0.36.0-0.x86_64/usr/lib64/python3.8/site-packages
[ 25s] + PYTHONDONTWRITEBYTECODE=1
[ 25s] + python3 -m unittest discover -s tests -v
...
[ 25s] ======================================================================
[ 25s] ERROR: test_aes (unittest.loader._FailedTest)
[ 25s] ----------------------------------------------------------------------
[ 25s] ImportError: Failed to import test module: test_aes
[ 25s] Traceback (most recent call last):
[ 25s] File "/usr/lib64/python3.8/unittest/loader.py", line 436, in _find_test_path
[ 25s] module = self._get_module_from_name(name)
[ 25s] File "/usr/lib64/python3.8/unittest/loader.py", line 377, in _get_module_from_name
[ 25s] __import__(name)
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/tests/test_aes.py", line 9, in <module>
[ 25s] from M2Crypto import m2
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/M2Crypto/__init__.py", line 30, in <module>
[ 25s] from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err,
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/M2Crypto/ASN1.py", line 15, in <module>
[ 25s] from M2Crypto import BIO, m2, py27plus, six
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/M2Crypto/BIO.py", line 9, in <module>
[ 25s] from M2Crypto import m2, py27plus, six
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/M2Crypto/m2.py", line 30, in <module>
[ 25s] from M2Crypto.m2crypto import *
[ 25s] File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.36.0/M2Crypto/m2crypto.py", line 13, in <module>
[ 25s] from ._m2crypto import *
[ 25s] ModuleNotFoundError: No module named 'M2Crypto._m2crypto'
...
abuild@stitny:~> ls /home/abuild/rpmbuild/BUILDROOT/python-M2Crypto-0.36.0-0.x86_64/usr/lib64/python3.8/site-packages/M2Crypto
ASN1.py BN.py EC.py Err.py Rand.py X509.py _m2crypto.cpython-38-x86_64-linux-gnu.so httpslib.py m2urllib.py six.py
AuthCookie.py DH.py EVP.py RC4.py SMIME.py __init__.py callback.py m2.py m2urllib2.py threading.py
BIO.py DSA.py Engine.py RSA.py SSL __pycache__ ftpslib.py m2crypto.py m2xmlrpclib.py util.py
abuild@stitny:~>
The binary module is certainly in the directory included in sys.path
, but that is apparently not enough. Is there some other variable I need to set ($PYTHONCPATH
or something)? How are binary modules located?