aboutsummaryrefslogtreecommitdiff
path: root/lib/setup.py
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2019-09-10 11:57:47 -0400
committerThanos <tmakatos@gmail.com>2019-09-20 14:45:21 +0100
commit5d8c80c9df26c8a91384531774eee220d1d7f6f8 (patch)
tree33c154bc3d3cf70416d40dce4db53d5d49456668 /lib/setup.py
parent5d3393c21d4054394bdb042d13a3262afadb5e0e (diff)
downloadlibvfio-user-5d8c80c9df26c8a91384531774eee220d1d7f6f8.zip
libvfio-user-5d8c80c9df26c8a91384531774eee220d1d7f6f8.tar.gz
libvfio-user-5d8c80c9df26c8a91384531774eee220d1d7f6f8.tar.bz2
experimental support for Python bindings plus sample
This patch introduces experimental support for Python bindings, plus the GPIO sample in Python. There are many issues with extending Python (from module stuff to error handling), the most important one is the inability to modify the buf argument to the region access callbacks when a region is read from. For now I've resorted to returning the value since in libmuser we limit accesses to 8 bytes (maybe we should consider that for the C API as well?). Also, the fact that we don't pass the region being accessed as an argument to a region access callback results in clunky code (see the REGION_WRAP macro). Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/setup.py')
-rw-r--r--lib/setup.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/setup.py b/lib/setup.py
new file mode 100644
index 0000000..8d63e94
--- /dev/null
+++ b/lib/setup.py
@@ -0,0 +1,13 @@
+from distutils.core import setup, Extension
+
+module1 = Extension('muser',
+ sources = ['python_bindings.c'],
+ #library_dirs=['/usr/local/lib'],
+ libraries=['muser'],
+ #extra_compile_args=['-g', '-O0']
+)
+
+setup (name = 'PackageName',
+ version = '1.0',
+ description = 'This is a demo package',
+ ext_modules = [module1])