seeing-things / zwo

ZWO SDK and custom software for debugging and using it.
24 stars 4 forks source link

Integrate zwo_fixer with the Python SWIG package #28

Open bgottula opened 5 years ago

bgottula commented 5 years ago

Not sure exactly how to do this. Pretty sure we can make the call to ZWOFixerInit() happen by inserting the relevant C code into asi.i, perhaps in the init section? Including the header file might be challenging given how poorly pip handles relative paths in setup.py.

For linking: it may be difficult for the SWIG C extension to find the zwo_fixer .so file unless it gets installed to a system directory. Alternatively, maybe it would be better to just statically link against it? I guess for static linking we would still need to use a relative path in setup.py for the linker to find the file, which is problematic.

Upon further reading, it appears that pip intentionally copies stuff to a temporary directory in part to prevent doing what we're trying to do. I guess the thinking is that if this package is distributed, setup.py is supposed to be in the root directory and all dependencies needed to build that package are supposed to be either in that same directory or sub-directories (see https://github.com/pypa/pip/issues/5544). That's a little irritating, because zwo_fixer is not (only) meant to be a dependency of this SWIG Python package, so I don't want to move that under python/. Maybe we could move setup.py to the root directory of the repo instead?

bgottula commented 5 years ago

@jgottula I'm willing to do some of the work on this but want to get your thoughts first.