Repository: FloatingArrayDesign/MoorDyn (language: python)

Issue:
Compile issue with setup.py
When compiling v2 using setup.py (clang on MacOS) to build the python library there are fatal errors because vtkSmartPointer.h, vtkPolyData.h, vtkCharArray.h, vtkFloatArray.h, and vtkErrorCode.h are not found. Are these files that can be added to the repo? Or is there a good way to ignore them when building the library? 


Discussion / hints:
Hey hey!

Until the repo is moved to its new home, you need to summon me writing @sanguinariojoe (otherwise I will never get notified)

The problem here is that setup.py is not meant for the users. Look at this comment: https://github.com/mattEhall/MoorDyn/blob/v2/setup.py#L34

A bit more detailed explanation...

Users can install the automatically built binaries (https://github.com/mattEhall/MoorDyn/releases/tag/nightly), or they can compile MoorDyn themselves using CMake (see https://moordyn-v2.readthedocs.io/en/latest/starting.html#compile-and-install-moordyn).

CMake can build the C/C++ library, as well as the Matlab, Python and Rust wrappers. User can also tweak some other options. At some point we should even drop the legacy Makefiles.

So Cmake can cover everything... Except the auto-built Python packages for Pypi... They are built with https://github.com/pypa/cibuildwheel, which requires a setup.py (well, nowadays the appropriate way to do this is by a project.toml file).

Regarding the errors you have noticed, they are happening because those packages are built with VTK support, using this other tool I created:

https://github.com/sanguinariojoe/vtk-builds

It is very little tested though...

The solution to this issue is not making this setup.py more versatile, but to move it somewhere that users might not find it. I'll do that!

Fix patch:
diff --git a/setup.cfg b/wrappers/python/.github.setup.cfg
similarity index 100%
rename from setup.cfg
rename to wrappers/python/.github.setup.cfg
diff --git a/setup.py b/wrappers/python/.github.setup.py
similarity index 100%
rename from setup.py
rename to wrappers/python/.github.setup.py


Test patch:
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index fce2df5b..b4deec07 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -223,6 +223,12 @@ jobs:
     steps:
       - uses: actions/checkout@v3
 
+      - name: Create setup.py
+        run: |
+            mv wrappers/python/.github.setup.py setup.py
+            mv wrappers/python/.github.setup.cfg setup.cfg
+        shell: bash
+
       # Used to host cibuildwheel
       - uses: actions/setup-python@v3