Skip to content

Commit

Permalink
Merge 72d92d8 into 44ed11f
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Nov 17, 2018
2 parents 44ed11f + 72d92d8 commit 3dcff5e
Show file tree
Hide file tree
Showing 5 changed files with 519 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__/
# C extensions
*.so
src/cybuffer.c
src/config.pxi
src/version.pxi

# Distribution / packaging
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def run_tests(self):
any([v.startswith("install") for v in sys.argv])):
setup_requirements = []
else:
with open("src/config.pxi", "w") as f:
f.writelines([
"DEF PY2K = " + str(sys.version_info.major == 2) + "\n",
"DEF PY3K = " + str(sys.version_info.major == 3) + "\n"
])
with open("src/version.pxi", "w") as f:
f.writelines([
"__version__ = " + "\"" + str(version) + "\""
Expand Down
16 changes: 16 additions & 0 deletions src/cybuffer.pxd
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
cdef class cybuffer(object):
cdef readonly object obj

cdef Py_buffer _buf

cdef char* _format
cdef readonly Py_ssize_t itemsize

cdef Py_ssize_t* _shape
cdef Py_ssize_t* _strides

cdef readonly bint c_contiguous
cdef readonly bint f_contiguous
cdef readonly bint contiguous

cpdef bytes tobytes(self)
cpdef list tolist(self)
Loading

0 comments on commit 3dcff5e

Please sign in to comment.