Skip to content
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

Dealing with optional cartopy dependencies #1176

Closed
ngoldbaum opened this issue Nov 12, 2018 · 5 comments
Closed

Dealing with optional cartopy dependencies #1176

ngoldbaum opened this issue Nov 12, 2018 · 5 comments

Comments

@ngoldbaum
Copy link

Right now it's a little bit awkward from a packaging perspective to depend on cartopy in an external package and also to use optional functionality in cartopy. For example, let's say I want my package to directly depend on cartopy and I also want to use cartopy's integration with matplotlib or the image transforms, which depend on scipy.

Now I can't tell my users that they should just install cartopy, since that won't also install all the direct dependencies of cartopy. I also can't list just cartopy in my pyproject.toml or install_requires.

One way to fix this would be to define a set of "extras" for optional functionality, then I could tell my users to install e.g. cartopy[plotting] from pip.

Another way to fix this would be to add e.g. matplotlib, scipy, and other python libraries with a relatively "solved" packaging story on most major platforms as direct dependencies of cartopy.

@QuLogic
Copy link
Member

QuLogic commented Nov 12, 2018

Extras are defined here; do they not work?

@dopplershift
Copy link
Contributor

To be even more clear, pip install cartopy[plotting] should work today already. Have you tried it?

@ngoldbaum
Copy link
Author

Ah cool I didn't appreciate this already works. I guess it just needs to be documented? For example, in the installation docs:

https://scitools.org.uk/cartopy/docs/latest/installing.html#installing

@pelson
Copy link
Member

pelson commented Nov 14, 2018

Agreed. We can improve the docs here.

As for conda packages, it is pretty much the same argument as conda-forge/xarray-feedstock#5 - should conda install cartopy install the full package, or the minimum viable product. Conda variants are perhaps the closest thing we have to being able to deliver that, but I'm not 100% on the status of using them (there is quite some irony here).

@greglucas
Copy link
Contributor

Some documentation on installing the extras is now included in the release.

@QuLogic QuLogic added this to the 0.22 milestone Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants