Skip to content

Commit

Permalink
Merge 1b1bd4e into 44ed11f
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Nov 17, 2018
2 parents 44ed11f + 1b1bd4e commit 1343c93
Show file tree
Hide file tree
Showing 6 changed files with 591 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
1 change: 1 addition & 0 deletions environment_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dependencies:
- coverage==4.5.2
- pytest==3.10.1
- cython==0.29
- numpy==1.15.2
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def run_tests(self):
]

test_requirements = [
"numpy",
"pytest",
]

Expand All @@ -62,6 +63,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 1343c93

Please sign in to comment.