esa / pygmo2

A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pygmo2/
Mozilla Public License 2.0
414 stars 56 forks source link

Build project using scikit-build #113

Closed astrojuanlu closed 1 year ago

astrojuanlu commented 1 year ago

This attempts to use scikit-build to build pygmo in an effort to simplify gh-110. For that, I copied tools/wheel_setup.py to setup.py and made some minimal modifications.

I got surprisingly far with comparatively low effort, although the PR is not finished yet:

I tested this in a conda environment with the released version of pagmo, which means that I had to temporarily revert 97770b25c4769039dd75ec78bd9b05df3f1aac13. However, I am confident it will work with development versions of pagmo as well.

astrojuanlu commented 1 year ago

Well, that was surprisingly easy! I modified both CMakeLists.txt files to not use PYGMO_INSTALL_PATH and use a relative directory instead. Arguably some functionality got lost, but now at least both pip install . and python -m build work 🎉

What's left is

astrojuanlu commented 1 year ago

@bluescarni @darioizzo this is ready for review.

astrojuanlu commented 1 year ago

The CI failures are caused by an import error because of the current working directory. Fixing.

astrojuanlu commented 1 year ago

There are 5 remaining test failures:

These are not present in master, so clearly are due to this PR, but it's still not entirely clear to me what might be causing them. These are also present in master at the moment, see gh-114.

kirbyherm commented 1 year ago

just FYI, I am getting the same errors in the build on PR #112 despite it building and running the tests fine on my machine. I'm also in the dark as to what is causing the issue

bluescarni commented 1 year ago

@astrojuanlu Thanks for taking the time to look into this.

As a general comment, the scikit approach should be an alternative to the CMake build sytem and not a replacement for it. Thus, I would ask if you could place the scikit instructions in a new paragraph in the docs, rather than modifying the existing CMake instructions.

Similarly, the existing conda based builds in the CI pipeline should remain unaltered and new builds testing the scikit approach should be added instead (preferably on github actions, as I think we may be hitting the limits for open source projects on other CI providers).

I'll leave a couple more comments on the diff.

darioizzo commented 1 year ago

closing this #117 substitutes it up to when we will consider again scikit-build-core