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
Show 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
...
@@ -6,7 +6,7 @@ include setup.py
include bin/cython
include bin/cython
include cython.py
include cython.py
include Cython/Compiler/Lexicon.pickle
include Cython/Compiler/Lexicon.pickle
include Cython/Includes/
*.pxd
recursive-include Cython *.pyx
*.pxd
include Doc/*
include Doc/*
include Demos/*.pyx
include Demos/*.pyx
...
...
pyximport/pyxbuild.py
View file @
e2298d00
...
@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
...
@@ -23,7 +23,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
build_in_temp
=
False
,
pyxbuild_dir
=
None
):
build_in_temp
=
False
,
pyxbuild_dir
=
None
):
"""Compile a PYX file to a DLL and return the name of the generated .so
"""Compile a PYX file to a DLL and return the name of the generated .so
or .dll ."""
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
)
path
,
name
=
os
.
path
.
split
(
filename
)
...
...
runtests.py
View file @
e2298d00
...
@@ -18,6 +18,15 @@ EXT_DEP_MODULES = {
...
@@ -18,6 +18,15 @@ EXT_DEP_MODULES = {
'numpy'
:
re
.
compile
(
'.*
\
.
n
umpy_.*'
).
match
'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
=
{
VER_DEP_MODULES
=
{
# such as:
# such as:
# (2,4) : lambda x: x in ['run.set']
# (2,4) : lambda x: x in ['run.set']
...
@@ -271,9 +280,14 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -271,9 +280,14 @@ class CythonCompileTestCase(unittest.TestCase):
if
incdir
:
if
incdir
:
build_extension
.
include_dirs
.
append
(
incdir
)
build_extension
.
include_dirs
.
append
(
incdir
)
build_extension
.
finalize_options
()
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
(
extension
=
Extension
(
module
,
module
,
sources
=
[
self
.
build_target_filename
(
module
)],
sources
=
[
self
.
build_target_filename
(
module
)],
include_dirs
=
ext_include_dirs
,
extra_compile_args
=
CFLAGS
,
extra_compile_args
=
CFLAGS
,
)
)
if
self
.
language
==
'cpp'
:
if
self
.
language
==
'cpp'
:
...
...
setup.py
View file @
e2298d00
...
@@ -11,14 +11,23 @@ if sys.platform == "win32":
...
@@ -11,14 +11,23 @@ if sys.platform == "win32":
setup_args
=
{}
setup_args
=
{}
if
sys
.
version_info
<
(
2
,
4
):
if
sys
.
version_info
<
(
2
,
4
):
import
glob
cython_dir
=
os
.
path
.
join
(
get_python_lib
(
prefix
=
''
),
'Cython'
)
cython_dir
=
os
.
path
.
join
(
get_python_lib
(
prefix
=
''
),
'Cython'
)
compiler_dir
=
os
.
path
.
join
(
cython_dir
,
'Compiler'
)
compiler_dir
=
os
.
path
.
join
(
cython_dir
,
'Compiler'
)
setup_args
[
'data_files'
]
=
[
setup_args
[
'data_files'
]
=
[
(
compiler_dir
,
[
'Cython/Compiler/Lexicon.pickle'
]),
(
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
:
else
:
setup_args
[
'package_data'
]
=
{
'Cython.Compiler'
:
[
'Lexicon.pickle'
],
setup_args
[
'package_data'
]
=
{
'Cython.Compiler'
:
[
'Lexicon.pickle'
],
'Cython'
:
[
'Includes/*.pxd'
]}
'Cython'
:
[
'Includes/*.pxd'
,
'Plex/*.pxd'
,
'Compiler/*.pxd'
,
'Runtime/*.pyx'
]}
if
os
.
name
==
"posix"
:
if
os
.
name
==
"posix"
:
scripts
=
[
"bin/cython"
]
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"""
...
@@ -44,6 +44,11 @@ __doc__ = u"""
-inf
-inf
>>> float_infn == float('-inf')
>>> float_infn == float('-inf')
True
True
>>> global_floats()[1:] == (float('+inf'), float('-inf'))
True
>>> global_floats()[0]
nan
"""
"""
DEF
FLOAT
=
12.5
DEF
FLOAT
=
12.5
...
@@ -51,6 +56,10 @@ DEF FLOAT_NAN = float('nan')
...
@@ -51,6 +56,10 @@ DEF FLOAT_NAN = float('nan')
DEF
FLOAT_INFP
=
float
(
'+inf'
)
DEF
FLOAT_INFP
=
float
(
'+inf'
)
DEF
FLOAT_INFN
=
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_nan
=
FLOAT_NAN
float_infp
=
FLOAT_INFP
float_infp
=
FLOAT_INFP
float_infn
=
FLOAT_INFN
float_infn
=
FLOAT_INFN
...
@@ -105,3 +114,5 @@ def infn3():
...
@@ -105,3 +114,5 @@ def infn3():
f
=
FLOAT_INFN
f
=
FLOAT_INFN
return
f
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