Search code examples
pythonscipypippypi

If my project depends on one function from scipy, does my project have to include the whole scipy package?


So my project uses the gaussian_filter1d from scipy.ndimage.filters package. I'm am in the process of making the setup.py file that will tell pip which dependencies should be installed with my project. I really don't want my package to require a full download of scipy for one function. I realize that gaussian_filter1d uses other functions from scipy in its code but I was wondering if there is a way to only include the gaussian_filter1d and functions it requires instead of the whole scipy project.

My gut tells me no but I thought I would ask just in case :P


Solution

  • If you really need this feature and cannot find a light-weight replacement or code it yourself, then I guess you have to include it in the requirements. If your project isn't sensitive to slug size, then adding a widely used dependency isn't really a big problem. Be sure to specify the version of scipy in your project, though.