diff --git a/python/Makefile.am b/python/Makefile.am index 9a5bc0843..dd45717c0 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,5 +1,5 @@ ## -*- coding: utf-8 -*- -## Copyright (C) 2010, 2011, 2013, 2014, 2015 Laboratoire de Recherche +## Copyright (C) 2010, 2011, 2013, 2014, 2015, 2016 Laboratoire de Recherche ## et Development de l'Epita (LRDE). ## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), ## département Systèmes Répartis Coopératifs (SRC), Université Pierre @@ -32,25 +32,28 @@ AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_builddir) -I$(top_srcdir) \ # this. SWIGFLAGS = -c++ -python -py3 -O -nofastproxy -EXTRA_DIST = spot_impl.i buddy.i -python_PYTHON = $(srcdir)/spot_impl.py $(srcdir)/buddy.py spot.py -pyexec_LTLIBRARIES = _spot_impl.la _buddy.la +EXTRA_DIST = spot/impl.i buddy.i +python_PYTHON = \ + $(srcdir)/spot/__init__.py \ + $(srcdir)/spot/impl.py \ + $(srcdir)/buddy.py +pyexec_LTLIBRARIES = spot/_impl.la _buddy.la MAINTAINERCLEANFILES = \ - $(srcdir)/spot_impl_wrap.cxx $(srcdir)/spot_impl.py \ + $(srcdir)/spot/impl_wrap.cxx $(srcdir)/spot/impl.py \ $(srcdir)/buddy_wrap.cxx $(srcdir)/buddy.py ## spot -_spot_impl_la_SOURCES = $(srcdir)/spot_impl_wrap.cxx -_spot_impl_la_LDFLAGS = -avoid-version -module $(SYMBOLIC_LDFLAGS) -_spot_impl_la_LIBADD = $(top_builddir)/spot/libspot.la +spot__impl_la_SOURCES = $(srcdir)/spot/impl_wrap.cxx +spot__impl_la_LDFLAGS = -avoid-version -module $(SYMBOLIC_LDFLAGS) +spot__impl_la_LIBADD = $(top_builddir)/spot/libspot.la -$(srcdir)/spot_impl_wrap.cxx: $(srcdir)/spot_impl.i - $(SWIG) $(SWIGFLAGS) -I$(srcdir) -I$(top_srcdir) $(srcdir)/spot_impl.i +$(srcdir)/spot/impl_wrap.cxx: $(srcdir)/spot/impl.i + $(SWIG) $(SWIGFLAGS) -I$(srcdir) -I$(top_srcdir) $(srcdir)/spot/impl.i -$(srcdir)/spot_impl.py: $(srcdir)/spot_impl.i - $(MAKE) $(AM_MAKEFLAGS) spot_impl_wrap.cxx +$(srcdir)/spot/impl.py: $(srcdir)/spot/impl.i + $(MAKE) $(AM_MAKEFLAGS) spot/impl_wrap.cxx ## buddy diff --git a/python/spot.py b/python/spot/__init__.py similarity index 99% rename from python/spot.py rename to python/spot/__init__.py index e07203d4a..ef2c6eb55 100644 --- a/python/spot.py +++ b/python/spot/__init__.py @@ -25,7 +25,7 @@ if sys.hexversion < 0x03030000: sys.exit("This module requires Python 3.3 or newer") -from spot_impl import * +from spot.impl import * import subprocess import os import signal diff --git a/python/spot_impl.i b/python/spot/impl.i similarity index 99% rename from python/spot_impl.i rename to python/spot/impl.i index c65e95bcf..0593da185 100644 --- a/python/spot_impl.i +++ b/python/spot/impl.i @@ -26,7 +26,8 @@ #include %} -%module(director="1") spot_impl + +%module(package="spot", director="1") impl %include "std_shared_ptr.i" %include "std_vector.i" diff --git a/tests/python/automata-io.ipynb b/tests/python/automata-io.ipynb index 19f1aa7c6..a018a5a95 100644 --- a/tests/python/automata-io.ipynb +++ b/tests/python/automata-io.ipynb @@ -172,7 +172,7 @@ "\n" ], "text": [ - " *' at 0x7f4414147600> >" + " *' at 0x7f4414147600> >" ] } ], @@ -283,7 +283,7 @@ "\n" ], "text": [ - " *' at 0x7f4414157570> >" + " *' at 0x7f4414157570> >" ] }, { @@ -340,7 +340,7 @@ "\n" ], "text": [ - " *' at 0x7f4414157660> >" + " *' at 0x7f4414157660> >" ] } ], @@ -459,7 +459,7 @@ "\n" ], "text": [ - " *' at 0x7f441765be40> >" + " *' at 0x7f441765be40> >" ] } ], @@ -554,7 +554,7 @@ "\n" ], "text": [ - " *' at 0x7f4414157690> >" + " *' at 0x7f4414157690> >" ] }, { @@ -602,7 +602,7 @@ "\n" ], "text": [ - " *' at 0x7f441765be40> >" + " *' at 0x7f441765be40> >" ] } ], @@ -717,7 +717,7 @@ "\n" ], "text": [ - " *' at 0x7f44141578d0> >" + " *' at 0x7f44141578d0> >" ] }, { @@ -789,7 +789,7 @@ "\n" ], "text": [ - " *' at 0x7f44141578a0> >" + " *' at 0x7f44141578a0> >" ] } ], diff --git a/tests/python/automata.ipynb b/tests/python/automata.ipynb index 74f0c9b08..8d32d9d05 100644 --- a/tests/python/automata.ipynb +++ b/tests/python/automata.ipynb @@ -177,7 +177,7 @@ "\n" ], "text": [ - " *' at 0x7f3c25174540> >" + " *' at 0x7f3c25174540> >" ] } ], @@ -569,7 +569,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b810> >" + " *' at 0x7f3c2515b810> >" ] } ], @@ -639,7 +639,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b690> >" + " *' at 0x7f3c2515b690> >" ] } ], @@ -715,7 +715,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b6f0> >" + " *' at 0x7f3c2515b6f0> >" ] } ], @@ -1175,7 +1175,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515be10> >" + " *' at 0x7f3c2515be10> >" ] } ], @@ -1276,7 +1276,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515bed0> >" + " *' at 0x7f3c2515bed0> >" ] } ], @@ -1394,7 +1394,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b630> >" + " *' at 0x7f3c2515b630> >" ] } ], @@ -1493,7 +1493,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b6c0> >" + " *' at 0x7f3c2515b6c0> >" ] } ], @@ -1963,7 +1963,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b450> >" + " *' at 0x7f3c2515b450> >" ] } ], @@ -2578,7 +2578,7 @@ "\n" ], "text": [ - " *' at 0x7f3c2515b840> >" + " *' at 0x7f3c2515b840> >" ] } ], @@ -2734,7 +2734,7 @@ "\n" ], "text": [ - " *' at 0x7f3c250f61e0> >" + " *' at 0x7f3c250f61e0> >" ] } ], @@ -2804,7 +2804,7 @@ "\n" ], "text": [ - " *' at 0x7f3c250f6150> >" + " *' at 0x7f3c250f6150> >" ] } ], diff --git a/tests/python/decompose.ipynb b/tests/python/decompose.ipynb index c8240a478..386112577 100644 --- a/tests/python/decompose.ipynb +++ b/tests/python/decompose.ipynb @@ -212,7 +212,7 @@ "\n" ], "text": [ - " *' at 0x7f7340048a20> >" + " *' at 0x7f7340048a20> >" ] } ], @@ -329,7 +329,7 @@ "\n" ], "text": [ - " *' at 0x7f7340048990> >" + " *' at 0x7f7340048990> >" ] } ], @@ -470,7 +470,7 @@ "\n" ], "text": [ - " *' at 0x7f73400489c0> >" + " *' at 0x7f73400489c0> >" ] } ], @@ -560,7 +560,7 @@ "\n" ], "text": [ - " *' at 0x7f7340048bd0> >" + " *' at 0x7f7340048bd0> >" ] } ], @@ -637,7 +637,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f3c0> >" + " *' at 0x7f734006f3c0> >" ] } ], @@ -753,7 +753,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f060> >" + " *' at 0x7f734006f060> >" ] }, { @@ -877,7 +877,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f3f0> >" + " *' at 0x7f734006f3f0> >" ] }, { @@ -1020,7 +1020,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f060> >" + " *' at 0x7f734006f060> >" ] } ], @@ -1425,7 +1425,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f090> >" + " *' at 0x7f734006f090> >" ] } ], @@ -1750,7 +1750,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f0c0> >" + " *' at 0x7f734006f0c0> >" ] }, { @@ -1947,7 +1947,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f060> >" + " *' at 0x7f734006f060> >" ] }, { @@ -2127,7 +2127,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f0c0> >" + " *' at 0x7f734006f0c0> >" ] } ], @@ -2462,7 +2462,7 @@ "\n" ], "text": [ - " *' at 0x7f734006fbd0> >" + " *' at 0x7f734006fbd0> >" ] } ], @@ -2606,7 +2606,7 @@ "\n" ], "text": [ - " *' at 0x7f734006ff60> >" + " *' at 0x7f734006ff60> >" ] }, { @@ -2725,7 +2725,7 @@ "\n" ], "text": [ - " *' at 0x7f734006fcc0> >" + " *' at 0x7f734006fcc0> >" ] }, { @@ -2905,7 +2905,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f6c0> >" + " *' at 0x7f734006f6c0> >" ] } ], @@ -3262,7 +3262,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d0f0> >" + " *' at 0x7f733338d0f0> >" ] } ], @@ -3552,7 +3552,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d090> >" + " *' at 0x7f733338d090> >" ] }, { @@ -3704,7 +3704,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f6c0> >" + " *' at 0x7f734006f6c0> >" ] }, { @@ -3841,7 +3841,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d090> >" + " *' at 0x7f733338d090> >" ] } ], @@ -4144,7 +4144,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d1e0> >" + " *' at 0x7f733338d1e0> >" ] } ], @@ -4255,7 +4255,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d360> >" + " *' at 0x7f733338d360> >" ] } ], @@ -4347,7 +4347,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d3c0> >" + " *' at 0x7f733338d3c0> >" ] }, { @@ -4413,7 +4413,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d3c0> >" + " *' at 0x7f733338d3c0> >" ] } ], @@ -4499,7 +4499,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d420> >" + " *' at 0x7f733338d420> >" ] } ], @@ -4654,7 +4654,7 @@ "\n" ], "text": [ - " *' at 0x7f733338d4b0> >" + " *' at 0x7f733338d4b0> >" ] } ], @@ -4783,7 +4783,7 @@ "\n" ], "text": [ - " *' at 0x7f734006f6c0> >" + " *' at 0x7f734006f6c0> >" ] }, { @@ -4871,7 +4871,7 @@ "\n" ], "text": [ - " *' at 0x7f734006fc60> >" + " *' at 0x7f734006fc60> >" ] }, { @@ -4988,7 +4988,7 @@ "\n" ], "text": [ - " *' at 0x7f734006fc60> >" + " *' at 0x7f734006fc60> >" ] } ], diff --git a/tests/python/piperead.ipynb b/tests/python/piperead.ipynb index da4a67d98..4f9392704 100644 --- a/tests/python/piperead.ipynb +++ b/tests/python/piperead.ipynb @@ -111,7 +111,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f330> >" + " *' at 0x7fad7cc5f330> >" ] }, { @@ -162,7 +162,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f4e0> >" + " *' at 0x7fad7cc5f4e0> >" ] }, { @@ -208,7 +208,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f270> >" + " *' at 0x7fad7cc5f270> >" ] }, { @@ -265,7 +265,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f330> >" + " *' at 0x7fad7cc5f330> >" ] } ], @@ -342,7 +342,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f4e0> >" + " *' at 0x7fad7cc5f4e0> >" ] } ], @@ -445,7 +445,7 @@ "\n" ], "text": [ - " *' at 0x7fad7cc5f780> >" + " *' at 0x7fad7cc5f780> >" ] }, { diff --git a/tests/python/testingaut.ipynb b/tests/python/testingaut.ipynb index 6a025e27b..9d7f44e85 100644 --- a/tests/python/testingaut.ipynb +++ b/tests/python/testingaut.ipynb @@ -96,7 +96,7 @@ "\n" ], "text": [ - " *' at 0x7f2e817bf6c0> >" + " *' at 0x7f2e817bf6c0> >" ] } ], diff --git a/tests/run.in b/tests/run.in index 6973279ff..7f8cb87a8 100755 --- a/tests/run.in +++ b/tests/run.in @@ -24,15 +24,20 @@ # Darwin needs some help in figuring out where non-installed libtool # libraries are (on this platform libtool encodes the expected final # path of dependent libraries in each library). -modpath='@abs_top_builddir@/python/.libs' -modpath=$modpath:'@top_builddir@/spot/.libs':'@top_builddir@/buddy/spot/.libs' +modpath='@abs_top_builddir@/python/.libs:@abs_top_builddir@/python/spot/.libs' +modpath=$modpath:'@top_builddir@/spot/.libs:@top_builddir@/buddy/spot/.libs' # We need access to both the *.py files, and the *.so. We used to # rely on a module called ltihooks.py to teach the import function how # to load a Libtool library, but it started to cause issues with # Python 2.6. -pypath='@abs_top_builddir@/python':'@abs_top_builddir@/python/.libs' -pypath=$pypath:'@abs_top_srcdir@/python':'@abs_top_srcdir@/python/.libs' +pypath= +for i in python python/spot; do + for j in '@abs_top_builddir@' '@abs_top_srcdir@'; do + pypath=$j/$i:$j/$i/.libs:$pypath + done +done +pypath=${pypath%:} PATH="@abs_top_builddir@/bin:$PATH" export PATH