-
Notifications
You must be signed in to change notification settings - Fork 70
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
HEP004: Improve support for discipline-specific classes by extras_require in setup.py #148
Comments
Why would this be necessary? Personally, I think adding optional dependencies to the |
Hm, I'm with @1313e. Further it is not done by making them optional, there would as @1313e indicates, also be required provision that loaders which depend upon optional dependencies are not available, are not installed or request the allowance to install the optional packages through pip. Further what if users later on install optional dependencies how can than theses loaders be activated or installed? The most reasonable option would be to collect them in domain specific loaders, which can be optionally activated as proposed for the compact_expand or the hickle-4.0 loader in the hickle-5-RC pr #149. To be honest I doubt that this is worth the efforts for now with astropy beeing the only such optional dependency package. And even if it would be two or three more it would be for me still not clearly decidable if it is. |
Ok, seems like a quorum, I'll drop the domain-specific idea. I had this in my head before I realised @1313e had already implemented lazy importing, which is the more important part of the picture. However, I do still think that it's more appropriate for astropy / scipy to be listed as optional dependencies in
I personally think this is clearer for anyone looking at Having said all that, I don't feel too strongly -- I personally don't think either solution in |
I think documentation is a great place for mentioning optional requirements. |
Me too. Lets keep this on very low priority list for the day when number of disciplines not requiring all packages for which dedicated loaders are provided by hickle raise and counts of issues related to missing, non or insufficiently unclear documented optional requirements explode. Further i do think as long as hdf5 and thus hickle does not gain major relevance beyond natural sciences and engineering i would not bother about scipy at all and rather consider it as something everybody has installed anyway like Numpy. |
Closing for now |
Abstract
To minimize dependencies while providing discipline-specific support, we could add
extras_requires
tosetup.py
(see setuptools documentation). For example:Would install astronomy-specific dependencies like
astropy
andpint
.We already have 'lazy import' support, added by @1313e in this commit. This is important as users shouldn't have to load
astropy
if they don't want to do astronomy!Motivation
In order to
load
data from a hickle file, the Python environment needs to have all the dependencies installed that a given class needs. For example, to load anastropy.Quantity
needs to load astropy, which is a large package that many users won't have installed. Adding anextras_requires
tosetup.py
would allow a user to quickly install optional dependencies and allow code contributors to maintain discipline-specific support.Specification
An
extras_require
is added to thesetup.py
. For example, here's the code from dask's setup.py:At the moment, we have optional dependencies
astropy
andscipy
in therequirements_test.txt
:I propose we add these to
extras_require
instead (and figure out a nice way to get arequirements_test.txt
equivalent)Open Issues
None
References
[1] https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html?highlight=extras#optional-dependencies
The text was updated successfully, but these errors were encountered: