-
Notifications
You must be signed in to change notification settings - Fork 25
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
Optimizing dependencies #208
Comments
@banesullivan Thank you for opening this issue! I agree that EOmaps is currently installing a lot of optional dependencies that are not needed for basic functionalities. The reason why I choose to be quite extensive at the moment is twofold:
I am unsure if implementing optional dependencies with pip and keeping the full install on conda is a good idea or if this might cause confusion. On the other hand, I am not sure how I would even implement a conda metapackage... Concerning the handling of optional dependencies.... I need to explicitly test this to be 100% sure but in general I think that optional dependencies should already be treated as expected (except that they are installed...)! on packages that might be removed
|
First draft for optional dependency groups now implemented in the PR that implements the switch from |
Optional |
Is your feature request related to a problem? Please describe.
EOmaps has quite a few hard requirements under it's basic installation mode:
pip install EOmaps
. I'm curious if we could trim down the requirements to a critical few to minimize the impact of installing EOmaps?I realize that many of these dependencies are indeed mission-critical (matplotlib, numpy, cartopy), but other dependencies may be more for user convenience or used for specific tasks.
Keeping the core, hard dependencies of a Python package slim ensures that the package remains lightweight and easy to install, reducing the risk of compatibility issues and dependency conflicts. Leveraging Python packaging's structure for optional dependencies allows for greater flexibility and customization, enabling users to tailor the package to their specific needs without being burdened by unnecessary components.
However, I want you to do whatever makes the most sense for most users. If you think most users want all of these, give them all of these! I just thought I'd raise this as it was a bit of a red flag to see so many dependencies without any optional.
Describe the solution you'd like
Would it make sense to group some of these dependencies using
extras_requires
(or optional-dependencies in the new setuptools paradigm)? I think you'll have a better understand of which groups to implement but I'm imagining something like:Perhaps remove the following:
xmltodict
: I don't see this used anywhere? Perhaps it's optional to Pandas? If so, I don't recommend making it a hard requirement unless you are directly relying on itpackaging
: Can we use a standard library to accomplish what you need?pyepsg
: Again not directly seeing this used.descartes
: Again not directly seeing this usedAnd set the dependencies as:
I see that you are already handling many of these dependencies as "optional" in a sense, like here:
EOmaps/eomaps/shapes.py
Lines 1269 to 1274 in 7136149
But this isn't well handled everywhere:
EOmaps/eomaps/shapes.py
Line 259 in 7136149
As a second part of this issue/request, I'm curious if you could make sure that optional dependencies are well-handled throughout the library: raising user-friendly exceptions when not available (as you have above)
Describe alternatives you've considered
If nothing else, I think it would be great to explain the purpose of each dependency
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: