Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
e2298d00
Commit
e2298d00
authored
Mar 11, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
b02c0b09
05dbd1df
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
128 additions
and
5 deletions
+128
-5
Cython/Compiler/Version.py
Cython/Compiler/Version.py
+1
-1
MANIFEST.in
MANIFEST.in
+1
-1
pyximport/pyxbuild.py
pyximport/pyxbuild.py
+1
-1
runtests.py
runtests.py
+14
-0
setup.py
setup.py
+11
-2
tests/bugs/char_constants_T99.pyx
tests/bugs/char_constants_T99.pyx
+24
-0
tests/bugs/class_attribute_init_values_T18.pyx
tests/bugs/class_attribute_init_values_T18.pyx
+55
-0
tests/bugs/missing_self_in_cpdef_method_T156.pyx
tests/bugs/missing_self_in_cpdef_method_T156.pyx
+5
-0
tests/bugs/missing_self_in_cpdef_method_T165.pyx
tests/bugs/missing_self_in_cpdef_method_T165.pyx
+5
-0
tests/run/specialfloat.pyx
tests/run/specialfloat.pyx
+11
-0
No files found.
Cython/Compiler/Version.py
View file @
e2298d00
version
=
'0.11.rc'
version
=
'0.11.rc
2
'
MANIFEST.in
View file @
e2298d00
...
...
@@ -6,7 +6,7 @@ include setup.py
include bin/cython
include cython.py
include Cython/Compiler/Lexicon.pickle
include Cython/Includes/
*.pxd
recursive-include Cython *.pyx
*.pxd
include Doc/*
include Demos/*.pyx
...
...
pyximport/pyxbuild.py
View file @
e2298d00
...
...
@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
build_in_temp
=
False
,
pyxbuild_dir
=
None
):
"""Compile a PYX file to a DLL and return the name of the generated .so
or .dll ."""
assert
os
.
path
.
exists
(
filename
)
assert
os
.
path
.
exists
(
filename
)
,
"Could not find %s"
%
os
.
path
.
abspath
(
filename
)
path
,
name
=
os
.
path
.
split
(
filename
)
...
...
runtests.py
View file @
e2298d00
...
...
@@ -18,6 +18,15 @@ EXT_DEP_MODULES = {
'numpy'
:
re
.
compile
(
'.*
\
.
n
umpy_.*'
).
match
}
def
get_numpy_include_dirs
():
import
numpy
return
[
numpy
.
get_include
()]
EXT_DEP_INCLUDES
=
[
# test name matcher , callable returning list
(
re
.
compile
(
'numpy_.*'
).
match
,
get_numpy_include_dirs
),
]
VER_DEP_MODULES
=
{
# such as:
# (2,4) : lambda x: x in ['run.set']
...
...
@@ -271,9 +280,14 @@ class CythonCompileTestCase(unittest.TestCase):
if
incdir
:
build_extension
.
include_dirs
.
append
(
incdir
)
build_extension
.
finalize_options
()
ext_include_dirs
=
[]
for
match
,
get_additional_include_dirs
in
EXT_DEP_INCLUDES
:
if
match
(
module
):
ext_include_dirs
+=
get_additional_include_dirs
()
extension
=
Extension
(
module
,
sources
=
[
self
.
build_target_filename
(
module
)],
include_dirs
=
ext_include_dirs
,
extra_compile_args
=
CFLAGS
,
)
if
self
.
language
==
'cpp'
:
...
...
setup.py
View file @
e2298d00
...
...
@@ -11,14 +11,23 @@ if sys.platform == "win32":
setup_args
=
{}
if
sys
.
version_info
<
(
2
,
4
):
import
glob
cython_dir
=
os
.
path
.
join
(
get_python_lib
(
prefix
=
''
),
'Cython'
)
compiler_dir
=
os
.
path
.
join
(
cython_dir
,
'Compiler'
)
setup_args
[
'data_files'
]
=
[
(
compiler_dir
,
[
'Cython/Compiler/Lexicon.pickle'
]),
(
cython_dir
,
[
'Cython/Includes/*.pxd'
])]
(
cython_dir
,
[
f
for
pattern
in
[
'Cython/Includes/*.pxd'
,
'Cython/Plex/*.pxd'
,
'Cython/Compiler/*.pxd'
,
'Cython/Runtime/*.pyx'
]
for
f
in
glob
.
glob
(
pattern
)
])]
else
:
setup_args
[
'package_data'
]
=
{
'Cython.Compiler'
:
[
'Lexicon.pickle'
],
'Cython'
:
[
'Includes/*.pxd'
]}
'Cython'
:
[
'Includes/*.pxd'
,
'Plex/*.pxd'
,
'Compiler/*.pxd'
,
'Runtime/*.pyx'
]}
if
os
.
name
==
"posix"
:
scripts
=
[
"bin/cython"
]
...
...
tests/bugs/char_constants_T99.pyx
0 → 100644
View file @
e2298d00
__doc__
=
u"""
>>> global_c_and_s()
99
abcdef
>>> local_c_and_s()
98
bcdefg
"""
cdef
char
c
=
'c'
cdef
char
*
s
=
'abcdef'
def
global_c_and_s
():
pys
=
s
print
c
print
pys
.
decode
(
'ASCII'
)
def
local_c_and_s
():
cdef
char
c
=
'b'
cdef
char
*
s
=
'bcdefg'
pys
=
s
print
c
print
pys
.
decode
(
'ASCII'
)
tests/bugs/class_attribute_init_values_T18.pyx
0 → 100644
View file @
e2298d00
__doc__
=
u"""
>>> f = PyFoo()
>>> print(f.bar)
5
>>> print(f.baz)
someval
>>> f = MyPyFoo()
>>> print(f.bar)
7
>>> print(f.baz)
anotherval
>>> f = CyFoo()
>>> print(f.bar)
5
>>> print(f.baz)
anotherval
>>> f = MyCyFoo()
>>> print(f.bar)
7
>>> print(f.baz)
anotherval
>>> f = AnotherFoo()
>>> print(f.bar)
8
>>> print(f.baz)
yetanotherval
"""
# this works:
class
PyFoo
(
object
):
bar
=
5
baz
=
u"someval"
class
MyPyFoo
(
PyFoo
):
bar
=
7
baz
=
u"anotherval"
# this doesn't:
cdef
class
CyFoo
:
cdef
public
int
bar
=
5
cdef
public
object
baz
=
u"someval"
cdef
class
MyCyFoo
(
CyFoo
):
cdef
public
int
bar
=
7
cdef
public
object
baz
=
u"anotherval"
class
AnotherFoo
(
CyFoo
):
bar
=
8
baz
=
u"yetanotherval"
tests/bugs/missing_self_in_cpdef_method_T156.pyx
0 → 100644
View file @
e2298d00
cdef
class
B
:
cpdef
b
():
pass
tests/bugs/missing_self_in_cpdef_method_T165.pyx
0 → 100644
View file @
e2298d00
cdef
class
A
:
cpdef
a
(
int
not_self
):
pass
tests/run/specialfloat.pyx
View file @
e2298d00
...
...
@@ -44,6 +44,11 @@ __doc__ = u"""
-inf
>>> float_infn == float('-inf')
True
>>> global_floats()[1:] == (float('+inf'), float('-inf'))
True
>>> global_floats()[0]
nan
"""
DEF
FLOAT
=
12.5
...
...
@@ -51,6 +56,10 @@ DEF FLOAT_NAN = float('nan')
DEF
FLOAT_INFP
=
float
(
'+inf'
)
DEF
FLOAT_INFN
=
float
(
'-inf'
)
cdef
double
cdef
_float_nan
=
float
(
'nan'
)
cdef
double
cdef
_float_infp
=
float
(
'+inf'
)
cdef
double
cdef
_float_infn
=
float
(
'-inf'
)
float_nan
=
FLOAT_NAN
float_infp
=
FLOAT_INFP
float_infn
=
FLOAT_INFN
...
...
@@ -105,3 +114,5 @@ def infn3():
f
=
FLOAT_INFN
return
f
def
global_floats
():
return
(
cdef
_float_nan
,
cdef
_float_infp
,
cdef
_float_infn
)
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