Commit 17c33473 authored by Ahmed Soliman's avatar Ahmed Soliman Committed by Facebook Github Bot

Fixing namespace in iobuf python utility extensions and adding it to CMake

Summary: Moving some `iobuf` helpers from the `thrift::py3` namespace into `folly` since this now lives in folly. Also fixing CMake to build iobuf in folly not in thrift.

Reviewed By: vitaut

Differential Revision: D16221272

fbshipit-source-id: a7bdde1b60cd6d7de06bf2040506a87c3153c37f
parent cc3f054a
...@@ -41,6 +41,8 @@ if (PYTHON_EXTENSIONS) ...@@ -41,6 +41,8 @@ if (PYTHON_EXTENSIONS)
"executor.pyx" "executor.pyx"
"futures.pxd" "futures.pxd"
"range.pxd" "range.pxd"
"iobuf.pxd"
"iobuf.pyx"
"__init__.pxd" "__init__.pxd"
"AsyncioExecutor.h") "AsyncioExecutor.h")
message( message(
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
#define PyGILState_Check() (true) #define PyGILState_Check() (true)
#endif #endif
namespace thrift { namespace folly {
namespace py3 {
struct PyBufferData { struct PyBufferData {
folly::Executor* executor; folly::Executor* executor;
...@@ -93,5 +92,4 @@ bool check_iobuf_less(const folly::IOBuf* a, const folly::IOBuf* b) { ...@@ -93,5 +92,4 @@ bool check_iobuf_less(const folly::IOBuf* a, const folly::IOBuf* b) {
return folly::IOBufLess{}(a, b); return folly::IOBufLess{}(a, b);
} }
} // namespace py3 } // namespace folly
} // namespace thrift
...@@ -45,7 +45,7 @@ cdef extern from '<utility>' namespace 'std': ...@@ -45,7 +45,7 @@ cdef extern from '<utility>' namespace 'std':
unique_ptr[cIOBuf] move(unique_ptr[cIOBuf]) unique_ptr[cIOBuf] move(unique_ptr[cIOBuf])
cdef extern from "folly/python/iobuf.h" namespace "thrift::py3": cdef extern from "folly/python/iobuf.h" namespace "folly":
unique_ptr[cIOBuf] iobuf_from_python(cFollyExecutor*, PyObject*, void*, uint64_t) unique_ptr[cIOBuf] iobuf_from_python(cFollyExecutor*, PyObject*, void*, uint64_t)
bint check_iobuf_equal(cIOBuf*, cIOBuf*) bint check_iobuf_equal(cIOBuf*, cIOBuf*)
bint check_iobuf_less(cIOBuf*, cIOBuf*) bint check_iobuf_less(cIOBuf*, cIOBuf*)
......
...@@ -27,7 +27,7 @@ Options.fast_fail = True ...@@ -27,7 +27,7 @@ Options.fast_fail = True
ext = Extension( ext = Extension(
"folly.executor", "folly.executor",
sources=["folly/executor.pyx"], sources=["folly/executor.pyx", "folly/iobuf.pyx"],
libraries=["folly_pic", "glog", "double-conversion", "iberty"], libraries=["folly_pic", "glog", "double-conversion", "iberty"],
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment