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
422 stars 57 forks source link

Add distribution source to pip #55

Closed johnnymck closed 1 year ago

johnnymck commented 4 years ago

32 Adds source distribution to PIP.

Once built; will need to be uploaded to PyPi.

Some edits may be required to setup.py. Feel free to make these changes 😀

(also please ignore the branch name - minor brainfart on my part)

dmikushin commented 3 years ago

Hi @johnnymck, I've tested your PR on MacOS Catalina 10.15 using a branch link:

pip3 install git+https://github.com/johnnymck/pygmo2.git@add-distrobution-source-to-git

Although the pygmo package formally builds, the native C++ modules ain't getting compiled in:

  File "/Users/marcusmae/hypersolve.io/spyder/venv/lib/python3.7/site-packages/pygmo/__init__.py", line 13, in <module>
    from .core import *
ModuleNotFoundError: No module named 'pygmo.core'
johnnymck commented 3 years ago

Hiya @dmikushin, is this perhaps due to my lack of ESA's CICD on my repo performing all the build steps perhaps? I'm not certain on why this might happen, but I suspect this may be why.

dmikushin commented 3 years ago

@johnnymck I'm not sure how CICD is getting into play here. I think it's rather about the actual content of setup.py. As long as they have C++ sources, their compilation must be explicitly handled within setup.py, as shown e.g. here.

johnnymck commented 3 years ago

Aye it would seem that you're correct. 👍

My C++ is a tad rusty - what are the usual compilation steps, and which is the main file in the pygmo cpp library, so I know how to include the compilation steps?

dmikushin commented 3 years ago

@johnnymck If you are on Linux/Mac, please test https://github.com/esa/pygmo2/pull/56 :

pip3 install git+https://github.com/apc-llc/pygmo2.git

Builders are yet to be fixed.

darioizzo commented 1 year ago

Closing this. Thank for the attempt, but we cannot add the source using this method as the library compiled from c++ is architecture dependent. A wheel must be compiled for each platform and uploaded. For all linux the manylinux project provides this and is now active again via #117