espressopp
espressopp copied to clipboard
Espressopp as a Python package accessible via PyPI
+1
To build an egg file to upload to PyPl, one basically needs a setup.py
calling cmake, see:
https://github.com/sim-x/simx/blob/master/setup.py
for an example.
Is is planned as source only? The SciPy/NumPy/PyPI peoples recently worked significantly to propose working Linux binary packages from pip, see https://www.python.org/dev/peps/pep-0513/
Managing C/C++ dependencies via pip is not trivial, their approach seems robust though. They use a VM image that they tested for compatibility to build distributable binary wheels.
Why they want to duplicate the work of package managers? Perhaps for Windows/MacOS people that's useful but for Linux users.. I did some experiments here: https://github.com/MrTheodor/espressopp/tree/pypi right now, it's possible to call setup.py install and build, export to pypi and the pip install espressopp also works correctly (tested on testpypi server) but install fails due to the paths. That's because I call cmake and make directly from the setup.py which seems to work locally but not with the pip.
If you pip install espressopp
, it will install missing Python dependencies via pip (thus compiling on the way numpy, and many more). This is very long. Also, do you include hdf5 as a dependency? Or do you rely on it being pre-installed?
One way around this is to have all the "regular" packages preinstalled, this is not always the case on users' machines.
One way to test the procedure is to have someone not using espressopp or related technology (boost, hdf5, numpy) to install the package, or using a fresh VM image. You can do pip install .
to test without uploading.
Here is a setuptools extension, which supports CMake: https://github.com/scikit-build/scikit-build