finalfusion / finalfusion-tensorflow-ops

Tensorflow Op for finalfusion embeddings
https://finalfusion.github.io/
Other
2 stars 0 forks source link

First stab at Python package and wheel. #4

Closed sebpuetz closed 4 years ago

sebpuetz commented 4 years ago

This is the first time I'm writing a Python package and setting up building a wheel. I tried to go with how other tf extensions are built, but I'm not sure whether what I did makes sense.

setup.py in this PR produces usable wheels on Ubuntu for Python 2.7.16, 3.6.7 and 3.7 with pip-installed tensorflow. I haven't set up test infrastructure since I'm not sure how we want to go about testing here, since the pytests are currently implemented on the raw library.

Ideally we'd get rid of the duplicate build of the full library by running ctest from within setup.py. That was failing because the library output path is set to the setuptools build path, so the pytests don't find libfinalfusion_tensorflow.so and fail.

sebpuetz commented 4 years ago

Maybe @twuebi can also take a look into this one.

sebpuetz commented 4 years ago

What's your take on the testing situation and duplicate builds? Do you have suggestions or thoughts on how to streamline that a bit?

edit: I think I found a nice way to run all tests from within setup.py. We should still add some tests in the future for the actual pip package.

twuebi commented 4 years ago

Maybe @twuebi can also take a look into this one.

Don't see anything to complain about.

sebpuetz commented 4 years ago

@danieldk if you're happy with the way ctest is called now and how the shared library is copied, then I think this is good to go?