Skip to content

Commit 5180290

Browse files
committed
python: run swig python tests from a virtualenv
This ensures that we are testing the built wallycore wheel.
1 parent 346473f commit 5180290

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/Makefile.am

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ swig_python/swig_python_wrap.c : swig_python/swig.i swig_python/python_extra.py_
5454
cat swig_python/wallycore.py swig_python/python_extra.py_in > swig_python/wallycore/__init__.py && \
5555
rm swig_python/wallycore.py
5656

57-
PYTHON_SWIGTEST = PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=.libs:swig_python $(PYTHON)
58-
5957
clean-swig-python:
6058
$(AM_V_at)rm -f swig_python/swig_python_wrap.c swig_python/wallycore/__init__.py
6159
clean-local: clean-swig-python
@@ -339,20 +337,23 @@ if BUILD_ELEMENTS
339337
endif
340338

341339
if USE_SWIG_PYTHON
342-
check-swig-python: $(SWIG_PYTHON_TEST_DEPS)
343-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/aes.py
344-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/bip32.py
345-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/coinselection.py
346-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/descriptor.py
347-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/mnemonic.py
348-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/psbt.py
349-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/sha.py
350-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/signmessage.py
351-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/tx.py
352-
$(AM_V_at)$(PYTHON_SWIGTEST) pyexample/anti-exfil.py
340+
check-swig-python:
341+
$(AM_V_at)$(PYTHON) -m virtualenv $(top_builddir)/venv
342+
$(AM_V_at)$(top_builddir)/venv/bin/python -m pip install $(top_srcdir)
343+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/aes.py
344+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/aes.py
345+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/bip32.py
346+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/coinselection.py
347+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/descriptor.py
348+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/mnemonic.py
349+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/psbt.py
350+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/sha.py
351+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/signmessage.py
352+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/tx.py
353+
$(AM_V_at)$(top_builddir)/venv/bin/python pyexample/anti-exfil.py
353354
if BUILD_ELEMENTS
354-
$(AM_V_at)$(PYTHON_SWIGTEST) swig_python/contrib/elements_tx.py
355-
$(AM_V_at)$(PYTHON_SWIGTEST) pyexample/liquid/receive-send.py
355+
$(AM_V_at)$(top_builddir)/venv/bin/python swig_python/contrib/elements_tx.py
356+
$(AM_V_at)$(top_builddir)/venv/bin/python pyexample/liquid/receive-send.py
356357
endif
357358
else # USE_SWIG_PYTHON
358359
check-swig-python: ;

0 commit comments

Comments
 (0)