Run python tests without make install

In order to do this, we need to add some stub gi module init files which
allow us to extend the gi overrides path.
This commit is contained in:
Felix Bünemann 2016-05-08 04:35:08 +02:00
parent c5a4afbe40
commit 8b598d5b77
9 changed files with 25 additions and 16 deletions

View File

@ -772,8 +772,6 @@ fi
if test x"$enable_pyvips8" = x"yes"; then
PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.12.0])
pyoverridesdir="\$(pyexecdir)/gi/overrides"
AC_SUBST(pyoverridesdir)
fi
AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = x"yes")
@ -994,6 +992,9 @@ AC_OUTPUT([
tools/light_correct
tools/shrink_width
python/Makefile
python/packages/Makefile
python/packages/gi/Makefile
python/packages/gi/overrides/Makefile
test/Makefile
test/variables.sh
swig/Makefile

View File

@ -1,17 +1,5 @@
vips_overridesdir = $(pyoverridesdir)
vips_overrides_PYTHON = Vips.py
SUBDIRS = packages
EXTRA_DIST = \
README.md
# if we build in a separate tree, we need to symlink the *.py files from the
# source tree; Python does not accept the extensions and modules in different
# paths
build_pylinks:
for f in $(vips_overrides_PYTHON); do \
[ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
done
all-local: build_pylinks
check-local: build_pylinks

View File

@ -0,0 +1 @@
SUBDIRS = gi

View File

@ -0,0 +1,5 @@
SUBDIRS = overrides
EXTRA_DIST = \
__init__.py

View File

@ -0,0 +1,3 @@
# support overrides in different directories than our gi module
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

View File

@ -0,0 +1,5 @@
vips_overridesdir = $(pyexecdir)/gi/overrides
vips_overrides_PYTHON = Vips.py
EXTRA_DIST = \
__init__.py

View File

@ -0,0 +1,3 @@
# support overrides in different directories than our gi module
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

View File

@ -1,4 +1,7 @@
#!/usr/bin/python3
#!/usr/bin/env python
import sys
sys.path.append('../python/packages')
import unittest