-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PyWavelets
and scipy
optional installs
#195
Conversation
PyWavelets
and scipy
optional installsPyWavelets
and scipy
optional installs + Fix Python 3.12 installation
setup.py
Outdated
extras_require={ | ||
"whash": "PyWavelets", # for whash | ||
'phash': "scipy", # for phash | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to provide these. Users can just add to their own dependencies. But it's a nice to have. And helps some tools that look at packages co-dependencies (for security analysis for instance)
I can somewhat see the benefit of providing an escape route if scipy or pywavelet is not installable. But it seems better to me to by default install dependencies so that all features can be used. |
I could always fork imagehash until PyWavelets 1.5 releases. Figured I'd try offering a more long-term solution upstream first. |
I like most of the PR. Is there a way to make the default install behave as if your [whash,phash] options are set? An alternative workaround is to install with pip --no-dependencies. |
Not as far as I know, it'd be more like a
That said, I didn't know about Since I already end up having to use a custom install script for different reasons, I could restrict |
Is this better? It keeps the existing default install behaviour, but more clearly offers, and explains how to, skip what are considered optional installs. |
PyWavelets/pywt#695 claims this is now resolved? |
PyWavelets
and scipy
optional installs + Fix Python 3.12 installationPyWavelets
and scipy
optional installs
My PyWavelets install issue was resolved by You mentioned liking part of the PR so I reduced the changes to just the optional runtime import and better error messages if it's a supported use-case.
If you don't see value in these changes. You are welcome to close the PR. |
Hmm, yes. If pip cannot install pywavelets and scipy, there is something seriously wrong or some specialized use case. Thank you for exploring this direction, maybe we can revisit it in the future. |
It's generally nice to not install dependencies the user doesn't need on their machine.
But this also makes imagehash installable on Python 3.12 ! (see error below)
I also improved the error message if the dependency is missing.