Skip to content

Commit

Permalink
Fix "make install" of Python. Remove old code and restructure the Pyt…
Browse files Browse the repository at this point in the history
…hon sources under lang/python to simplify the installation step.

--HG--
rename : lang/python/fpacking.py => lang/python/wiredtiger/fpacking.py
rename : lang/python/intpack-test.py => lang/python/wiredtiger/intpack-test.py
rename : lang/python/intpacking.py => lang/python/wiredtiger/intpacking.py
rename : lang/python/packing-test.py => lang/python/wiredtiger/packing-test.py
rename : lang/python/packing.py => lang/python/wiredtiger/packing.py
  • Loading branch information
Michael Cahill committed Jul 17, 2013
1 parent ba05f74 commit 1fb7075
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 6,408 deletions.
2 changes: 1 addition & 1 deletion .hgignore
Expand Up @@ -18,7 +18,7 @@
^docs/latex
^docs/python
^docs/swig
^lang/python/(wiredtiger.py|wiredtiger_wrap.c)
^lang/python/(wiredtiger/__init__.py|wiredtiger_wrap.c)
^releases
^src/server
^test/bt/(CONFIG|__rand|__wt.bdb|__wt.run|__wt.wt|db|t|vgout\..*)
6 changes: 6 additions & 0 deletions build_posix/aclocal/options.m4
Expand Up @@ -80,6 +80,12 @@ esac
AC_MSG_RESULT($wt_cv_enable_python)
AM_CONDITIONAL([PYTHON], [test x$wt_cv_enable_python = xyes])
AC_MSG_CHECKING(if --with-python-prefix option specified)
AC_ARG_WITH(python-prefix,
[AS_HELP_STRING([--with-python-prefix=DIR],
[Installation prefix for Python module.])])
AC_MSG_RESULT($with_python_prefix)
AC_MSG_CHECKING(if --enable-snappy option specified)
AC_ARG_ENABLE(snappy,
[AS_HELP_STRING([--enable-snappy],
Expand Down
2 changes: 2 additions & 0 deletions build_posix/configure.ac.in
Expand Up @@ -72,6 +72,8 @@ fi

if test "$wt_cv_enable_python" = "yes"; then
AM_PATH_PYTHON([2.6])
PYTHON_PREFIX=$with_python_prefix
AC_SUBST(PYTHON_PREFIX)
fi

AM_TYPES
Expand Down
14 changes: 10 additions & 4 deletions lang/python/Makefile.am
Expand Up @@ -5,18 +5,24 @@ if DEBUG
PY_SETUP_DEBUG = -g
endif
all-local: _wiredtiger.so

# We keep generated Python sources under lang/python: that's where they live
# in release packages.
$(PYSRC)/wiredtiger_wrap.c: $(top_srcdir)/src/include/wiredtiger.in $(PYSRC)/wiredtiger.i
@(cd $(PYSRC) && \
$(SWIG) -python -threads -O -Wall -nodefaultctor -nodefaultdtor -I$(abs_top_builddir) wiredtiger.i)
(cd $(PYSRC) && \
$(SWIG) -python -threads -O -Wall -nodefaultctor -nodefaultdtor -I$(abs_top_builddir) wiredtiger.i && \
mv wiredtiger.py wiredtiger/__init__.py)

_wiredtiger.so: $(top_builddir)/libwiredtiger.la $(PYSRC)/wiredtiger_wrap.c
$(PYTHON) $(PYSRC)/setup.py build_ext -b . -t . -f $(PY_SETUP_DEBUG)

install-exec-local:
$(PYTHON) $(PYSRC)/setup.py install_lib -b . --skip-build
$(PYTHON) $(PYSRC)/setup.py build_py -d build
$(PYTHON) $(PYSRC)/setup.py build_ext -b build -t . -f $(PY_SETUP_DEBUG)
$(PYTHON) $(PYSRC)/setup.py install_lib -b build --skip-build

clean-local:
$(PYTHON) $(PYSRC)/setup.py clean
rm -rf _wiredtiger.so WT_TEST
rm -rf _wiredtiger.so WT_TEST build wiredtiger

TESTS = run-ex_access
8 changes: 4 additions & 4 deletions lang/python/setup.py
Expand Up @@ -21,20 +21,20 @@
dir = os.path.dirname(__file__)

# Read the version information from the RELEASE file
top = os.path.dirname(os.path.dirname(dir))
for l in open(os.path.join(top, 'RELEASE')):
for l in open(os.path.join(dir, '..', '..', 'RELEASE')):
if re.match(r'WIREDTIGER_VERSION_(?:MAJOR|MINOR|PATCH)=', l):
exec(l)

wt_ver = '%d.%d' % (WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR)

setup(name='wiredtiger', version=wt_ver,
ext_modules=[Extension('_wiredtiger',
[os.path.join(dir, 'wiredtiger_wrap.c')],
[os.path.join(dir, 'wiredtiger_wrap.c')],
include_dirs=['../..'],
library_dirs=['../../.libs'],
libraries=['wiredtiger'],
extra_compile_args=extra_cflags,
)],
py_modules=['wiredtiger'],
package_dir={'' : dir},
packages=['wiredtiger'],
)
38 changes: 0 additions & 38 deletions lang/python/src/server.py

This file was deleted.

241 changes: 0 additions & 241 deletions lang/python/src/wiredtiger/__init__.py

This file was deleted.

0 comments on commit 1fb7075

Please sign in to comment.