pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python Add DISTUTILS_BUILDDIR_IN_TEST_ENV as flag...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/54b6e28bde96
branches:  trunk
changeset: 364707:54b6e28bde96
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Jul 03 18:14:40 2017 +0000

description:
Add DISTUTILS_BUILDDIR_IN_TEST_ENV as flag to get the build directory
into PYTHONPATH for testing.

diffstat:

 lang/python/distutils-builddir.py |  7 +++++++
 lang/python/extension.mk          |  9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 3dfc07426a3b -r 54b6e28bde96 lang/python/distutils-builddir.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python/distutils-builddir.py Mon Jul 03 18:14:40 2017 +0000
@@ -0,0 +1,7 @@
+from os import getcwd
+from os.path import join
+from distutils.dist import Distribution
+from distutils.command.build import build
+b = build(Distribution())
+b.finalize_options()
+print(join(getcwd(), b.build_platlib))
diff -r 3dfc07426a3b -r 54b6e28bde96 lang/python/extension.mk
--- a/lang/python/extension.mk  Mon Jul 03 18:13:43 2017 +0000
+++ b/lang/python/extension.mk  Mon Jul 03 18:14:40 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: extension.mk,v 1.50 2017/05/17 11:17:04 wiz Exp $
+# $NetBSD: extension.mk,v 1.51 2017/07/03 18:14:40 joerg Exp $
 
 .include "../../lang/python/pyversion.mk"
 
@@ -76,3 +76,10 @@
 PRINT_PLIST_AWK+=      gsub(/opt-1\.pyc$$/, "pyo")
 PRINT_PLIST_AWK+=      gsub(/\.cpython-${_PYTHON_VERSION}/, "")}
 .endif
+
+DISTUTILS_BUILDDIR_IN_TEST_ENV?=       no
+
+.if ${DISTUTILS_BUILDDIR_IN_TEST_ENV} == "yes"
+DISTUTILS_BUILDDIR_CMD=        cd ${WRKSRC} && ${PYTHONBIN} ${.CURDIR}/../../lang/python/distutils-builddir.py
+TEST_ENV+=     PYTHONPATH=${DISTUTILS_BUILDDIR_CMD:sh}
+.endif



Home | Main Index | Thread Index | Old Index