Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
2c5d6923
Commit
2c5d6923
authored
Oct 06, 2016
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temp
parent
b60caa9f
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
324 additions
and
18 deletions
+324
-18
CMakeLists.txt
CMakeLists.txt
+1
-1
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+1
-1
from_cpython/Include/object.h
from_cpython/Include/object.h
+4
-1
from_cpython/setup.py
from_cpython/setup.py
+12
-2
src/capi/object.cpp
src/capi/object.cpp
+49
-1
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+16
-0
src/runtime/descr.cpp
src/runtime/descr.cpp
+3
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+2
-1
src/runtime/types.cpp
src/runtime/types.cpp
+11
-3
test/integration/getZope.sh
test/integration/getZope.sh
+72
-0
test/integration/pycrypto_test.py
test/integration/pycrypto_test.py
+0
-1
test/integration/pyinotify_test.py
test/integration/pyinotify_test.py
+0
-1
test/integration/pytest_test.py
test/integration/pytest_test.py
+0
-1
test/integration/pyxl_test.py
test/integration/pyxl_test.py
+0
-1
test/integration/sqlalchemy_smalltest.py
test/integration/sqlalchemy_smalltest.py
+0
-1
test/integration/virtualenv_test.py
test/integration/virtualenv_test.py
+0
-1
test/integration/zope_test.py
test/integration/zope_test.py
+148
-0
test/tests/capi_slots.py
test/tests/capi_slots.py
+1
-0
test/tests/compile_test2.py
test/tests/compile_test2.py
+0
-1
test/tests/curses_test.py
test/tests/curses_test.py
+1
-0
test/tests/extension.py
test/tests/extension.py
+1
-0
test/tests/test_dictviews.py
test/tests/test_dictviews.py
+0
-1
test/tests/type_creation.py
test/tests/type_creation.py
+1
-0
test/tests/type_flags.py
test/tests/type_flags.py
+1
-0
No files found.
CMakeLists.txt
View file @
2c5d6923
...
...
@@ -273,7 +273,7 @@ if(ENABLE_OPROFILE)
endif
()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wall -Wextra -Werror -Wreturn-type -Wno-sign-compare -Wno-unused -Wno-unused-parameter -fno-omit-frame-pointer -g"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
CMAKE_C_FLAGS
}
-std=c++11 -fno-rtti -fexceptions -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -Woverloaded-virtual -Wno-invalid-offsetof -Wcast-qual -Wno-sign-conversion -Wnon-virtual-dtor -Winit-self -Wmissing-include-dirs -Wstrict-overflow=5 -Wpointer-arith -Wtype-limits -Wwrite-strings -Wempty-body -Waggregate-return -Wmissing-field-initializers -Wredundant-decls -Winline -Wint-to-pointer-cast -Wlong-long -Wvla -Wno-attributes -g"
)
set
(
CMAKE_CXX_FLAGS
"$
ENV{CPPFLAGS}
$
{
CMAKE_CXX_FLAGS
}
${
CMAKE_C_FLAGS
}
-std=c++11 -fno-rtti -fexceptions -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -Woverloaded-virtual -Wno-invalid-offsetof -Wcast-qual -Wno-sign-conversion -Wnon-virtual-dtor -Winit-self -Wmissing-include-dirs -Wstrict-overflow=5 -Wpointer-arith -Wtype-limits -Wwrite-strings -Wempty-body -Waggregate-return -Wmissing-field-initializers -Wredundant-decls -Winline -Wint-to-pointer-cast -Wlong-long -Wvla -Wno-attributes -g"
)
set
(
CLANG_FLAGS
"
${
CLANG_FLAGS
}
-Wimplicit-int -Wstrict-prototypes -Wold-style-definition -Wnested-externs -Wpointer-to-int-cast -Wno-mismatched-tags -Wno-extern-c-compat"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
...
...
from_cpython/CMakeLists.txt
View file @
2c5d6923
...
...
@@ -161,7 +161,7 @@ file(GLOB_RECURSE STDPARSER_SRCS Parser
tokenizer.c
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-Wno-missing-field-initializers -Wno-tautological-compare -Wno-type-limits -Wno-unused-result -Wno-strict-aliasing -DPy_BUILD_CORE"
)
set
(
CMAKE_C_FLAGS
"$
ENV{CPPFLAGS}
$
{
CMAKE_C_FLAGS
}
-Wno-missing-field-initializers -Wno-tautological-compare -Wno-type-limits -Wno-unused-result -Wno-strict-aliasing -DPy_BUILD_CORE"
)
add_library
(
FROM_CPYTHON OBJECT
${
STDMODULE_SRCS
}
${
STDOBJECT_SRCS
}
${
STDPYTHON_SRCS
}
${
STDPARSER_SRCS
}
)
add_dependencies
(
FROM_CPYTHON copy_stdlib
)
...
...
from_cpython/Include/object.h
View file @
2c5d6923
...
...
@@ -433,7 +433,7 @@ typedef PyObject *(*allocfunc)(PyTypeObject *, Py_ssize_t);
/* Type attribute cache version tag. Added in version 2.6 */
\
/* Pyston change: change uint to 64bit uint
unsigned int tp_version_tag; */
\
PY_UINT64_T
tp_version_tag; \
uint64_t
tp_version_tag; \
\
/* Pyston changes: added these fields */
\
...
...
@@ -539,6 +539,9 @@ PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *) PYSTON_NOEXCEPT;
PyAPI_FUNC
(
int
)
PyObject_SetAttr
(
PyObject
*
,
PyObject
*
,
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
int
)
PyObject_HasAttr
(
PyObject
*
,
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
**
)
_PyObject_GetDictPtr
(
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
PyObject_GetDict
(
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
void
)
PyObject_ClearDict
(
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
void
)
PyObject_SetDict
(
PyObject
*
,
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
PyObject_SelfIter
(
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
_PyObject_NextNotImplemented
(
PyObject
*
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
PyObject_GenericGetAttr
(
PyObject
*
,
PyObject
*
)
PYSTON_NOEXCEPT
;
...
...
from_cpython/setup.py
View file @
2c5d6923
...
...
@@ -2116,8 +2116,10 @@ class PyBuildExt(build_ext):
self
.
compiler
.
src_extensions
.
append
(
'.S'
)
include_dirs
=
[
os
.
path
.
join
(
ffi_builddir
,
'include'
),
ffi_builddir
,
[]
,
os
.
path
.
join
(
ffi_srcdir
,
'src'
)]
print
(
"In configuration!!!!!!!!!!"
)
print
(
include_dirs
)
extra_compile_args
=
fficonfig
[
'ffi_cflags'
].
split
()
ext
.
sources
.
extend
(
os
.
path
.
join
(
ffi_srcdir
,
f
)
for
f
in
...
...
@@ -2161,6 +2163,11 @@ class PyBuildExt(build_ext):
elif
host_platform
.
startswith
(
'hp-ux'
):
extra_link_args
.
append
(
'-fPIC'
)
print
(
"Is everything OK?"
)
print
(
"***********************************"
)
print
(
include_dirs
)
print
(
sources
)
print
(
depends
)
ext
=
Extension
(
'_ctypes'
,
include_dirs
=
include_dirs
,
extra_compile_args
=
extra_compile_args
,
...
...
@@ -2201,6 +2208,9 @@ class PyBuildExt(build_ext):
ffi_lib
=
lib_name
break
print
(
"ffi in----------------------"
)
print
(
ffi_inc
)
print
(
ffi_lib
)
if
ffi_inc
and
ffi_lib
:
ext
.
include_dirs
.
extend
(
ffi_inc
)
ext
.
libraries
.
append
(
ffi_lib
)
...
...
src/capi/object.cpp
View file @
2c5d6923
...
...
@@ -20,6 +20,7 @@
#include "capi/types.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/hiddenclass.h"
#include "runtime/import.h"
#include "runtime/objmodel.h"
#include "runtime/types.h"
...
...
@@ -609,11 +610,58 @@ extern "C" PyObject** _PyObject_GetDictPtr(PyObject* obj) noexcept {
}
return
(
PyObject
**
)((
char
*
)
obj
+
dictoffset
);
}
else
{
// Box* attrwrapper = tp->getAttrWrapper();
// Box* new_dict = unwrapAttrWrapper(attrwrapper);
// return (PyObject**)(&new_dict);
// return (PyObject**)&unwrapAttrWrapper(attrwrapper);
// auto new_dict = PyDict_New();
// PyDict_Update(new_dict, attrwrapper);
// return (PyObject**)&new_dict;
// HCAttrs* hcattrs = obj->getHCAttrsPtr();
// HiddenClass* hcls = hcattrs->hcls;
// int offset = hcls->getAsSingletonOrNormal()->getAttrwrapperOffset();
// if (offset != -1) {
// AttrWrapper* wrapper = (AttrWrapper*)(hcattrs->attr_list->attrs[offset]);
// BoxedDict*
// BoxedDict* dict = (BoxedDict*)AttrWrapper::copy(obj);
// convertAttrwrapperToPrivateDict(wrapper);
// return &wrapper;
// return wrapper->getUnderlying();
// }
fatalOrError
(
PyExc_NotImplementedError
,
"unimplemented for hcattrs"
);
return
nullptr
;
}
}
extern
"C"
PyObject
*
PyObject_GetDict
(
PyObject
*
obj
)
noexcept
{
PyTypeObject
*
tp
=
Py_TYPE
(
obj
);
if
(
!
tp
->
instancesHaveHCAttrs
())
{
return
obj
->
getDict
();
}
else
{
Box
*
attrwrapper
=
obj
->
getAttrWrapper
();
convertAttrwrapperToPrivateDict
(
attrwrapper
);
return
unwrapAttrWrapper
(
attrwrapper
);
}
}
extern
"C"
void
PyObject_ClearDict
(
PyObject
*
obj
)
noexcept
{
obj
->
clearAttrsForDealloc
();
}
extern
"C"
void
PyObject_SetDict
(
PyObject
*
obj
,
PyObject
*
dict
)
noexcept
{
PyObject
*
d_key
,
*
d_value
;
Py_ssize_t
i
=
0
;
while
(
PyDict_Next
(
dict
,
&
i
,
&
d_key
,
&
d_value
))
{
if
(
PyString_CheckExact
(
d_key
))
{
Py_INCREF
(
d_key
);
PyString_InternInPlace
(
&
d_key
);
Py_DECREF
(
d_key
);
}
if
(
PyObject_SetAttr
(
obj
,
d_key
,
d_value
)
<
0
)
return
;
}
}
/* These methods are used to control infinite recursion in repr, str, print,
etc. Container objects that may recursively contain themselves,
e.g. builtin dictionaries and lists, should used Py_ReprEnter() and
...
...
@@ -1148,7 +1196,7 @@ extern "C" void _Py_NegativeRefcount(const char* fname, int lineno, PyObject* op
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"%s:%i object at %p has negative ref count "
"%"
PY_FORMAT_SIZE_T
"d.
\033
[40mwatch -l *(long*)%p
\033
[0m"
,
fname
,
lineno
,
op
,
op
->
ob_refcnt
,
&
op
->
ob_refcnt
);
Py_FatalError
(
buf
);
//
Py_FatalError(buf);
}
#endif
/* Py_REF_DEBUG */
...
...
src/runtime/builtin_modules/sys.cpp
View file @
2c5d6923
...
...
@@ -50,6 +50,8 @@ int _Py_QnewFlag = 0;
// this flag is one of the few levers we have to avoid hitting those paths.
int
Py_DontWriteBytecodeFlag
=
1
;
int
Py_NoUserSiteDirectory
=
0
;
int
_Py_Ticker
=
0
;
int
_Py_CheckInterval
=
100
;
}
Box
*
sysExcInfo
()
{
...
...
@@ -430,6 +432,18 @@ size_t _PySys_GetSizeOf(PyObject* o) {
return
(
size_t
)
size
;
}
static
PyObject
*
sys_setcheckinterval
(
PyObject
*
self
,
PyObject
*
args
)
noexcept
{
if
(
!
PyArg_ParseTuple
(
args
,
"i:setcheckinterval"
,
&
_Py_CheckInterval
))
return
NULL
;
_Py_Ticker
=
_Py_CheckInterval
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyObject
*
sys_getcheckinterval
(
PyObject
*
self
,
PyObject
*
args
)
noexcept
{
return
PyInt_FromLong
(
_Py_CheckInterval
);
}
static
PyObject
*
sys_getsizeof
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
noexcept
{
static
const
char
*
kwlist
[]
=
{
"object"
,
"default"
,
0
};
size_t
size
;
...
...
@@ -545,6 +559,8 @@ static PyMethodDef sys_methods[] = {
{
"excepthook"
,
sys_excepthook
,
METH_VARARGS
,
excepthook_doc
},
{
"displayhook"
,
sys_displayhook
,
METH_O
,
displayhook_doc
},
{
"_clear_type_cache"
,
sys_clear_type_cache
,
METH_NOARGS
,
sys_clear_type_cache__doc__
},
{
"setcheckinterval"
,
sys_setcheckinterval
,
METH_VARARGS
,
NULL
},
{
"getcheckinterval"
,
sys_getcheckinterval
,
METH_NOARGS
,
NULL
},
{
"getrefcount"
,
(
PyCFunction
)
sys_getrefcount
,
METH_O
,
getrefcount_doc
},
{
"getsizeof"
,
(
PyCFunction
)
sys_getsizeof
,
METH_VARARGS
|
METH_KEYWORDS
,
getsizeof_doc
},
};
...
...
src/runtime/descr.cpp
View file @
2c5d6923
...
...
@@ -252,6 +252,9 @@ Box* methodDescrTppCall(Box* _self, CallRewriteArgs* rewrite_args, ArgPassSpec a
rewrite_args
->
obj
->
addAttrGuard
(
offsetof
(
PyMethodDescrObject
,
d_method
),
(
intptr_t
)
self
->
d_method
);
}
if
(
call_flags
==
METH_KEYWORDS
)
call_flags
=
(
METH_VARARGS
|
METH_KEYWORDS
);
ParamReceiveSpec
paramspec
(
0
,
0
,
false
,
false
);
Box
**
defaults
=
NULL
;
if
(
call_flags
==
METH_NOARGS
)
{
...
...
src/runtime/objmodel.cpp
View file @
2c5d6923
...
...
@@ -1485,7 +1485,8 @@ void Box::setattr(BoxedString* attr, BORROWED(Box*) val, SetattrRewriteArgs* rew
if
(
rewrite_args
)
rewrite_args
->
obj
->
addAttrGuard
(
offsetof
(
Box
,
cls
),
(
intptr_t
)
cls
);
RELEASE_ASSERT
(
attr
->
s
()
!=
none_str
||
this
==
builtins_module
,
"can't assign to None"
);
// RELEASE_ASSERT(attr->s() != none_str || this == builtins_module, "attr is %s", attr->s().data());
// RELEASE_ASSERT(attr->s() != none_str || this == builtins_module, "can't assign to None");
if
(
cls
->
instancesHaveHCAttrs
())
{
HCAttrs
*
attrs
=
getHCAttrsPtr
();
...
...
src/runtime/types.cpp
View file @
2c5d6923
...
...
@@ -706,8 +706,8 @@ static Box* objectNewNoArgs(BoxedClass* cls) noexcept {
#ifndef NDEBUG
static
BoxedString
*
new_str
=
getStaticString
(
"__new__"
);
static
BoxedString
*
init_str
=
getStaticString
(
"__init__"
);
assert
(
typeLookup
(
cls
,
new_str
)
==
typeLookup
(
object_cls
,
new_str
)
&&
typeLookup
(
cls
,
init_str
)
!=
typeLookup
(
object_cls
,
init_str
));
// assert(typeLookup(cls, new_str) == typeLookup(object_cls, new_str));
assert
(
typeLookup
(
cls
,
init_str
)
!=
typeLookup
(
object_cls
,
init_str
));
#endif
return
new
(
cls
)
Box
();
}
...
...
@@ -2302,7 +2302,9 @@ public:
}
void
convertToPrivateDict
()
{
RELEASE_ASSERT
(
!
private_dict
,
""
);
if
(
private_dict
)
return
;
// RELEASE_ASSERT(!private_dict, "");
RELEASE_ASSERT
(
b
,
""
);
private_dict
=
(
BoxedDict
*
)
AttrWrapper
::
copy
(
this
);
assert
(
PyDict_CheckExact
(
private_dict
));
...
...
@@ -3594,6 +3596,12 @@ extern "C" PyObject* PyObject_Init(PyObject* op, PyTypeObject* tp) noexcept {
if
(
op
==
NULL
)
return
PyErr_NoMemory
();
// Pyston change: register the type if the type is not yet registered
if
(
unlikely
(
tp
->
tp_dict
==
NULL
))
{
int
ret
=
PyType_Ready
(
tp
);
assert
(
ret
==
0
);
}
assert
(
tp
);
Py_TYPE
(
op
)
=
tp
;
...
...
test/integration/getZope.sh
0 → 100644
View file @
2c5d6923
wget https://pypi.python.org/packages/source/Z/Zope2/Zope2-2.13.24.tar.gz
wget https://pypi.python.org/packages/source/P/Products.StandardCacheManagers/Products.StandardCacheManagers-2.13.1.tar.gz
wget https://pypi.python.org/packages/source/P/Products.PythonScripts/Products.PythonScripts-2.13.2.zip
wget https://pypi.python.org/packages/source/P/Products.MIMETools/Products.MIMETools-2.13.0.zip
wget https://pypi.python.org/packages/source/P/Products.MailHost/Products.MailHost-2.13.2.zip
wget https://pypi.python.org/packages/source/P/Products.ExternalMethod/Products.ExternalMethod-2.13.1.zip
wget https://pypi.python.org/packages/source/P/Products.BTreeFolder2/Products.BTreeFolder2-2.13.5.tar.gz
wget https://pypi.python.org/packages/source/z/zope.viewlet/zope.viewlet-3.7.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.traversing/zope.traversing-3.13.2.zip
wget https://pypi.python.org/packages/source/z/zope.testing/zope.testing-3.9.7.tar.gz
wget https://pypi.python.org/packages/source/z/zope.testbrowser/zope.testbrowser-3.11.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.tales/zope.tales-3.5.3.tar.gz
wget https://pypi.python.org/packages/source/z/zope.tal/zope.tal-3.5.2.zip
wget https://pypi.python.org/packages/source/z/zope.structuredtext/zope.structuredtext-3.5.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.size/zope.size-3.4.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.site/zope.site-3.9.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.sequencesort/zope.sequencesort-3.4.0.tar.gz
wget https://pypi.python.org/packages/source/z/zope.sendmail/zope.sendmail-3.7.5.tar.gz
wget https://pypi.python.org/packages/source/z/zope.security/zope.security-3.7.4.tar.gz
wget https://pypi.python.org/packages/source/z/zope.schema/zope.schema-3.7.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.publisher/zope.publisher-3.12.6.tar.gz
wget https://pypi.python.org/packages/source/z/zope.ptresource/zope.ptresource-3.9.0.tar.gz
wget https://pypi.python.org/packages/source/z/zope.proxy/zope.proxy-3.6.1.zip
wget https://pypi.python.org/packages/source/z/zope.processlifetime/zope.processlifetime-1.0.tar.gz
wget https://pypi.python.org/packages/source/z/zope.pagetemplate/zope.pagetemplate-3.5.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.location/zope.location-3.9.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.lifecycleevent/zope.lifecycleevent-3.6.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.7.zip
wget https://pypi.python.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-3.5.3.tar.gz
wget https://pypi.python.org/packages/source/z/zope.i18n/zope.i18n-3.7.4.tar.gz
wget https://pypi.python.org/packages/source/z/zope.exceptions/zope.exceptions-3.6.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.event/zope.event-3.5.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.deferredimport/zope.deferredimport-3.5.3.tar.gz
wget https://pypi.python.org/packages/source/z/zope.contenttype/zope.contenttype-3.5.5.zip
wget https://pypi.python.org/packages/source/z/zope.contentprovider/zope.contentprovider-3.7.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.container/zope.container-3.11.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.configuration/zope.configuration-3.7.4.zip
wget https://pypi.python.org/packages/source/z/zope.component/zope.component-3.9.5.tar.gz
wget https://pypi.python.org/packages/source/z/zope.browserresource/zope.browserresource-3.10.3.zip
wget https://pypi.python.org/packages/source/z/zope.browserpage/zope.browserpage-3.12.2.tar.gz
wget https://pypi.python.org/packages/source/z/zope.browsermenu/zope.browsermenu-3.9.1.zip
wget https://pypi.python.org/packages/source/z/zope.browser/zope.browser-1.3.zip
wget https://pypi.python.org/packages/source/z/zLOG/zLOG-2.11.2.tar.gz
wget https://pypi.python.org/packages/source/z/zExceptions/zExceptions-2.13.0.zip
wget https://pypi.python.org/packages/source/z/zdaemon/zdaemon-2.0.7.tar.gz
wget https://pypi.python.org/packages/source/t/transaction/transaction-1.1.1.tar.gz
wget https://pypi.python.org/packages/source/t/tempstorage/tempstorage-2.12.2.zip
wget https://pypi.python.org/packages/2.7/p/pytz/pytz-2015.7-py2.7.egg
wget https://pypi.python.org/packages/source/i/initgroups/initgroups-2.13.0.zip
wget https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz
wget https://pypi.python.org/packages/source/Z/ZopeUndo/ZopeUndo-2.12.0.zip
wget https://pypi.python.org/packages/source/Z/ZODB3/ZODB3-3.10.5.tar.gz
wget https://pypi.python.org/packages/source/Z/ZConfig/ZConfig-2.9.3.tar.gz
wget https://pypi.python.org/packages/source/R/RestrictedPython/RestrictedPython-3.6.0.zip
wget https://pypi.python.org/packages/source/R/Record/Record-2.13.0.zip
wget https://pypi.python.org/packages/source/P/Products.ZCTextIndex/Products.ZCTextIndex-2.13.5.zip
wget https://pypi.python.org/packages/source/P/Products.ZCatalog/Products.ZCatalog-2.13.27.zip
wget https://pypi.python.org/packages/source/P/Products.OFSP/Products.OFSP-2.13.2.zip
wget https://pypi.python.org/packages/source/P/Persistence/Persistence-2.13.2.zip
wget https://pypi.python.org/packages/source/M/MultiMapping/MultiMapping-2.13.0.zip
wget https://pypi.python.org/packages/source/M/Missing/Missing-2.13.1.zip
wget https://pypi.python.org/packages/source/E/ExtensionClass/ExtensionClass-2.13.2.zip
wget https://pypi.python.org/packages/source/D/DocumentTemplate/DocumentTemplate-2.13.2.zip
wget https://pypi.python.org/packages/source/D/DateTime/DateTime-2.12.8.tar.gz
wget https://pypi.python.org/packages/source/A/Acquisition/Acquisition-2.13.9.tar.gz
wget https://pypi.python.org/packages/source/A/AccessControl/AccessControl-2.13.14.tar.gz
wget https://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip
wget https://pypi.python.org/packages/source/z/zope.annotation/zope.annotation-3.5.0.tar.gz
wget https://pypi.python.org/packages/source/z/zope.broken/zope.broken-3.6.0.zip
wget https://pypi.python.org/packages/source/z/zope.filerepresentation/zope.filerepresentation-3.6.1.tar.gz
wget https://pypi.python.org/packages/source/z/zope.dottedname/zope.dottedname-3.4.6.tar.gz
wget https://pypi.python.org/packages/source/z/zc.lockfile/zc.lockfile-1.0.2.tar.gz
test/integration/pycrypto_test.py
View file @
2c5d6923
# skip-if: True
import
subprocess
,
sys
,
os
,
shutil
,
StringIO
sys
.
path
.
append
(
os
.
path
.
dirname
(
__file__
)
+
"/../lib"
)
import
test_helper
...
...
test/integration/pyinotify_test.py
View file @
2c5d6923
# skip-if: True
import
os
import
sys
import
subprocess
...
...
test/integration/pytest_test.py
View file @
2c5d6923
# skip-if: True
import
os
,
sys
,
subprocess
,
shutil
sys
.
path
.
append
(
os
.
path
.
dirname
(
__file__
)
+
"/../lib"
)
...
...
test/integration/pyxl_test.py
View file @
2c5d6923
# skip-if: True
import
os
import
sys
import
subprocess
...
...
test/integration/sqlalchemy_smalltest.py
View file @
2c5d6923
# skip-if: True
import
gc
import
os
import
sys
...
...
test/integration/virtualenv_test.py
View file @
2c5d6923
# expected: fail
import
os
import
sys
import
subprocess
...
...
test/integration/zope_test.py
0 → 100644
View file @
2c5d6923
# skip-if: True
import
os
import
sys
import
subprocess
sys
.
path
.
append
(
os
.
path
.
dirname
(
__file__
)
+
"/../lib"
)
from
test_helper
import
run_test
"""
Using this test file.
The /bin/python is the pyston executable so if you recompile pyston, you need to run this
script again to update it.
"""
def
print_progress_header
(
text
):
print
"
\
n
>>>"
print
">>> "
+
text
+
"..."
print
">>>"
ENV_NAME
=
"zope_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
)
DEPENDENCIES
=
[
"nose==1.3.7"
,
"six"
]
SRC_DIR
=
ENV_NAME
PYTHON_EXE
=
os
.
path
.
abspath
(
ENV_NAME
+
"/bin/python"
)
EASY_INSTALL_EXE
=
os
.
path
.
abspath
(
ENV_NAME
+
"/bin/easy_install"
)
MK_ZOPE_INSTANCE_EXE
=
os
.
path
.
abspath
(
ENV_NAME
+
"/bin/mkzopeinstance"
)
HOME_DIR
=
os
.
path
.
expanduser
(
'~'
)
ZOPE_DIR
=
HOME_DIR
+
'/Zope-2.13.24-pakcages'
ZOPE_ENV_PATH
=
os
.
path
.
abspath
(
ENV_NAME
)
INSTANCE_DIR
=
os
.
path
.
abspath
(
ENV_NAME
+
"/instance"
)
def
creat_zope_virtual_dir
():
if
not
os
.
path
.
exists
(
ENV_NAME
)
or
os
.
stat
(
sys
.
executable
).
st_mtime
>
os
.
stat
(
ENV_NAME
+
"/bin/python"
).
st_mtime
:
print
"Creating virtualenv to install testing dependencies..."
VIRTUALENV_SCRIPT
=
os
.
path
.
dirname
(
__file__
)
+
"/../lib/virtualenv/virtualenv.py"
try
:
args
=
[
sys
.
executable
,
VIRTUALENV_SCRIPT
,
"-p"
,
sys
.
executable
,
ENV_NAME
]
print
"Running"
,
args
subprocess
.
check_call
(
args
)
subprocess
.
check_call
([
ENV_NAME
+
"/bin/pip"
,
"install"
]
+
DEPENDENCIES
)
except
:
print
"Error occurred; trying to remove partially-created directory"
ei
=
sys
.
exc_info
()
try
:
subprocess
.
check_call
([
"rm"
,
"-rf"
,
ENV_NAME
])
except
Exception
as
e
:
print
e
raise
ei
[
0
],
ei
[
1
],
ei
[
2
]
import
shutil
def
mk_ZOPE_DIR
():
# Make sure we are in a clean dir.
if
os
.
path
.
exists
(
ZOPE_DIR
):
shutil
.
rmtree
(
ZOPE_DIR
)
os
.
makedirs
(
ZOPE_DIR
)
# ********************************
# ********************************
# **** Modified Zope Packages ****
# ********************************
# ********************************
modified_list
=
[
(
"Acquisition-2.13.9"
,
"https://lab.nexedi.com/Daetalus/Acquisition-2.13.9/repository/archive.zip?ref=master"
),
(
"AccessControl-2.13.14"
,
"https://lab.nexedi.com/Daetalus/AccessControl-2.13.14/repository/archive.zip?ref=master"
),
(
"ExtensionClass-2.13.2"
,
"https://lab.nexedi.com/Daetalus/ExtensionClass-2.13.2/repository/archive.zip?ref=master"
),
(
"zope.container-3.11.2"
,
"https://lab.nexedi.com/Daetalus/zope.container-3.11.2/repository/archive.zip?ref=master"
),
(
"zope.proxy-3.6.1"
,
"https://lab.nexedi.com/Daetalus/zope.proxy-3.6.1/repository/archive.zip?ref=master"
),
(
"zope.security-3.7.4"
,
"https://lab.nexedi.com/Daetalus/zope.security-3.7.4/repository/archive.zip?ref=master"
),
(
"DocumentTemplate-2.13.2"
,
"https://lab.nexedi.com/Daetalus/DocumentTemplate-2.13.2/repository/archive.zip?ref=master"
),
(
"RestrictedPython-3.6.0"
,
"https://lab.nexedi.com/Daetalus/RestrictedPython-3.6.0/repository/archive.zip?ref=master"
),
(
"ZODB3-3.10.5"
,
"https://lab.nexedi.com/Daetalus/ZODB3-3.10.5/repository/archive.zip?ref=pyston_patch"
),
(
"Zope2-2.13.24"
,
"https://lab.nexedi.com/Daetalus/Zope2-2.13.24/repository/archive.zip?ref=master"
),]
# Download zope packages except the packages listed in modified_list
zope_packages
=
open
(
os
.
path
.
dirname
(
__file__
)
+
"/getZope.sh"
)
zope_download_list
=
zope_packages
.
read
().
splitlines
()
m_pkg_link
=
[]
um_pkg_link
=
[]
for
each_pkg
in
zope_download_list
:
modified
=
None
for
modified_pkg
in
modified_list
:
pkg_name
=
modified_pkg
[
0
]
pkg_link
=
modified_pkg
[
1
]
a
=
pkg_name
in
each_pkg
if
pkg_name
in
each_pkg
:
modified
=
modified_pkg
m_link
=
''
.
join
([
'wget '
,
pkg_link
,
' -O '
,
pkg_name
,
'.zip'
])
m_pkg_link
.
append
(
m_link
)
break
if
modified
is
None
:
um_pkg_link
.
append
(
each_pkg
)
else
:
modified_list
.
remove
(
modified
)
# print(zope_download_list)
# print(um_pkg_link)
print
(
len
(
zope_download_list
))
print
(
len
(
um_pkg_link
))
print
(
m_pkg_link
)
# the package list is something like
# ['wget url', 'wget url'...]
def
download_zope_packages
(
package_list
):
for
each_line
in
package_list
:
commands
=
each_line
.
split
(
' '
)
subprocess
.
check_call
(
commands
,
cwd
=
ZOPE_DIR
)
def
createZopeInstance
():
try
:
print_progress_header
(
"Creating Zope instance"
)
commands
=
[
MK_ZOPE_INSTANCE_EXE
,
'-d'
,
INSTANCE_DIR
,
'-u'
,
'nexedi:270'
]
print
(
commands
)
subprocess
.
check_call
(
commands
,
cwd
=
ZOPE_ENV_PATH
)
except
:
raise
def
buildZope
():
try
:
print_progress_header
(
"Building Zope packages"
)
commands
=
[
EASY_INSTALL_EXE
,
'-H'
,
'None'
,
'-i'
,
ZOPE_DIR
,
'Zope2'
]
# print(ZOPE_DIR)
# print(ZOPE_ENV_PATH)
# print(EASY_INSTALL_EXE)
subprocess
.
check_call
(
commands
,
cwd
=
ZOPE_ENV_PATH
)
except
:
raise
creat_zope_virtual_dir
()
# mk_ZOPE_DIR()
# download_zope_packages(um_pkg_link)
download_zope_packages
(
m_pkg_link
)
buildZope
()
createZopeInstance
()
print
(
"Passed"
)
test/tests/capi_slots.py
View file @
2c5d6923
# skip-if: True
import
slots_test
for
i
in
xrange
(
3
):
...
...
test/tests/compile_test2.py
View file @
2c5d6923
# expected: fail
# this tests are from cpythons test_compile.py
import
unittest
from
test
import
test_support
...
...
test/tests/curses_test.py
View file @
2c5d6923
# expected: fail
import
curses
,
sys
try
:
...
...
test/tests/extension.py
View file @
2c5d6923
# skip-if: True
import
basic_test
print
type
(
basic_test
)
...
...
test/tests/test_dictviews.py
View file @
2c5d6923
# expected: fail
# This is a copy of cpythons test with the recursive repr test disabled
# remove this test when we can pass cpythons test
...
...
test/tests/type_creation.py
View file @
2c5d6923
# skip-if: True
import
type_test
print
(
"Hello"
)
test/tests/type_flags.py
View file @
2c5d6923
# skip-if: True
import
slots_test
HEAPTYPE
=
1
<<
9
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment