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
Kirill Smelkov
cython
Commits
185af334
Commit
185af334
authored
Nov 07, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cythonize([Extension]) build test with additional source files
parent
ceb39bf6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
tests/build/cythonize_additional_sources_ext.srctree
tests/build/cythonize_additional_sources_ext.srctree
+38
-0
No files found.
tests/build/cythonize_additional_sources_ext.srctree
0 → 100644
View file @
185af334
PYTHON setup.py build_ext --inplace
PYTHON -c "from pkg import a; assert a.test() == 43"
######## setup.py ########
from Cython.Build import cythonize
from distutils.core import setup, Extension
extensions = [
Extension('pkg.a', sources=['pkg/a.pyx', 'pkg/alib.c'],
include_dirs=['pkg'])
]
setup(
ext_modules = cythonize(extensions)
)
######## pkg/__init__.py ########
######## pkg/a.pyx ########
cdef extern from "alib.h":
int c_function(int x)
def test():
return c_function(42)
######## pkg/alib.c ########
int c_function(int x) {
return x + 1;
}
######## pkg/alib.h ########
int c_function(int x);
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