[pypy-commit] pypy cppyy-packaging: move cppyy -> _cppyy and remove test_cint.py (obsolete)
wlav
pypy.commits at gmail.com
Wed Jul 19 16:46:36 EDT 2017
Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: cppyy-packaging
Changeset: r91926:e7b3734b419c
Date: 2017-07-18 16:26 -0700
http://bitbucket.org/pypy/pypy/changeset/e7b3734b419c/
Log: move cppyy -> _cppyy and remove test_cint.py (obsolete)
diff too long, truncating to 2000 out of 3264 lines
diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -36,7 +36,7 @@
"cStringIO", "thread", "itertools", "pyexpat", "_ssl", "cpyext", "array",
"binascii", "_multiprocessing", '_warnings', "_collections",
"_multibytecodec", "micronumpy", "_continuation", "_cffi_backend",
- "_csv", "cppyy", "_pypyjson", "_jitlog"
+ "_csv", "_cppyy", "_pypyjson", "_jitlog"
])
from rpython.jit.backend import detect_cpu
@@ -67,8 +67,8 @@
if name in translation_modules:
translation_modules.remove(name)
- if "cppyy" in working_modules:
- working_modules.remove("cppyy") # not tested on win32
+ if "_cppyy" in working_modules:
+ working_modules.remove("_cppyy") # not tested on win32
if "faulthandler" in working_modules:
working_modules.remove("faulthandler") # missing details
@@ -79,8 +79,8 @@
working_modules.remove('fcntl') # LOCK_NB not defined
working_modules.remove("_minimal_curses")
working_modules.remove("termios")
- if "cppyy" in working_modules:
- working_modules.remove("cppyy") # depends on ctypes
+ if "_cppyy" in working_modules:
+ working_modules.remove("_cppyy") # depends on ctypes
#if sys.platform.startswith("linux"):
# _mach = os.popen('uname -m', 'r').read().strip()
@@ -92,7 +92,7 @@
'_multiprocessing': [('objspace.usemodules.time', True),
('objspace.usemodules.thread', True)],
'cpyext': [('objspace.usemodules.array', True)],
- 'cppyy': [('objspace.usemodules.cpyext', True)],
+ '_cppyy': [('objspace.usemodules.cpyext', True)],
'faulthandler': [('objspace.usemodules._vmprof', True)],
}
module_suggests = {
diff --git a/pypy/module/cppyy/__init__.py b/pypy/module/_cppyy/__init__.py
rename from pypy/module/cppyy/__init__.py
rename to pypy/module/_cppyy/__init__.py
--- a/pypy/module/cppyy/__init__.py
+++ b/pypy/module/_cppyy/__init__.py
@@ -33,11 +33,11 @@
# pythonization functions may be written in RPython, but the interp2app
# code generation is not, so give it a chance to run now
- from pypy.module.cppyy import capi
+ from pypy.module._cppyy import capi
capi.register_pythonizations(space)
def startup(self, space):
- from pypy.module.cppyy import capi
+ from pypy.module._cppyy import capi
capi.verify_backend(space) # may raise ImportError
space.call_method(self, '_init_pythonify')
diff --git a/pypy/module/cppyy/backend/create_cppyy_package.py b/pypy/module/_cppyy/backend/create_cppyy_package.py
rename from pypy/module/cppyy/backend/create_cppyy_package.py
rename to pypy/module/_cppyy/backend/create_cppyy_package.py
diff --git a/pypy/module/cppyy/bench/Makefile b/pypy/module/_cppyy/bench/Makefile
rename from pypy/module/cppyy/bench/Makefile
rename to pypy/module/_cppyy/bench/Makefile
diff --git a/pypy/module/cppyy/bench/bench02.cxx b/pypy/module/_cppyy/bench/bench02.cxx
rename from pypy/module/cppyy/bench/bench02.cxx
rename to pypy/module/_cppyy/bench/bench02.cxx
diff --git a/pypy/module/cppyy/bench/bench02.h b/pypy/module/_cppyy/bench/bench02.h
rename from pypy/module/cppyy/bench/bench02.h
rename to pypy/module/_cppyy/bench/bench02.h
diff --git a/pypy/module/cppyy/bench/bench02.xml b/pypy/module/_cppyy/bench/bench02.xml
rename from pypy/module/cppyy/bench/bench02.xml
rename to pypy/module/_cppyy/bench/bench02.xml
diff --git a/pypy/module/cppyy/bench/hsimple.C b/pypy/module/_cppyy/bench/hsimple.C
rename from pypy/module/cppyy/bench/hsimple.C
rename to pypy/module/_cppyy/bench/hsimple.C
diff --git a/pypy/module/cppyy/bench/hsimple.py b/pypy/module/_cppyy/bench/hsimple.py
rename from pypy/module/cppyy/bench/hsimple.py
rename to pypy/module/_cppyy/bench/hsimple.py
diff --git a/pypy/module/cppyy/bench/hsimple_rflx.py b/pypy/module/_cppyy/bench/hsimple_rflx.py
rename from pypy/module/cppyy/bench/hsimple_rflx.py
rename to pypy/module/_cppyy/bench/hsimple_rflx.py
diff --git a/pypy/module/cppyy/capi/__init__.py b/pypy/module/_cppyy/capi/__init__.py
rename from pypy/module/cppyy/capi/__init__.py
rename to pypy/module/_cppyy/capi/__init__.py
--- a/pypy/module/cppyy/capi/__init__.py
+++ b/pypy/module/_cppyy/capi/__init__.py
@@ -9,10 +9,10 @@
# the selection of the desired backend (default is Reflex).
# choose C-API access method:
-from pypy.module.cppyy.capi.loadable_capi import *
-#from pypy.module.cppyy.capi.builtin_capi import *
+from pypy.module._cppyy.capi.loadable_capi import *
+#from pypy.module._cppyy.capi.builtin_capi import *
-from pypy.module.cppyy.capi.capi_types import C_OBJECT,\
+from pypy.module._cppyy.capi.capi_types import C_OBJECT,\
C_NULL_TYPE, C_NULL_OBJECT
def direct_ptradd(ptr, offset):
diff --git a/pypy/module/cppyy/capi/builtin_capi.py b/pypy/module/_cppyy/capi/builtin_capi.py
rename from pypy/module/cppyy/capi/builtin_capi.py
rename to pypy/module/_cppyy/capi/builtin_capi.py
--- a/pypy/module/cppyy/capi/builtin_capi.py
+++ b/pypy/module/_cppyy/capi/builtin_capi.py
@@ -4,7 +4,7 @@
import cling_capi as backend
-from pypy.module.cppyy.capi.capi_types import C_SCOPE, C_TYPE, C_OBJECT,\
+from pypy.module._cppyy.capi.capi_types import C_SCOPE, C_TYPE, C_OBJECT,\
C_METHOD, C_INDEX, C_INDEX_ARRAY, WLAVC_INDEX, C_FUNC_PTR
identify = backend.identify
diff --git a/pypy/module/cppyy/capi/capi_types.py b/pypy/module/_cppyy/capi/capi_types.py
rename from pypy/module/cppyy/capi/capi_types.py
rename to pypy/module/_cppyy/capi/capi_types.py
diff --git a/pypy/module/cppyy/capi/cling_capi.py b/pypy/module/_cppyy/capi/cling_capi.py
rename from pypy/module/cppyy/capi/cling_capi.py
rename to pypy/module/_cppyy/capi/cling_capi.py
--- a/pypy/module/cppyy/capi/cling_capi.py
+++ b/pypy/module/_cppyy/capi/cling_capi.py
@@ -11,7 +11,7 @@
from rpython.rlib import jit, libffi, rdynload
from pypy.module._rawffi.array import W_ArrayInstance
-from pypy.module.cppyy.capi.capi_types import C_OBJECT
+from pypy.module._cppyy.capi.capi_types import C_OBJECT
__all__ = ['identify', 'std_string_name', 'eci', 'c_load_dictionary']
@@ -99,7 +99,7 @@
def stdstring_c_str(space, w_self):
"""Return a python string taking into account \0"""
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppstr = space.interp_w(interp_cppyy.W_CPPInstance, w_self, can_be_None=False)
return space.wrap(c_stdstring2charp(space, cppstr._rawobject))
@@ -112,12 +112,12 @@
W_AbstractSeqIterObject.__init__(self, w_vector)
# TODO: this should live in rpythonize.py or something so that the
# imports can move to the top w/o getting circles
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
assert isinstance(w_vector, interp_cppyy.W_CPPInstance)
vector = space.interp_w(interp_cppyy.W_CPPInstance, w_vector)
self.overload = vector.cppclass.get_overload("__getitem__")
- from pypy.module.cppyy import capi
+ from pypy.module._cppyy import capi
v_type = capi.c_stdvector_valuetype(space, vector.cppclass.name)
v_size = capi.c_stdvector_valuesize(space, vector.cppclass.name)
@@ -131,7 +131,7 @@
self.data = rffi.cast(rffi.VOIDP, space.uint_w(arr.getbuffer(space)))
- from pypy.module.cppyy import converter
+ from pypy.module._cppyy import converter
self.converter = converter.get_converter(space, v_type, '')
self.len = space.uint_w(vector.cppclass.get_overload("size").call(w_vector, []))
self.stride = v_size
@@ -143,7 +143,7 @@
self.w_seq = None
raise OperationError(space.w_StopIteration, space.w_None)
try:
- from pypy.module.cppyy import capi # TODO: refector
+ from pypy.module._cppyy import capi # TODO: refector
offset = capi.direct_ptradd(rffi.cast(C_OBJECT, self.data), self.index*self.stride)
w_item = self.converter.from_memory(space, space.w_None, space.w_None, offset)
except OperationError as e:
@@ -186,7 +186,7 @@
_method_alias(space, w_pycppclass, "__str__", "c_str")
if "vector" in name[:11]: # len('std::vector') == 11
- from pypy.module.cppyy import capi
+ from pypy.module._cppyy import capi
v_type = capi.c_stdvector_valuetype(space, name)
if v_type:
space.setattr(w_pycppclass, space.wrap("value_type"), space.wrap(v_type))
diff --git a/pypy/module/cppyy/capi/loadable_capi.py b/pypy/module/_cppyy/capi/loadable_capi.py
rename from pypy/module/cppyy/capi/loadable_capi.py
rename to pypy/module/_cppyy/capi/loadable_capi.py
--- a/pypy/module/cppyy/capi/loadable_capi.py
+++ b/pypy/module/_cppyy/capi/loadable_capi.py
@@ -9,9 +9,9 @@
from pypy.module._cffi_backend import ctypefunc, ctypeprim, cdataobj, misc
from pypy.module._cffi_backend import newtype
-from pypy.module.cppyy import ffitypes
+from pypy.module._cppyy import ffitypes
-from pypy.module.cppyy.capi.capi_types import C_SCOPE, C_TYPE, C_OBJECT,\
+from pypy.module._cppyy.capi.capi_types import C_SCOPE, C_TYPE, C_OBJECT,\
C_METHOD, C_INDEX, C_INDEX_ARRAY, WLAVC_INDEX, C_FUNC_PTR
@@ -599,7 +599,7 @@
def stdstring_c_str(space, w_self):
"""Return a python string taking into account \0"""
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppstr = space.interp_w(interp_cppyy.W_CPPInstance, w_self, can_be_None=False)
return space.newtext(c_stdstring2charp(space, cppstr._rawobject))
diff --git a/pypy/module/cppyy/converter.py b/pypy/module/_cppyy/converter.py
rename from pypy/module/cppyy/converter.py
rename to pypy/module/_cppyy/converter.py
--- a/pypy/module/cppyy/converter.py
+++ b/pypy/module/_cppyy/converter.py
@@ -9,7 +9,7 @@
from pypy.module._rawffi.interp_rawffi import letter2tp
from pypy.module._rawffi.array import W_Array, W_ArrayInstance
-from pypy.module.cppyy import helper, capi, ffitypes
+from pypy.module._cppyy import helper, capi, ffitypes
# Converter objects are used to translate between RPython and C++. They are
# defined by the type name for which they provide conversion. Uses are for
@@ -22,7 +22,7 @@
def get_rawobject(space, w_obj):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
cppinstance = space.interp_w(W_CPPInstance, w_obj, can_be_None=True)
if cppinstance:
rawobject = cppinstance.get_rawobject()
@@ -31,14 +31,14 @@
return capi.C_NULL_OBJECT
def set_rawobject(space, w_obj, address):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
cppinstance = space.interp_w(W_CPPInstance, w_obj, can_be_None=True)
if cppinstance:
assert lltype.typeOf(cppinstance._rawobject) == capi.C_OBJECT
cppinstance._rawobject = rffi.cast(capi.C_OBJECT, address)
def get_rawobject_nonnull(space, w_obj):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
cppinstance = space.interp_w(W_CPPInstance, w_obj, can_be_None=True)
if cppinstance:
cppinstance._nullcheck()
@@ -56,7 +56,7 @@
except Exception:
pass
# None or nullptr
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return space.is_true(space.is_(w_obj, space.w_None)) or \
space.is_true(space.is_(w_obj, interp_cppyy.get_nullptr(space)))
@@ -104,18 +104,18 @@
"no converter available for '%s'", self.name)
def cffi_type(self, space):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
def convert_argument(self, space, w_obj, address, call_local):
self._is_abstract(space)
def convert_argument_libffi(self, space, w_obj, address, call_local):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
def default_argument_libffi(self, space, address):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
def from_memory(self, space, w_obj, w_pycppclass, offset):
@@ -362,7 +362,7 @@
return state.c_voidp
def convert_argument_libffi(self, space, w_obj, address, call_local):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
class DoubleConverter(ffitypes.typeid(rffi.DOUBLE), FloatTypeConverterMixin, TypeConverter):
@@ -442,7 +442,7 @@
address = self._get_raw_address(space, w_obj, offset)
ptrval = rffi.cast(rffi.ULONG, rffi.cast(rffi.VOIDPP, address)[0])
if ptrval == 0:
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return interp_cppyy.get_nullptr(space)
arr = space.interp_w(W_Array, letter2tp(space, 'P'))
return arr.fromaddress(space, ptrval, sys.maxint)
@@ -488,12 +488,12 @@
typecode = 'V'
def __init__(self, space, cppclass):
- from pypy.module.cppyy.interp_cppyy import W_CPPClass
+ from pypy.module._cppyy.interp_cppyy import W_CPPClass
assert isinstance(cppclass, W_CPPClass)
self.cppclass = cppclass
def _unwrap_object(self, space, w_obj):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
if isinstance(w_obj, W_CPPInstance):
if capi.c_is_subtype(space, w_obj.cppclass, self.cppclass):
rawobject = w_obj.get_rawobject()
@@ -521,12 +521,12 @@
class InstanceConverter(InstanceRefConverter):
def convert_argument_libffi(self, space, w_obj, address, call_local):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible # TODO: by-value is a jit_libffi special case
def from_memory(self, space, w_obj, w_pycppclass, offset):
address = rffi.cast(capi.C_OBJECT, self._get_raw_address(space, w_obj, offset))
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return interp_cppyy.wrap_cppobject(space, address, self.cppclass, do_cast=False)
def to_memory(self, space, w_obj, w_value, offset):
@@ -547,7 +547,7 @@
def from_memory(self, space, w_obj, w_pycppclass, offset):
address = rffi.cast(capi.C_OBJECT, self._get_raw_address(space, w_obj, offset))
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return interp_cppyy.wrap_cppobject(space, address, self.cppclass, do_cast=False)
def to_memory(self, space, w_obj, w_value, offset):
@@ -570,30 +570,30 @@
def convert_argument_libffi(self, space, w_obj, address, call_local):
# TODO: finalize_call not yet called for fast call (see interp_cppyy.py)
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
def finalize_call(self, space, w_obj, call_local):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
assert isinstance(w_obj, W_CPPInstance)
r = rffi.cast(rffi.VOIDPP, call_local)
w_obj._rawobject = rffi.cast(capi.C_OBJECT, r[0])
def from_memory(self, space, w_obj, w_pycppclass, offset):
address = rffi.cast(capi.C_OBJECT, self._get_raw_address(space, w_obj, offset))
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return interp_cppyy.wrap_cppobject(space, address, self.cppclass,
do_cast=False, is_ref=True)
class StdStringConverter(InstanceConverter):
def __init__(self, space, extra):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, capi.std_string_name)
InstanceConverter.__init__(self, space, cppclass)
def _unwrap_object(self, space, w_obj):
- from pypy.module.cppyy.interp_cppyy import W_CPPInstance
+ from pypy.module._cppyy.interp_cppyy import W_CPPInstance
if isinstance(w_obj, W_CPPInstance):
arg = InstanceConverter._unwrap_object(self, space, w_obj)
return capi.c_stdstring2stdstring(space, arg)
@@ -604,7 +604,7 @@
try:
address = rffi.cast(capi.C_OBJECT, self._get_raw_address(space, w_obj, offset))
assign = self.cppclass.get_overload("__assign__")
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
assign.call(
interp_cppyy.wrap_cppobject(space, address, self.cppclass, do_cast=False), [w_value])
except Exception:
@@ -619,7 +619,7 @@
typecode = 'V'
def __init__(self, space, extra):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, capi.std_string_name)
InstancePtrConverter.__init__(self, space, cppclass)
@@ -642,7 +642,7 @@
def convert_argument_libffi(self, space, w_obj, address, call_local):
# TODO: free_argument not yet called for fast call (see interp_cppyy.py)
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
# proposed implementation:
@@ -709,11 +709,11 @@
# 3) TODO: accept ref as pointer
# 4) generalized cases (covers basically all user classes)
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, clean_name)
if cppclass:
# type check for the benefit of the annotator
- from pypy.module.cppyy.interp_cppyy import W_CPPClass
+ from pypy.module._cppyy.interp_cppyy import W_CPPClass
cppclass = space.interp_w(W_CPPClass, cppclass, can_be_None=False)
if compound == "*":
return InstancePtrConverter(space, cppclass)
@@ -874,12 +874,12 @@
class TStringConverter(InstanceConverter):
def __init__(self, space, extra):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, "TString")
InstanceConverter.__init__(self, space, cppclass)
def _unwrap_object(self, space, w_obj):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
if isinstance(w_obj, interp_cppyy.W_CPPInstance):
arg = InstanceConverter._unwrap_object(self, space, w_obj)
return capi.backend.c_TString2TString(space, arg)
diff --git a/pypy/module/cppyy/executor.py b/pypy/module/_cppyy/executor.py
rename from pypy/module/cppyy/executor.py
rename to pypy/module/_cppyy/executor.py
--- a/pypy/module/cppyy/executor.py
+++ b/pypy/module/_cppyy/executor.py
@@ -8,7 +8,7 @@
from pypy.module._rawffi.interp_rawffi import unpack_simple_shape
from pypy.module._rawffi.array import W_Array, W_ArrayInstance
-from pypy.module.cppyy import helper, capi, ffitypes
+from pypy.module._cppyy import helper, capi, ffitypes
# Executor objects are used to dispatch C++ methods. They are defined by their
# return type only: arguments are converted by Converter objects, and Executors
@@ -31,7 +31,7 @@
pass
def cffi_type(self, space):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
def execute(self, space, cppmethod, cppthis, num_args, args):
@@ -39,7 +39,7 @@
"return type not available or supported")
def execute_libffi(self, space, cif_descr, funcaddr, buffer):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
@@ -58,7 +58,7 @@
ptrval = rffi.cast(rffi.ULONG, lresult)
arr = space.interp_w(W_Array, unpack_simple_shape(space, space.newtext(self.typecode)))
if ptrval == 0:
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
return interp_cppyy.get_nullptr(space)
return arr.fromaddress(space, ptrval, sys.maxint)
@@ -138,7 +138,7 @@
class ConstructorExecutor(FunctionExecutor):
def execute(self, space, cppmethod, cpptype, num_args, args):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
newthis = capi.c_constructor(space, cppmethod, cpptype, num_args, args)
assert lltype.typeOf(newthis) == capi.C_OBJECT
return space.newlong(rffi.cast(rffi.LONG, newthis)) # really want ptrdiff_t here
@@ -156,7 +156,7 @@
return state.c_voidp
def execute(self, space, cppmethod, cppthis, num_args, args):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
long_result = capi.c_call_l(space, cppmethod, cppthis, num_args, args)
ptr_result = rffi.cast(capi.C_OBJECT, long_result)
pyres = interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass)
@@ -165,34 +165,34 @@
def execute_libffi(self, space, cif_descr, funcaddr, buffer):
jit_libffi.jit_ffi_call(cif_descr, funcaddr, buffer)
result = rffi.ptradd(buffer, cif_descr.exchange_result)
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
ptr_result = rffi.cast(capi.C_OBJECT, rffi.cast(rffi.VOIDPP, result)[0])
return interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass)
class InstancePtrPtrExecutor(InstancePtrExecutor):
def execute(self, space, cppmethod, cppthis, num_args, args):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
voidp_result = capi.c_call_r(space, cppmethod, cppthis, num_args, args)
ref_address = rffi.cast(rffi.VOIDPP, voidp_result)
ptr_result = rffi.cast(capi.C_OBJECT, ref_address[0])
return interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass)
def execute_libffi(self, space, cif_descr, funcaddr, buffer):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
class InstanceExecutor(InstancePtrExecutor):
def execute(self, space, cppmethod, cppthis, num_args, args):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
long_result = capi.c_call_o(space, cppmethod, cppthis, num_args, args, self.cppclass)
ptr_result = rffi.cast(capi.C_OBJECT, long_result)
return interp_cppyy.wrap_cppobject(space, ptr_result, self.cppclass,
do_cast=False, python_owns=True, fresh=True)
def execute_libffi(self, space, cif_descr, funcaddr, buffer):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
@@ -205,13 +205,13 @@
return space.newbytes(pystr)
def execute_libffi(self, space, cif_descr, funcaddr, buffer):
- from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+ from pypy.module._cppyy.interp_cppyy import FastCallNotPossible
raise FastCallNotPossible
class StdStringRefExecutor(InstancePtrExecutor):
def __init__(self, space, cppclass):
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, capi.std_string_name)
InstancePtrExecutor.__init__(self, space, cppclass)
@@ -277,11 +277,11 @@
pass
# 3) types/classes, either by ref/ptr or by value
- from pypy.module.cppyy import interp_cppyy
+ from pypy.module._cppyy import interp_cppyy
cppclass = interp_cppyy.scope_byname(space, clean_name)
if cppclass:
# type check for the benefit of the annotator
- from pypy.module.cppyy.interp_cppyy import W_CPPClass
+ from pypy.module._cppyy.interp_cppyy import W_CPPClass
cppclass = space.interp_w(W_CPPClass, cppclass, can_be_None=False)
if compound == '':
return InstanceExecutor(space, cppclass)
diff --git a/pypy/module/cppyy/ffitypes.py b/pypy/module/_cppyy/ffitypes.py
rename from pypy/module/cppyy/ffitypes.py
rename to pypy/module/_cppyy/ffitypes.py
diff --git a/pypy/module/cppyy/genreflex-methptrgetter.patch b/pypy/module/_cppyy/genreflex-methptrgetter.patch
rename from pypy/module/cppyy/genreflex-methptrgetter.patch
rename to pypy/module/_cppyy/genreflex-methptrgetter.patch
diff --git a/pypy/module/cppyy/helper.py b/pypy/module/_cppyy/helper.py
rename from pypy/module/cppyy/helper.py
rename to pypy/module/_cppyy/helper.py
--- a/pypy/module/cppyy/helper.py
+++ b/pypy/module/_cppyy/helper.py
@@ -64,7 +64,7 @@
_operator_mappings = {}
def map_operator_name(space, cppname, nargs, result_type):
- from pypy.module.cppyy import capi
+ from pypy.module._cppyy import capi
if cppname[0:8] == "operator":
op = cppname[8:].strip(' ')
diff --git a/pypy/module/cppyy/include/capi.h b/pypy/module/_cppyy/include/capi.h
rename from pypy/module/cppyy/include/capi.h
rename to pypy/module/_cppyy/include/capi.h
diff --git a/pypy/module/cppyy/include/clingcwrapper.h b/pypy/module/_cppyy/include/clingcwrapper.h
rename from pypy/module/cppyy/include/clingcwrapper.h
rename to pypy/module/_cppyy/include/clingcwrapper.h
diff --git a/pypy/module/cppyy/include/cpp_cppyy.h b/pypy/module/_cppyy/include/cpp_cppyy.h
rename from pypy/module/cppyy/include/cpp_cppyy.h
rename to pypy/module/_cppyy/include/cpp_cppyy.h
diff --git a/pypy/module/cppyy/include/cppyy.h b/pypy/module/_cppyy/include/cppyy.h
rename from pypy/module/cppyy/include/cppyy.h
rename to pypy/module/_cppyy/include/cppyy.h
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/_cppyy/interp_cppyy.py
rename from pypy/module/cppyy/interp_cppyy.py
rename to pypy/module/_cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/_cppyy/interp_cppyy.py
@@ -1,4 +1,4 @@
-import pypy.module.cppyy.capi as capi
+import pypy.module._cppyy.capi as capi
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.gateway import interp2app, unwrap_spec
@@ -12,7 +12,7 @@
from rpython.rlib.objectmodel import we_are_translated, keepalive_until_here
from pypy.module._cffi_backend import ctypefunc
-from pypy.module.cppyy import converter, executor, ffitypes, helper
+from pypy.module._cppyy import converter, executor, ffitypes, helper
class FastCallNotPossible(Exception):
diff --git a/pypy/module/cppyy/pythonify.py b/pypy/module/_cppyy/pythonify.py
rename from pypy/module/cppyy/pythonify.py
rename to pypy/module/_cppyy/pythonify.py
--- a/pypy/module/cppyy/pythonify.py
+++ b/pypy/module/_cppyy/pythonify.py
@@ -1,5 +1,5 @@
# NOT_RPYTHON
-# do not load cppyy here, see _init_pythonify()
+# do not load _cppyy here, see _init_pythonify()
import types
import sys
@@ -35,8 +35,8 @@
def _arg_to_str(self, arg):
if arg == str:
- import cppyy
- arg = cppyy._std_string_name()
+ import _cppyy
+ arg = _cppyy._std_string_name()
elif type(arg) != str:
arg = arg.__name__
return arg
@@ -99,8 +99,8 @@
else:
d = dict()
def cpp_proxy_loader(cls):
- import cppyy
- cpp_proxy = cppyy._scope_byname(cls.__name__ != '::' and cls.__name__ or '')
+ import _cppyy
+ cpp_proxy = _cppyy._scope_byname(cls.__name__ != '::' and cls.__name__ or '')
del cls.__class__._cpp_proxy
cls._cpp_proxy = cpp_proxy
return cpp_proxy
@@ -126,7 +126,7 @@
setattr(metans, dm_name, cppdm)
modname = pycppns.__name__.replace('::', '.')
- sys.modules['cppyy.gbl.'+modname] = pycppns
+ sys.modules['_cppyy.gbl.'+modname] = pycppns
return pycppns
def _drop_cycles(bases):
@@ -141,8 +141,8 @@
def make_new(class_name):
def __new__(cls, *args):
# create a place-holder only as there may be a derived class defined
- import cppyy
- instance = cppyy.bind_object(0, class_name, True)
+ import _cppyy
+ instance = _cppyy.bind_object(0, class_name, True)
if not instance.__class__ is cls:
instance.__class__ = cls # happens for derived class
return instance
@@ -202,8 +202,8 @@
# the call to register will add back-end specific pythonizations and thus
# needs to run first, so that the generic pythonizations can use them
- import cppyy
- cppyy._register_class(pycppclass)
+ import _cppyy
+ _cppyy._register_class(pycppclass)
_pythonize(pycppclass)
return pycppclass
@@ -212,18 +212,18 @@
def get_pycppitem(scope, name):
- import cppyy
+ import _cppyy
# resolve typedefs/aliases
full_name = (scope == gbl) and name or (scope.__name__+'::'+name)
- true_name = cppyy._resolve_name(full_name)
+ true_name = _cppyy._resolve_name(full_name)
if true_name != full_name:
return get_pycppclass(true_name)
pycppitem = None
# classes
- cppitem = cppyy._scope_byname(true_name)
+ cppitem = _cppyy._scope_byname(true_name)
if cppitem:
if cppitem.is_namespace():
pycppitem = make_cppnamespace(scope, true_name, cppitem)
@@ -233,7 +233,7 @@
# templates
if not cppitem:
- cppitem = cppyy._template_byname(true_name)
+ cppitem = _cppyy._template_byname(true_name)
if cppitem:
pycppitem = make_cpptemplatetype(scope, name)
setattr(scope, name, pycppitem)
@@ -323,7 +323,7 @@
# general note: use 'in pyclass.__dict__' rather than 'hasattr' to prevent
# adding pythonizations multiple times in derived classes
- import cppyy
+ import _cppyy
# map __eq__/__ne__ through a comparison to None
if '__eq__' in pyclass.__dict__:
@@ -362,8 +362,8 @@
# also the fallback on the indexed __getitem__, but that is slower)
if not 'vector' in pyclass.__name__[:11] and \
('begin' in pyclass.__dict__ and 'end' in pyclass.__dict__):
- if cppyy._scope_byname(pyclass.__name__+'::iterator') or \
- cppyy._scope_byname(pyclass.__name__+'::const_iterator'):
+ if _cppyy._scope_byname(pyclass.__name__+'::iterator') or \
+ _cppyy._scope_byname(pyclass.__name__+'::const_iterator'):
def __iter__(self):
i = self.begin()
while i != self.end():
@@ -383,7 +383,7 @@
pyclass.__getitem__ = python_style_getitem
# string comparisons
- if pyclass.__name__ == cppyy._std_string_name():
+ if pyclass.__name__ == _cppyy._std_string_name():
def eq(self, other):
if type(other) == pyclass:
return self.c_str() == other.c_str()
@@ -410,29 +410,29 @@
try:
return _loaded_dictionaries[name]
except KeyError:
- import cppyy
- lib = cppyy._load_dictionary(name)
+ import _cppyy
+ lib = _cppyy._load_dictionary(name)
_loaded_dictionaries[name] = lib
return lib
def _init_pythonify():
- # cppyy should not be loaded at the module level, as that will trigger a
- # call to space.getbuiltinmodule(), which will cause cppyy to be loaded
- # at pypy-c startup, rather than on the "import cppyy" statement
- import cppyy
+ # _cppyy should not be loaded at the module level, as that will trigger a
+ # call to space.getbuiltinmodule(), which will cause _cppyy to be loaded
+ # at pypy-c startup, rather than on the "import _cppyy" statement
+ import _cppyy
# root of all proxy classes: CPPInstance in pythonify exists to combine the
# CPPClass meta class with the interp-level CPPInstanceBase
global CPPInstance
- class CPPInstance(cppyy.CPPInstanceBase):
+ class CPPInstance(_cppyy.CPPInstanceBase):
__metaclass__ = CPPClass
pass
# class generator callback
- cppyy._set_class_generator(clgen_callback)
+ _cppyy._set_class_generator(clgen_callback)
# function generator callback
- cppyy._set_function_generator(fngen_callback)
+ _cppyy._set_function_generator(fngen_callback)
# user interface objects (note the two-step of not calling scope_byname here:
# creation of global functions may cause the creation of classes in the global
@@ -450,14 +450,14 @@
setattr(gbl, 'internal_enum_type_t', int)
# install nullptr as a unique reference
- setattr(gbl, 'nullptr', cppyy._get_nullptr())
+ setattr(gbl, 'nullptr', _cppyy._get_nullptr())
# install for user access
- cppyy.gbl = gbl
+ _cppyy.gbl = gbl
# install as modules to allow importing from
- sys.modules['cppyy.gbl'] = gbl
- sys.modules['cppyy.gbl.std'] = gbl.std
+ sys.modules['_cppyy.gbl'] = gbl
+ sys.modules['_cppyy.gbl.std'] = gbl.std
# user-defined pythonizations interface
_pythonizations = {}
diff --git a/pypy/module/cppyy/src/callcontext.h b/pypy/module/_cppyy/src/callcontext.h
rename from pypy/module/cppyy/src/callcontext.h
rename to pypy/module/_cppyy/src/callcontext.h
diff --git a/pypy/module/cppyy/src/clingcwrapper.cxx b/pypy/module/_cppyy/src/clingcwrapper.cxx
rename from pypy/module/cppyy/src/clingcwrapper.cxx
rename to pypy/module/_cppyy/src/clingcwrapper.cxx
diff --git a/pypy/module/cppyy/src/dummy_backend.cxx b/pypy/module/_cppyy/src/dummy_backend.cxx
rename from pypy/module/cppyy/src/dummy_backend.cxx
rename to pypy/module/_cppyy/src/dummy_backend.cxx
diff --git a/pypy/module/cppyy/test/Makefile b/pypy/module/_cppyy/test/Makefile
rename from pypy/module/cppyy/test/Makefile
rename to pypy/module/_cppyy/test/Makefile
diff --git a/pypy/module/cppyy/test/__init__.py b/pypy/module/_cppyy/test/__init__.py
rename from pypy/module/cppyy/test/__init__.py
rename to pypy/module/_cppyy/test/__init__.py
diff --git a/pypy/module/cppyy/test/advancedcpp.cxx b/pypy/module/_cppyy/test/advancedcpp.cxx
rename from pypy/module/cppyy/test/advancedcpp.cxx
rename to pypy/module/_cppyy/test/advancedcpp.cxx
diff --git a/pypy/module/cppyy/test/advancedcpp.h b/pypy/module/_cppyy/test/advancedcpp.h
rename from pypy/module/cppyy/test/advancedcpp.h
rename to pypy/module/_cppyy/test/advancedcpp.h
diff --git a/pypy/module/cppyy/test/advancedcpp.xml b/pypy/module/_cppyy/test/advancedcpp.xml
rename from pypy/module/cppyy/test/advancedcpp.xml
rename to pypy/module/_cppyy/test/advancedcpp.xml
diff --git a/pypy/module/cppyy/test/advancedcpp2.cxx b/pypy/module/_cppyy/test/advancedcpp2.cxx
rename from pypy/module/cppyy/test/advancedcpp2.cxx
rename to pypy/module/_cppyy/test/advancedcpp2.cxx
diff --git a/pypy/module/cppyy/test/advancedcpp2.h b/pypy/module/_cppyy/test/advancedcpp2.h
rename from pypy/module/cppyy/test/advancedcpp2.h
rename to pypy/module/_cppyy/test/advancedcpp2.h
diff --git a/pypy/module/cppyy/test/advancedcpp2.xml b/pypy/module/_cppyy/test/advancedcpp2.xml
rename from pypy/module/cppyy/test/advancedcpp2.xml
rename to pypy/module/_cppyy/test/advancedcpp2.xml
diff --git a/pypy/module/cppyy/test/advancedcpp2_LinkDef.h b/pypy/module/_cppyy/test/advancedcpp2_LinkDef.h
rename from pypy/module/cppyy/test/advancedcpp2_LinkDef.h
rename to pypy/module/_cppyy/test/advancedcpp2_LinkDef.h
diff --git a/pypy/module/cppyy/test/advancedcpp_LinkDef.h b/pypy/module/_cppyy/test/advancedcpp_LinkDef.h
rename from pypy/module/cppyy/test/advancedcpp_LinkDef.h
rename to pypy/module/_cppyy/test/advancedcpp_LinkDef.h
diff --git a/pypy/module/cppyy/test/bench1.cxx b/pypy/module/_cppyy/test/bench1.cxx
rename from pypy/module/cppyy/test/bench1.cxx
rename to pypy/module/_cppyy/test/bench1.cxx
diff --git a/pypy/module/cppyy/test/bench1.py b/pypy/module/_cppyy/test/bench1.py
rename from pypy/module/cppyy/test/bench1.py
rename to pypy/module/_cppyy/test/bench1.py
diff --git a/pypy/module/cppyy/test/conftest.py b/pypy/module/_cppyy/test/conftest.py
rename from pypy/module/cppyy/test/conftest.py
rename to pypy/module/_cppyy/test/conftest.py
--- a/pypy/module/cppyy/test/conftest.py
+++ b/pypy/module/_cppyy/test/conftest.py
@@ -3,7 +3,7 @@
@py.test.mark.tryfirst
def pytest_runtest_setup(item):
if py.path.local.sysfind('genreflex') is None:
- import pypy.module.cppyy.capi.loadable_capi as lcapi
+ import pypy.module._cppyy.capi.loadable_capi as lcapi
if 'dummy' in lcapi.reflection_library:
# run only tests that are covered by the dummy backend and tests
# that do not rely on reflex
@@ -30,7 +30,7 @@
def pytest_configure(config):
if py.path.local.sysfind('genreflex') is None:
- import pypy.module.cppyy.capi.loadable_capi as lcapi
+ import pypy.module._cppyy.capi.loadable_capi as lcapi
try:
import ctypes
ctypes.CDLL(lcapi.reflection_library)
diff --git a/pypy/module/cppyy/test/crossing.cxx b/pypy/module/_cppyy/test/crossing.cxx
rename from pypy/module/cppyy/test/crossing.cxx
rename to pypy/module/_cppyy/test/crossing.cxx
diff --git a/pypy/module/cppyy/test/crossing.h b/pypy/module/_cppyy/test/crossing.h
rename from pypy/module/cppyy/test/crossing.h
rename to pypy/module/_cppyy/test/crossing.h
diff --git a/pypy/module/cppyy/test/crossing.xml b/pypy/module/_cppyy/test/crossing.xml
rename from pypy/module/cppyy/test/crossing.xml
rename to pypy/module/_cppyy/test/crossing.xml
diff --git a/pypy/module/cppyy/test/crossing_LinkDef.h b/pypy/module/_cppyy/test/crossing_LinkDef.h
rename from pypy/module/cppyy/test/crossing_LinkDef.h
rename to pypy/module/_cppyy/test/crossing_LinkDef.h
diff --git a/pypy/module/cppyy/test/datatypes.cxx b/pypy/module/_cppyy/test/datatypes.cxx
rename from pypy/module/cppyy/test/datatypes.cxx
rename to pypy/module/_cppyy/test/datatypes.cxx
diff --git a/pypy/module/cppyy/test/datatypes.h b/pypy/module/_cppyy/test/datatypes.h
rename from pypy/module/cppyy/test/datatypes.h
rename to pypy/module/_cppyy/test/datatypes.h
diff --git a/pypy/module/cppyy/test/datatypes.xml b/pypy/module/_cppyy/test/datatypes.xml
rename from pypy/module/cppyy/test/datatypes.xml
rename to pypy/module/_cppyy/test/datatypes.xml
diff --git a/pypy/module/cppyy/test/datatypes_LinkDef.h b/pypy/module/_cppyy/test/datatypes_LinkDef.h
rename from pypy/module/cppyy/test/datatypes_LinkDef.h
rename to pypy/module/_cppyy/test/datatypes_LinkDef.h
diff --git a/pypy/module/cppyy/test/example01.cxx b/pypy/module/_cppyy/test/example01.cxx
rename from pypy/module/cppyy/test/example01.cxx
rename to pypy/module/_cppyy/test/example01.cxx
diff --git a/pypy/module/cppyy/test/example01.h b/pypy/module/_cppyy/test/example01.h
rename from pypy/module/cppyy/test/example01.h
rename to pypy/module/_cppyy/test/example01.h
diff --git a/pypy/module/cppyy/test/example01.xml b/pypy/module/_cppyy/test/example01.xml
rename from pypy/module/cppyy/test/example01.xml
rename to pypy/module/_cppyy/test/example01.xml
diff --git a/pypy/module/cppyy/test/example01_LinkDef.h b/pypy/module/_cppyy/test/example01_LinkDef.h
rename from pypy/module/cppyy/test/example01_LinkDef.h
rename to pypy/module/_cppyy/test/example01_LinkDef.h
diff --git a/pypy/module/cppyy/test/fragile.cxx b/pypy/module/_cppyy/test/fragile.cxx
rename from pypy/module/cppyy/test/fragile.cxx
rename to pypy/module/_cppyy/test/fragile.cxx
diff --git a/pypy/module/cppyy/test/fragile.h b/pypy/module/_cppyy/test/fragile.h
rename from pypy/module/cppyy/test/fragile.h
rename to pypy/module/_cppyy/test/fragile.h
diff --git a/pypy/module/cppyy/test/fragile.xml b/pypy/module/_cppyy/test/fragile.xml
rename from pypy/module/cppyy/test/fragile.xml
rename to pypy/module/_cppyy/test/fragile.xml
diff --git a/pypy/module/cppyy/test/fragile_LinkDef.h b/pypy/module/_cppyy/test/fragile_LinkDef.h
rename from pypy/module/cppyy/test/fragile_LinkDef.h
rename to pypy/module/_cppyy/test/fragile_LinkDef.h
diff --git a/pypy/module/cppyy/test/iotypes.cxx b/pypy/module/_cppyy/test/iotypes.cxx
rename from pypy/module/cppyy/test/iotypes.cxx
rename to pypy/module/_cppyy/test/iotypes.cxx
diff --git a/pypy/module/cppyy/test/iotypes.h b/pypy/module/_cppyy/test/iotypes.h
rename from pypy/module/cppyy/test/iotypes.h
rename to pypy/module/_cppyy/test/iotypes.h
diff --git a/pypy/module/cppyy/test/iotypes.xml b/pypy/module/_cppyy/test/iotypes.xml
rename from pypy/module/cppyy/test/iotypes.xml
rename to pypy/module/_cppyy/test/iotypes.xml
diff --git a/pypy/module/cppyy/test/iotypes_LinkDef.h b/pypy/module/_cppyy/test/iotypes_LinkDef.h
rename from pypy/module/cppyy/test/iotypes_LinkDef.h
rename to pypy/module/_cppyy/test/iotypes_LinkDef.h
diff --git a/pypy/module/cppyy/test/operators.cxx b/pypy/module/_cppyy/test/operators.cxx
rename from pypy/module/cppyy/test/operators.cxx
rename to pypy/module/_cppyy/test/operators.cxx
diff --git a/pypy/module/cppyy/test/operators.h b/pypy/module/_cppyy/test/operators.h
rename from pypy/module/cppyy/test/operators.h
rename to pypy/module/_cppyy/test/operators.h
diff --git a/pypy/module/cppyy/test/operators.xml b/pypy/module/_cppyy/test/operators.xml
rename from pypy/module/cppyy/test/operators.xml
rename to pypy/module/_cppyy/test/operators.xml
diff --git a/pypy/module/cppyy/test/operators_LinkDef.h b/pypy/module/_cppyy/test/operators_LinkDef.h
rename from pypy/module/cppyy/test/operators_LinkDef.h
rename to pypy/module/_cppyy/test/operators_LinkDef.h
diff --git a/pypy/module/cppyy/test/overloads.cxx b/pypy/module/_cppyy/test/overloads.cxx
rename from pypy/module/cppyy/test/overloads.cxx
rename to pypy/module/_cppyy/test/overloads.cxx
diff --git a/pypy/module/cppyy/test/overloads.h b/pypy/module/_cppyy/test/overloads.h
rename from pypy/module/cppyy/test/overloads.h
rename to pypy/module/_cppyy/test/overloads.h
diff --git a/pypy/module/cppyy/test/overloads.xml b/pypy/module/_cppyy/test/overloads.xml
rename from pypy/module/cppyy/test/overloads.xml
rename to pypy/module/_cppyy/test/overloads.xml
diff --git a/pypy/module/cppyy/test/overloads_LinkDef.h b/pypy/module/_cppyy/test/overloads_LinkDef.h
rename from pypy/module/cppyy/test/overloads_LinkDef.h
rename to pypy/module/_cppyy/test/overloads_LinkDef.h
diff --git a/pypy/module/cppyy/test/simple_class.C b/pypy/module/_cppyy/test/simple_class.C
rename from pypy/module/cppyy/test/simple_class.C
rename to pypy/module/_cppyy/test/simple_class.C
diff --git a/pypy/module/cppyy/test/std_streams.cxx b/pypy/module/_cppyy/test/std_streams.cxx
rename from pypy/module/cppyy/test/std_streams.cxx
rename to pypy/module/_cppyy/test/std_streams.cxx
diff --git a/pypy/module/cppyy/test/std_streams.h b/pypy/module/_cppyy/test/std_streams.h
rename from pypy/module/cppyy/test/std_streams.h
rename to pypy/module/_cppyy/test/std_streams.h
diff --git a/pypy/module/cppyy/test/std_streams.xml b/pypy/module/_cppyy/test/std_streams.xml
rename from pypy/module/cppyy/test/std_streams.xml
rename to pypy/module/_cppyy/test/std_streams.xml
diff --git a/pypy/module/cppyy/test/std_streams_LinkDef.h b/pypy/module/_cppyy/test/std_streams_LinkDef.h
rename from pypy/module/cppyy/test/std_streams_LinkDef.h
rename to pypy/module/_cppyy/test/std_streams_LinkDef.h
diff --git a/pypy/module/cppyy/test/stltypes.cxx b/pypy/module/_cppyy/test/stltypes.cxx
rename from pypy/module/cppyy/test/stltypes.cxx
rename to pypy/module/_cppyy/test/stltypes.cxx
diff --git a/pypy/module/cppyy/test/stltypes.h b/pypy/module/_cppyy/test/stltypes.h
rename from pypy/module/cppyy/test/stltypes.h
rename to pypy/module/_cppyy/test/stltypes.h
diff --git a/pypy/module/cppyy/test/stltypes.xml b/pypy/module/_cppyy/test/stltypes.xml
rename from pypy/module/cppyy/test/stltypes.xml
rename to pypy/module/_cppyy/test/stltypes.xml
diff --git a/pypy/module/cppyy/test/stltypes_LinkDef.h b/pypy/module/_cppyy/test/stltypes_LinkDef.h
rename from pypy/module/cppyy/test/stltypes_LinkDef.h
rename to pypy/module/_cppyy/test/stltypes_LinkDef.h
diff --git a/pypy/module/cppyy/test/support.py b/pypy/module/_cppyy/test/support.py
rename from pypy/module/cppyy/test/support.py
rename to pypy/module/_cppyy/test/support.py
--- a/pypy/module/cppyy/test/support.py
+++ b/pypy/module/_cppyy/test/support.py
@@ -6,7 +6,7 @@
def setup_make(targetname):
if sys.platform == 'win32':
py.test.skip("win32 not supported so far")
- import pypy.module.cppyy.capi.loadable_capi as lcapi
+ import pypy.module._cppyy.capi.loadable_capi as lcapi
popen = subprocess.Popen(["make", targetname], cwd=str(currpath),
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = popen.communicate()
diff --git a/pypy/module/cppyy/test/test_aclassloader.py b/pypy/module/_cppyy/test/test_aclassloader.py
rename from pypy/module/cppyy/test/test_aclassloader.py
rename to pypy/module/_cppyy/test/test_aclassloader.py
--- a/pypy/module/cppyy/test/test_aclassloader.py
+++ b/pypy/module/_cppyy/test/test_aclassloader.py
@@ -12,17 +12,17 @@
class AppTestACLASSLOADER:
- spaceconfig = dict(usemodules=['cppyy', '_rawffi', 'itertools'])
+ spaceconfig = dict(usemodules=['_cppyy', '_rawffi', 'itertools'])
def setup_class(cls):
cls.space.appexec([], """():
- import cppyy""")
+ import _cppyy""")
def test01_class_autoloading(self):
"""Test whether a class can be found through .rootmap."""
- import cppyy
- example01_class = cppyy.gbl.example01
+ import _cppyy
+ example01_class = _cppyy.gbl.example01
assert example01_class
- cl2 = cppyy.gbl.example01
+ cl2 = _cppyy.gbl.example01
assert cl2
assert example01_class is cl2
diff --git a/pypy/module/cppyy/test/test_advancedcpp.py b/pypy/module/_cppyy/test/test_advancedcpp.py
rename from pypy/module/cppyy/test/test_advancedcpp.py
rename to pypy/module/_cppyy/test/test_advancedcpp.py
--- a/pypy/module/cppyy/test/test_advancedcpp.py
+++ b/pypy/module/_cppyy/test/test_advancedcpp.py
@@ -1,6 +1,6 @@
import py, os, sys
-from pypy.module.cppyy import capi
+from pypy.module._cppyy import capi
currpath = py.path.local(__file__).dirpath()
@@ -15,21 +15,21 @@
raise OSError("'make' failed (see stderr)")
class AppTestADVANCEDCPP:
- spaceconfig = dict(usemodules=['cppyy', '_rawffi', 'itertools'])
+ spaceconfig = dict(usemodules=['_cppyy', '_rawffi', 'itertools'])
def setup_class(cls):
cls.w_test_dct = cls.space.newtext(test_dct)
cls.w_capi_identity = cls.space.newtext(capi.identify())
cls.w_advanced = cls.space.appexec([], """():
- import cppyy
- return cppyy.load_reflection_info(%r)""" % (test_dct, ))
+ import _cppyy
+ return _cppyy.load_reflection_info(%r)""" % (test_dct, ))
def test01_default_arguments(self):
"""Test usage of default arguments"""
- import cppyy
+ import _cppyy
def test_defaulter(n, t):
- defaulter = getattr(cppyy.gbl, '%s_defaulter' % n)
+ defaulter = getattr(_cppyy.gbl, '%s_defaulter' % n)
d = defaulter()
assert d.m_a == t(11)
@@ -68,9 +68,9 @@
def test02_simple_inheritance(self):
"""Test binding of a basic inheritance structure"""
- import cppyy
- base_class = cppyy.gbl.base_class
- derived_class = cppyy.gbl.derived_class
+ import _cppyy
+ base_class = _cppyy.gbl.base_class
+ derived_class = _cppyy.gbl.derived_class
assert issubclass(derived_class, base_class)
assert not issubclass(base_class, derived_class)
@@ -122,8 +122,8 @@
def test03_namespaces(self):
"""Test access to namespaces and inner classes"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
assert gbl.a_ns is gbl.a_ns
assert gbl.a_ns.d_ns is gbl.a_ns.d_ns
@@ -149,10 +149,10 @@
def test03a_namespace_lookup_on_update(self):
"""Test whether namespaces can be shared across dictionaries."""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
- lib2 = cppyy.load_reflection_info("advancedcpp2Dict.so")
+ lib2 = _cppyy.load_reflection_info("advancedcpp2Dict.so")
assert gbl.a_ns is gbl.a_ns
assert gbl.a_ns.d_ns is gbl.a_ns.d_ns
@@ -178,8 +178,8 @@
def test04_template_types(self):
"""Test bindings of templated types"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
assert gbl.T1 is gbl.T1
assert gbl.T2 is gbl.T2
@@ -244,8 +244,8 @@
def test05_abstract_classes(self):
"""Test non-instatiatability of abstract classes"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
raises(TypeError, gbl.a_class)
raises(TypeError, gbl.some_abstract_class)
@@ -259,12 +259,12 @@
def test06_datamembers(self):
"""Test data member access when using virtual inheritence"""
- import cppyy
- a_class = cppyy.gbl.a_class
- b_class = cppyy.gbl.b_class
- c_class_1 = cppyy.gbl.c_class_1
- c_class_2 = cppyy.gbl.c_class_2
- d_class = cppyy.gbl.d_class
+ import _cppyy
+ a_class = _cppyy.gbl.a_class
+ b_class = _cppyy.gbl.b_class
+ c_class_1 = _cppyy.gbl.c_class_1
+ c_class_2 = _cppyy.gbl.c_class_2
+ d_class = _cppyy.gbl.d_class
assert issubclass(b_class, a_class)
assert issubclass(c_class_1, a_class)
@@ -353,8 +353,8 @@
def test07_pass_by_reference(self):
"""Test reference passing when using virtual inheritance"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
b_class = gbl.b_class
c_class = gbl.c_class_2
d_class = gbl.d_class
@@ -386,71 +386,71 @@
def test08_void_pointer_passing(self):
"""Test passing of variants of void pointer arguments"""
- import cppyy
- pointer_pass = cppyy.gbl.pointer_pass
- some_concrete_class = cppyy.gbl.some_concrete_class
+ import _cppyy
+ pointer_pass = _cppyy.gbl.pointer_pass
+ some_concrete_class = _cppyy.gbl.some_concrete_class
pp = pointer_pass()
o = some_concrete_class()
- assert cppyy.addressof(o) == pp.gime_address_ptr(o)
- assert cppyy.addressof(o) == pp.gime_address_ptr_ptr(o)
- assert cppyy.addressof(o) == pp.gime_address_ptr_ref(o)
+ assert _cppyy.addressof(o) == pp.gime_address_ptr(o)
+ assert _cppyy.addressof(o) == pp.gime_address_ptr_ptr(o)
+ assert _cppyy.addressof(o) == pp.gime_address_ptr_ref(o)
import array
- addressofo = array.array('l', [cppyy.addressof(o)])
+ addressofo = array.array('l', [_cppyy.addressof(o)])
assert addressofo.buffer_info()[0] == pp.gime_address_ptr_ptr(addressofo)
assert 0 == pp.gime_address_ptr(0)
assert 0 == pp.gime_address_ptr(None)
- ptr = cppyy.bind_object(0, some_concrete_class)
- assert cppyy.addressof(ptr) == 0
+ ptr = _cppyy.bind_object(0, some_concrete_class)
+ assert _cppyy.addressof(ptr) == 0
pp.set_address_ptr_ref(ptr)
- assert cppyy.addressof(ptr) == 0x1234
+ assert _cppyy.addressof(ptr) == 0x1234
pp.set_address_ptr_ptr(ptr)
- assert cppyy.addressof(ptr) == 0x4321
+ assert _cppyy.addressof(ptr) == 0x4321
def test09_opaque_pointer_passing(self):
"""Test passing around of opaque pointers"""
- import cppyy
- some_concrete_class = cppyy.gbl.some_concrete_class
+ import _cppyy
+ some_concrete_class = _cppyy.gbl.some_concrete_class
o = some_concrete_class()
# TODO: figure out the PyPy equivalent of CObject (may have to do this
# through the C-API from C++)
- #cobj = cppyy.as_cobject(o)
- addr = cppyy.addressof(o)
+ #cobj = _cppyy.as_cobject(o)
+ addr = _cppyy.addressof(o)
- #assert o == cppyy.bind_object(cobj, some_concrete_class)
- #assert o == cppyy.bind_object(cobj, type(o))
- #assert o == cppyy.bind_object(cobj, o.__class__)
- #assert o == cppyy.bind_object(cobj, "some_concrete_class")
- assert cppyy.addressof(o) == cppyy.addressof(cppyy.bind_object(addr, some_concrete_class))
- assert o == cppyy.bind_object(addr, some_concrete_class)
- assert o == cppyy.bind_object(addr, type(o))
- assert o == cppyy.bind_object(addr, o.__class__)
- assert o == cppyy.bind_object(addr, "some_concrete_class")
- raises(TypeError, cppyy.bind_object, addr, "does_not_exist")
- raises(TypeError, cppyy.bind_object, addr, 1)
+ #assert o == _cppyy.bind_object(cobj, some_concrete_class)
+ #assert o == _cppyy.bind_object(cobj, type(o))
+ #assert o == _cppyy.bind_object(cobj, o.__class__)
+ #assert o == _cppyy.bind_object(cobj, "some_concrete_class")
+ assert _cppyy.addressof(o) == _cppyy.addressof(_cppyy.bind_object(addr, some_concrete_class))
+ assert o == _cppyy.bind_object(addr, some_concrete_class)
+ assert o == _cppyy.bind_object(addr, type(o))
+ assert o == _cppyy.bind_object(addr, o.__class__)
+ assert o == _cppyy.bind_object(addr, "some_concrete_class")
+ raises(TypeError, _cppyy.bind_object, addr, "does_not_exist")
+ raises(TypeError, _cppyy.bind_object, addr, 1)
def test10_object_identity(self):
"""Test object identity"""
- import cppyy
- some_concrete_class = cppyy.gbl.some_concrete_class
- some_class_with_data = cppyy.gbl.some_class_with_data
+ import _cppyy
+ some_concrete_class = _cppyy.gbl.some_concrete_class
+ some_class_with_data = _cppyy.gbl.some_class_with_data
o = some_concrete_class()
- addr = cppyy.addressof(o)
+ addr = _cppyy.addressof(o)
- o2 = cppyy.bind_object(addr, some_concrete_class)
+ o2 = _cppyy.bind_object(addr, some_concrete_class)
assert o is o2
- o3 = cppyy.bind_object(addr, some_class_with_data)
+ o3 = _cppyy.bind_object(addr, some_class_with_data)
assert not o is o3
d1 = some_class_with_data()
@@ -471,11 +471,11 @@
def test11_multi_methods(self):
"""Test calling of methods from multiple inheritance"""
- import cppyy
- multi = cppyy.gbl.multi
+ import _cppyy
+ multi = _cppyy.gbl.multi
- assert cppyy.gbl.multi1 is multi.__bases__[0]
- assert cppyy.gbl.multi2 is multi.__bases__[1]
+ assert _cppyy.gbl.multi1 is multi.__bases__[0]
+ assert _cppyy.gbl.multi2 is multi.__bases__[1]
dict_keys = multi.__dict__.keys()
assert dict_keys.count('get_my_own_int') == 1
@@ -490,9 +490,9 @@
def test12_actual_type(self):
"""Test that a pointer to base return does an auto-downcast"""
- import cppyy
- base_class = cppyy.gbl.base_class
- derived_class = cppyy.gbl.derived_class
+ import _cppyy
+ base_class = _cppyy.gbl.base_class
+ derived_class = _cppyy.gbl.derived_class
b = base_class()
d = derived_class()
@@ -519,30 +519,30 @@
assert not isinstance(voidp, base_class)
assert not isinstance(voidp, derived_class)
- d1 = cppyy.bind_object(voidp, base_class, cast=True)
+ d1 = _cppyy.bind_object(voidp, base_class, cast=True)
assert isinstance(d1, derived_class)
assert d1 is d
- b1 = cppyy.bind_object(voidp, base_class)
+ b1 = _cppyy.bind_object(voidp, base_class)
assert isinstance(b1, base_class)
- assert cppyy.addressof(b1) == cppyy.addressof(d)
+ assert _cppyy.addressof(b1) == _cppyy.addressof(d)
assert not (b1 is d)
def test13_actual_type_virtual_multi(self):
"""Test auto-downcast in adverse inheritance situation"""
- import cppyy
+ import _cppyy
- c1 = cppyy.gbl.create_c1()
- assert type(c1) == cppyy.gbl.c_class_1
+ c1 = _cppyy.gbl.create_c1()
+ assert type(c1) == _cppyy.gbl.c_class_1
assert c1.m_c == 3
c1.destruct()
if self.capi_identity == 'CINT': # CINT does not support dynamic casts
return
- c2 = cppyy.gbl.create_c2()
- assert type(c2) == cppyy.gbl.c_class_2
+ c2 = _cppyy.gbl.create_c2()
+ assert type(c2) == _cppyy.gbl.c_class_2
assert c2.m_c == 3
c2.destruct()
@@ -558,11 +558,11 @@
if self.capi_identity != 'CINT': # don't test anything for Reflex
return
- import cppyy
+ import _cppyy
- assert cppyy.gbl.new_overloader.s_instances == 0
- nl = cppyy.gbl.new_overloader()
- assert cppyy.gbl.new_overloader.s_instances == 1
+ assert _cppyy.gbl.new_overloader.s_instances == 0
+ nl = _cppyy.gbl.new_overloader()
+ assert _cppyy.gbl.new_overloader.s_instances == 1
nl.destruct()
if self.capi_identity == 'CINT': # do not test delete
@@ -570,16 +570,16 @@
import gc
gc.collect()
- assert cppyy.gbl.new_overloader.s_instances == 0
+ assert _cppyy.gbl.new_overloader.s_instances == 0
def test15_template_instantiation_with_vector_of_float(self):
"""Test template instantiation with a std::vector<float>"""
- import cppyy
+ import _cppyy
# the following will simply fail if there is a naming problem (e.g.
# std::, allocator<int>, etc., etc.); note the parsing required ...
- b = cppyy.gbl.my_templated_class(cppyy.gbl.std.vector(float))()
+ b = _cppyy.gbl.my_templated_class(_cppyy.gbl.std.vector(float))()
for i in range(5):
b.m_b.push_back(i)
@@ -588,9 +588,9 @@
def test16_template_member_functions(self):
"""Test template member functions lookup and calls"""
- import cppyy
+ import _cppyy
- m = cppyy.gbl.my_templated_method_class()
+ m = _cppyy.gbl.my_templated_method_class()
assert m.get_size('char')() == m.get_char_size()
assert m.get_size(int)() == m.get_int_size()
@@ -603,9 +603,9 @@
def test17_template_global_functions(self):
"""Test template global function lookup and calls"""
- import cppyy
+ import _cppyy
- f = cppyy.gbl.my_templated_function
+ f = _cppyy.gbl.my_templated_function
assert f('c') == 'c'
assert type(f('c')) == type('c')
@@ -615,7 +615,7 @@
def test18_assign_to_return_byref( self ):
"""Test assignment to an instance returned by reference"""
- from cppyy import gbl
+ from _cppyy import gbl
a = gbl.std.vector(gbl.ref_tester)()
a.push_back(gbl.ref_tester(42))
@@ -631,7 +631,7 @@
def test19_math_converters(self):
"""Test operator int/long/double incl. typedef"""
- from cppyy import gbl
+ from _cppyy import gbl
a = gbl.some_convertible()
a.m_i = 1234
@@ -647,7 +647,7 @@
def test20_comparator(self):
"""Check that the global operator!=/== is picked up"""
- from cppyy import gbl
+ from _cppyy import gbl
a, b = gbl.some_comparable(), gbl.some_comparable()
@@ -665,18 +665,18 @@
def test21_overload_order_with_proper_return(self):
"""Test return type against proper overload w/ const and covariance"""
- import cppyy
+ import _cppyy
- assert cppyy.gbl.overload_one_way().gime() == 1
- assert cppyy.gbl.overload_the_other_way().gime() == "aap"
+ assert _cppyy.gbl.overload_one_way().gime() == 1
+ assert _cppyy.gbl.overload_the_other_way().gime() == "aap"
def test22_access_to_global_variables(self):
"""Access global_variables_and_pointers"""
- import cppyy
+ import _cppyy
- assert cppyy.gbl.my_global_double == 12.
- assert len(cppyy.gbl.my_global_array) == 500
+ assert _cppyy.gbl.my_global_double == 12.
+ assert len(_cppyy.gbl.my_global_array) == 500
# TODO: currently fails b/c double** not understood as &double*
- #assert cppyy.gbl.my_global_ptr[0] == 1234.
+ #assert _cppyy.gbl.my_global_ptr[0] == 1234.
diff --git a/pypy/module/cppyy/test/test_cppyy.py b/pypy/module/_cppyy/test/test_cppyy.py
rename from pypy/module/cppyy/test/test_cppyy.py
rename to pypy/module/_cppyy/test/test_cppyy.py
--- a/pypy/module/cppyy/test/test_cppyy.py
+++ b/pypy/module/_cppyy/test/test_cppyy.py
@@ -1,7 +1,7 @@
import py, os, sys
import subprocess
-from pypy.module.cppyy import interp_cppyy, executor
+from pypy.module._cppyy import interp_cppyy, executor
from .support import setup_make
@@ -27,13 +27,13 @@
class AppTestCPPYY:
- spaceconfig = dict(usemodules=['cppyy', '_rawffi', 'itertools'])
+ spaceconfig = dict(usemodules=['_cppyy', '_rawffi', 'itertools'])
def setup_class(cls):
cls.w_example01, cls.w_payload = cls.space.unpackiterable(cls.space.appexec([], """():
- import cppyy
- cppyy.load_reflection_info(%r)
- return cppyy._scope_byname('example01'), cppyy._scope_byname('payload')""" % (test_dct, )))
+ import _cppyy
+ _cppyy.load_reflection_info(%r)
+ return _cppyy._scope_byname('example01'), _cppyy._scope_byname('payload')""" % (test_dct, )))
def test01_static_int(self):
"""Test passing of an int, returning of an int, and overloading on a
@@ -86,7 +86,7 @@
def test04_method_int(self):
"""Test passing of a int, returning of a int, and memory cleanup, on
a method."""
- import cppyy
+ import _cppyy
t = self.example01
@@ -119,7 +119,7 @@
"""Test memory destruction and integrity."""
import gc
- import cppyy
+ import _cppyy
t = self.example01
@@ -150,7 +150,7 @@
def test05a_memory2(self):
"""Test ownership control."""
- import gc, cppyy
+ import gc, _cppyy
t = self.example01
@@ -171,7 +171,7 @@
def test06_method_double(self):
"""Test passing of a double and returning of double on a method."""
- import cppyy
+ import _cppyy
t = self.example01
@@ -189,7 +189,7 @@
def test07_method_constcharp(self):
"""Test passing of a C string and returning of a C string on a
method."""
- import cppyy
+ import _cppyy
t = self.example01
@@ -205,7 +205,7 @@
def test08_pass_object_by_pointer(self):
"""Test passing of an instance as an argument."""
- import cppyy
+ import _cppyy
t1 = self.example01
t2 = self.payload
@@ -225,7 +225,7 @@
def test09_return_object_by_pointer(self):
"""Test returning of an instance as an argument."""
- import cppyy
+ import _cppyy
t1 = self.example01
t2 = self.payload
diff --git a/pypy/module/cppyy/test/test_crossing.py b/pypy/module/_cppyy/test/test_crossing.py
rename from pypy/module/cppyy/test/test_crossing.py
rename to pypy/module/_cppyy/test/test_crossing.py
--- a/pypy/module/cppyy/test/test_crossing.py
+++ b/pypy/module/_cppyy/test/test_crossing.py
@@ -68,14 +68,14 @@
return str(pydname)
class AppTestCrossing:
- spaceconfig = dict(usemodules=['cppyy', '_rawffi', 'itertools'])
+ spaceconfig = dict(usemodules=['_cppyy', '_rawffi', 'itertools'])
def setup_class(cls):
- # cppyy specific additions (note that test_dct is loaded late
+ # _cppyy specific additions (note that test_dct is loaded late
# to allow the generated extension module be loaded first)
cls.w_test_dct = cls.space.newtext(test_dct)
cls.w_pre_imports = cls.space.appexec([], """():
- import ctypes, cppyy""") # prevents leak-checking complaints on ctypes' statics
+ import ctypes, _cppyy""") # prevents leak-checking complaints on ctypes' statics
def setup_method(self, func):
@unwrap_spec(name='text', init='text', body='text')
@@ -145,11 +145,11 @@
def test02_crossing_dict(self):
"""Test availability of all needed classes in the dict"""
- import cppyy
- cppyy.load_reflection_info(self.test_dct)
+ import _cppyy
+ _cppyy.load_reflection_info(self.test_dct)
- assert cppyy.gbl.crossing == cppyy.gbl.crossing
- crossing = cppyy.gbl.crossing
+ assert _cppyy.gbl.crossing == _cppyy.gbl.crossing
+ crossing = _cppyy.gbl.crossing
assert crossing.A == crossing.A
@@ -157,8 +157,8 @@
def test03_send_pyobject(self):
"""Test sending a true pyobject to C++"""
- import cppyy
- crossing = cppyy.gbl.crossing
+ import _cppyy
+ crossing = _cppyy.gbl.crossing
a = crossing.A()
assert a.unwrap(13) == 13
@@ -167,8 +167,8 @@
def test04_send_and_receive_pyobject(self):
"""Test receiving a true pyobject from C++"""
- import cppyy
- crossing = cppyy.gbl.crossing
+ import _cppyy
+ crossing = _cppyy.gbl.crossing
a = crossing.A()
diff --git a/pypy/module/cppyy/test/test_datatypes.py b/pypy/module/_cppyy/test/test_datatypes.py
rename from pypy/module/cppyy/test/test_datatypes.py
rename to pypy/module/_cppyy/test/test_datatypes.py
--- a/pypy/module/cppyy/test/test_datatypes.py
+++ b/pypy/module/_cppyy/test/test_datatypes.py
@@ -9,26 +9,26 @@
setup_make("datatypesDict.so")
class AppTestDATATYPES:
- spaceconfig = dict(usemodules=['cppyy', '_rawffi', 'itertools'])
+ spaceconfig = dict(usemodules=['_cppyy', '_rawffi', 'itertools'])
def setup_class(cls):
cls.w_test_dct = cls.space.newtext(test_dct)
cls.w_datatypes = cls.space.appexec([], """():
- import cppyy
- return cppyy.load_reflection_info(%r)""" % (test_dct, ))
+ import _cppyy
+ return _cppyy.load_reflection_info(%r)""" % (test_dct, ))
cls.w_N = cls.space.newint(5) # should be imported from the dictionary
def test01_load_reflection_cache(self):
"""Loading reflection info twice should result in the same object"""
- import cppyy
- lib2 = cppyy.load_reflection_info(self.test_dct)
+ import _cppyy
+ lib2 = _cppyy.load_reflection_info(self.test_dct)
assert self.datatypes is lib2
def test02_instance_data_read_access(self):
"""Read access to instance public data and verify values"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -115,8 +115,8 @@
def test03_instance_data_write_access(self):
"""Test write access to instance public data and verify values"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -202,8 +202,8 @@
def test04_array_passing(self):
"""Test passing of array arguments"""
- import cppyy, array, sys
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy, array, sys
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -232,16 +232,16 @@
raises(Exception, c.pass_array(0).__getitem__, 0) # raises SegfaultException
assert not c.pass_array(None)
raises(Exception, c.pass_array(None).__getitem__, 0) # id.
- assert not c.pass_array(cppyy.gbl.nullptr)
- raises(Exception, c.pass_array(cppyy.gbl.nullptr).__getitem__, 0) # id. id.
+ assert not c.pass_array(_cppyy.gbl.nullptr)
+ raises(Exception, c.pass_array(_cppyy.gbl.nullptr).__getitem__, 0) # id. id.
c.destruct()
def test05_class_read_access(self):
"""Test read access to class public data and verify values"""
- import cppyy, sys
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy, sys
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -281,8 +281,8 @@
def test06_class_data_write_access(self):
"""Test write access to class public data and verify values"""
- import cppyy, sys
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy, sys
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -345,8 +345,8 @@
def test07_range_access(self):
"""Test the ranges of integer types"""
- import cppyy, sys
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy, sys
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -361,8 +361,8 @@
def test08_type_conversions(self):
"""Test conversions between builtin types"""
- import cppyy, sys
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy, sys
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -379,8 +379,8 @@
def test09_global_builtin_type(self):
"""Test access to a global builtin type"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
assert gbl.g_int == gbl.get_global_int()
@@ -395,8 +395,8 @@
def test10_global_ptr(self):
"""Test access of global objects through a pointer"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
raises(ReferenceError, 'gbl.g_pod.m_int')
@@ -426,10 +426,10 @@
def test11_enum(self):
"""Test access to enums"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
- CppyyTestData = cppyy.gbl.CppyyTestData
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -474,8 +474,8 @@
def test12_string_passing(self):
"""Test passing/returning of a const char*"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert c.get_valid_string('aap') == 'aap'
@@ -484,8 +484,8 @@
def test13_copy_contructor(self):
"""Test copy constructor"""
- import cppyy
- FourVector = cppyy.gbl.FourVector
+ import _cppyy
+ FourVector = _cppyy.gbl.FourVector
t1 = FourVector(1., 2., 3., -4.)
t2 = FourVector(0., 0., 0., 0.)
@@ -500,9 +500,9 @@
def test14_object_returns(self):
"""Test access to and return of PODs"""
- import cppyy
+ import _cppyy
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
assert c.m_pod.m_int == 888
assert c.m_pod.m_double == 3.14
@@ -527,13 +527,13 @@
def test15_object_arguments(self):
"""Test setting and returning of a POD through arguments"""
- import cppyy
+ import _cppyy
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
assert c.m_pod.m_int == 888
assert c.m_pod.m_double == 3.14
- p = cppyy.gbl.CppyyTestPod()
+ p = _cppyy.gbl.CppyyTestPod()
p.m_int = 123
assert p.m_int == 123
p.m_double = 321.
@@ -543,12 +543,12 @@
assert c.m_pod.m_int == 123
assert c.m_pod.m_double == 321.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_ptr_in(p)
assert c.m_pod.m_int == 123
assert c.m_pod.m_double == 321.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_ptr_out(p)
assert p.m_int == 888
assert p.m_double == 3.14
@@ -556,26 +556,26 @@
p.m_int = 555
p.m_double = 666.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_ref(p)
assert c.m_pod.m_int == 555
assert c.m_pod.m_double == 666.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_ptrptr_in(p)
assert c.m_pod.m_int == 555
assert c.m_pod.m_double == 666.
assert p.m_int == 555
assert p.m_double == 666.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_void_ptrptr_in(p)
assert c.m_pod.m_int == 555
assert c.m_pod.m_double == 666.
assert p.m_int == 555
assert p.m_double == 666.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_ptrptr_out(p)
assert c.m_pod.m_int == 888
assert c.m_pod.m_double == 3.14
@@ -585,7 +585,7 @@
p.m_int = 777
p.m_double = 888.
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
c.set_pod_void_ptrptr_out(p)
assert c.m_pod.m_int == 888
assert c.m_pod.m_double == 3.14
@@ -595,10 +595,10 @@
def test16_nullptr_passing(self):
"""Integer 0 ('NULL') and None allowed to pass through instance*"""
- import cppyy
+ import _cppyy
for o in (0, None):
- c = cppyy.gbl.CppyyTestData()
+ c = _cppyy.gbl.CppyyTestData()
assert c.m_pod.m_int == 888
assert c.m_pod.m_double == 3.14
assert not not c.m_ppod
@@ -610,8 +610,8 @@
def test17_respect_privacy(self):
"""Test that privacy settings are respected"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
assert isinstance(c, CppyyTestData)
@@ -623,26 +623,26 @@
def test18_object_and_pointer_comparisons(self):
"""Verify object and pointer comparisons"""
- import cppyy
- gbl = cppyy.gbl
+ import _cppyy
+ gbl = _cppyy.gbl
- c1 = cppyy.bind_object(0, gbl.CppyyTestData)
+ c1 = _cppyy.bind_object(0, gbl.CppyyTestData)
assert c1 == None
assert None == c1
- c2 = cppyy.bind_object(0, gbl.CppyyTestData)
+ c2 = _cppyy.bind_object(0, gbl.CppyyTestData)
assert c1 == c2
assert c2 == c1
# FourVector overrides operator==
- l1 = cppyy.bind_object(0, gbl.FourVector)
+ l1 = _cppyy.bind_object(0, gbl.FourVector)
assert l1 == None
assert None == l1
assert c1 != l1
assert l1 != c1
- l2 = cppyy.bind_object(0, gbl.FourVector)
+ l2 = _cppyy.bind_object(0, gbl.FourVector)
assert l1 == l2
assert l2 == l1
@@ -660,7 +660,7 @@
def test19_object_validity(self):
"""Test object validity checking"""
- from cppyy import gbl
+ from _cppyy import gbl
d = gbl.CppyyTestPod()
@@ -674,8 +674,8 @@
def test20_buffer_reshaping(self):
"""Test usage of buffer sizing"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
for func in ['get_bool_array', 'get_bool_array2',
@@ -695,34 +695,34 @@
def test21_voidp(self):
"""Test usage of void* data"""
- import cppyy
- CppyyTestData = cppyy.gbl.CppyyTestData
+ import _cppyy
+ CppyyTestData = _cppyy.gbl.CppyyTestData
c = CppyyTestData()
- assert not cppyy.gbl.nullptr
+ assert not _cppyy.gbl.nullptr
- assert c.s_voidp is cppyy.gbl.nullptr
- assert CppyyTestData.s_voidp is cppyy.gbl.nullptr
+ assert c.s_voidp is _cppyy.gbl.nullptr
+ assert CppyyTestData.s_voidp is _cppyy.gbl.nullptr
- assert c.m_voidp is cppyy.gbl.nullptr
- assert c.get_voidp() is cppyy.gbl.nullptr
+ assert c.m_voidp is _cppyy.gbl.nullptr
+ assert c.get_voidp() is _cppyy.gbl.nullptr
c2 = CppyyTestData()
- assert c2.m_voidp is cppyy.gbl.nullptr
+ assert c2.m_voidp is _cppyy.gbl.nullptr
c.set_voidp(c2.m_voidp)
- assert c.m_voidp is cppyy.gbl.nullptr
+ assert c.m_voidp is _cppyy.gbl.nullptr
c.set_voidp(c2.get_voidp())
- assert c.m_voidp is cppyy.gbl.nullptr
- c.set_voidp(cppyy.gbl.nullptr)
- assert c.m_voidp is cppyy.gbl.nullptr
+ assert c.m_voidp is _cppyy.gbl.nullptr
+ c.set_voidp(_cppyy.gbl.nullptr)
+ assert c.m_voidp is _cppyy.gbl.nullptr
c.set_voidp(c2)
def address_equality_test(a, b):
- assert cppyy.addressof(a) == cppyy.addressof(b)
- b2 = cppyy.bind_object(a, CppyyTestData)
+ assert _cppyy.addressof(a) == _cppyy.addressof(b)
+ b2 = _cppyy.bind_object(a, CppyyTestData)
assert b is b2 # memory regulator recycles
- b3 = cppyy.bind_object(cppyy.addressof(a), CppyyTestData)
+ b3 = _cppyy.bind_object(_cppyy.addressof(a), CppyyTestData)
assert b is b3 # likewise
address_equality_test(c.m_voidp, c2)
@@ -730,8 +730,8 @@
def null_test(null):
c.m_voidp = null
- assert c.m_voidp is cppyy.gbl.nullptr
- map(null_test, [0, None, cppyy.gbl.nullptr])
+ assert c.m_voidp is _cppyy.gbl.nullptr
+ map(null_test, [0, None, _cppyy.gbl.nullptr])
c.m_voidp = c2
address_equality_test(c.m_voidp, c2)
diff --git a/pypy/module/cppyy/test/test_fragile.py b/pypy/module/_cppyy/test/test_fragile.py
rename from pypy/module/cppyy/test/test_fragile.py
rename to pypy/module/_cppyy/test/test_fragile.py
--- a/pypy/module/cppyy/test/test_fragile.py
+++ b/pypy/module/_cppyy/test/test_fragile.py
@@ -1,6 +1,6 @@
import py, os, sys
-from pypy.module.cppyy import capi
+from pypy.module._cppyy import capi
currpath = py.path.local(__file__).dirpath()
@@ -14,35 +14,35 @@
raise OSError("'make' failed (see stderr)")
More information about the pypy-commit
mailing list