pchanial / pyoperators

Operators and solvers for high-performance computing.
http://pchanial.github.com/pyoperators
Other
14 stars 9 forks source link

better dependency management #19

Closed ghisvail closed 8 years ago

ghisvail commented 9 years ago

Hi Pierre,

I recently update the package in Debian to 0.13.5 (successfully) but noticed some improvements that could be made on the dependencies declared in your setup.py.

IMO, and please correct me if I am wrong, your should only have hard deps on Numpy and Scipy and optional deps on pyfftw, numexpr, pywt and mpi4py.

The issue is that, with your current setup, some of these optional deps aren't explicit (mpi4py, pywt...) and some are forced, although not technically important (pyfftw). The downside of this is that in Debian, since pyfftw is not available for every architecture, but still detected as a hard dependency, pyoperators is not provided for all supported architectues although it has got the potential to be.

I'd suggest the following options:

1) Remove the numexpr and pyfftw requirements in your current setup, and leave Debian handling the optional deps downstream. Pip would still install numpy and scipy, since they are declared as hard deps.

2) Use the setup class from setuptools instead of numpy.distutils which provides additional metadata to handle the optional deps. For instance:

from setuptools import setup

setup(
    ....
    setup_requires=["numpy"],  # for numpy includes and distutils
    install_requires=["numpy>=1.6", "scipy>=0.9"],  # hard deps
    extras_require = {
        'fft': ["pyfftw"],
        'nonlinear':  ["numpexpr>=2"],
        'wavelet': ["pywt"],
    },  # optional deps
    ...
    )

I'd suggest to do 1) first, test and release it, so I can properly fix the package on the Debian side. Then, you can take your time to implement 2) if you are interested of course.

Cheers, Ghis

pchanial commented 8 years ago

I have followed your suggestion of using setuptools, thanks! Let me know if 0.13.12 works fine with your packaging.