Skip to content

Commit

Permalink
Merge aebf631 into 133cfa5
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Nov 20, 2018
2 parents 133cfa5 + aebf631 commit 87076f1
Show file tree
Hide file tree
Showing 6 changed files with 616 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.1
- pytest==3.8.1
- cython==0.28.5
- 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
17 changes: 17 additions & 0 deletions src/cybuffer.pxd
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
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 str hex(self)
cpdef bytes tobytes(self)
cpdef list tolist(self)

0 comments on commit 87076f1

Please sign in to comment.