Skip version number checking with debug builds

Because I found a way to build the extension module directly which helps speed up development immensely
This commit is contained in:
Andrew Cassidy 2022-05-24 20:47:55 -07:00
parent 468414f339
commit c57106e3b2
3 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,7 @@
try:
from _quicktex import *
from _quicktex import __version__
from _quicktex import _debug_build
except ImportError as e:
if 'libomp.dylib' in e.msg:
print('\033[41m\033[01mERROR: LIBOMP NOT FOUND! PLEASE INSTALL IT WITH \033[04m`brew install libomp`\033[0m')

View File

@ -48,6 +48,12 @@ PYBIND11_MODULE(_quicktex, m) {
m.attr("__version__") = "dev";
#endif
#ifdef NDEBUG
m.attr("_debug_build") = false;
#else
m.attr("_debug_build") = true;
#endif
py::options options;
// Texture

View File

@ -1,9 +1,11 @@
"""Test if everything is installed correctly"""
import pytest
import quicktex
class TestInstall:
@pytest.mark.skipif(quicktex._debug_build, reason="Debug builds dont have valid version strings")
def test_version(self):
"""Test if the extension module version matches what setuptools returns"""
try:
@ -16,4 +18,4 @@ class TestInstall:
version = metadata.version('quicktex')
assert version == quicktex.__version__, 'incorrect version string from extension module'
assert version == quicktex.__version__