brandonmpetty / Doxa

A Local Adaptive Thresholding framework for image binarization written in C++, with JS and Python bindings. Implementing: Otsu, Bernsen, Niblack, Sauvola, Wolf, Gatos, NICK, Su, T.R. Singh, WAN, ISauvola, Bataineh, Chan and Shafait.
https://brandonmpetty.github.io/Doxa/WebAssembly
Creative Commons Zero v1.0 Universal
164 stars 37 forks source link

Build binary wheel files for Python bindings automatically #19

Closed Dobatymo closed 2 years ago

Dobatymo commented 3 years ago

I replaced the current cmake build system with a more standard Python based one, which uses pybind11 directly. It's easier to compile. Furthermore I added a github actions workflow which builds binary wheels for multiple Python versions for Linux and Windows (MacOS doesn't work at the moment for some reason). I also added a script which copies the C++ header files to the Python bindings directory during build because cibuildwheel works using docker on Linux and only has access to the current directory. The other solution would be to put the python bindings into the main directory, but I thought that's not a good solution.

It's currently setup to push binaries to pypi on every github release creation.

The only thing left to do is create the doxapy project on pypi and configure the __token__ and secrets.pypi_password value in github project settings.

The version is currently set to 1.0, this should probably be changed also. doxapy also could be changed to doxa for simplification.

brandonmpetty commented 3 years ago

Awesome! Thank you @Dobatymo . I looked it over briefly, let me test it and I'll merge it. Question, lets say v 3.9, and 4.0, etc come out, do I just update python-version to contain something like: [3.8, 3.9, 4.0] ?

Dobatymo commented 3 years ago

@brandonmpetty Actually that's not even necessary. cibuildwheel always builds for all the current versions. See here https://github.com/pypa/cibuildwheel#what-does-it-do You can configure the built versions by setting an environment variable https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip By default all supported versions are built for the current platform.

brandonmpetty commented 2 years ago

Awesome. Everything seemed to work locally except for Mac builds. It built, but I got an error using it. I think that is due to me running OSX v10.2. I can look into the Mac thing after a bit. I'll try to get the github actions setup tonight or tomorrow.