janba / GEL

A library of geometry processing tools for computer graphics
95 stars 23 forks source link

Python wheel on Pypi.org #44

Closed martinResearch closed 3 years ago

martinResearch commented 3 years ago

Hi, Thanks you for the great work. Is there an plan to publish precompiled python wheels on Pypi.org ? That would make much easier to use in other python projects.

martinResearch commented 3 years ago

I just figured out it is already in Pypi.org here but looking at the content of the wheel file it seems to be compiled only for mac os (dylib files) and windows (dll file), is that right ? Appveyor and cibuildwheel could potentially be used to automatically compile the wheels for linux and windows (like I did here)

janba commented 3 years ago

On 9 Jan 2021, at 15.10, Martin de La Gorce notifications@github.com<mailto:notifications@github.com> wrote:

I just figured out it is already in Pypi.orghttp://Pypi.org herehttps://pypi.org/project/PyGEL3D/ but looking at the content of the wheel file it seems to be compiled only for mac os (dylib files) and windows (dll file), is that right ?

That is correct. I was a bit afraid that Linux would be too much of a moving target. Besides compiling on Linux from GitHub source is comparatively easy.

Appveyor and cibuildwheel could potentially be used to automatically compile the wheels for linux and windows (like I did herehttps://github.com/martinResearch/DEODR/blob/master/.appveyor.yml)

Ok. That is intriguing. A colleague did attempt making a source package which would auto compile but that proved tricky.

Using a build service would perhaps be easier. Just two questions out of general ignorance since I have not tried using a CI system: Why use Appveyor rather than GitHub actions or some other CI system? Anything particularly tricky you ran into?

I am a bit concerned that GEL depends on GLFW which is often what is causing problems when compiling because people need to install it.

Thanks

Andreas

martinResearch commented 3 years ago

Even if compiling it for Linux is easy, I believe not having a wheel for Linux on pypi might still discourage other projects from using PyGEL3D as a dependency. I used appveyor to generate the deodr wheels because that seemed at the time to be the only CI system that supports windows (maybe that changed). I could use githut actions to release the wheel for linux but at that point it seemed easier to reuse the same appveyoyr file to generate the linux wheels too by simply adding linux in list of platforms. The appevoyer job runs only in the master branch or when I do pull requests in the master branch Note that I also use github action to test each commit of all the branches using the file here I believe the glfw binaries could be included in the pygel3d wheel, or maybe pyglfw could be added as an install requirement in setup.py ?

janba commented 3 years ago

Thanks for the nudge. I am looking into automation of compilation for the three platforms. It seems feasible to do so with GitHub Actions now - also on Windows. GLFW remains a pain, but now it installs on all platforms. I think it also links (or can be made to link) statically, so the biggest problem is to help VC find the headers. Probably, I will not automate the wheel building for now, but maybe next time I get a nudge :-)