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

Managing optional dependencies #75

Open
Peter9192 opened this issue Feb 20, 2023 · 1 comment
Open

Managing optional dependencies #75

Peter9192 opened this issue Feb 20, 2023 · 1 comment
Labels
Long term Ideas/suggestions/plans for the longer term

Comments

@Peter9192
Copy link
Collaborator

Springtime currently offers a nice, streamlined way to download data from several sources. It was designed to be extensible, in the sense that it should be easy to add more data sources. However, new data sources typically come with additional requirements (e.g. #54) and licenses (e.g. #63). This could eventually render the whole package cumbersome to work with.

It would be nice if we could separate the package into a core module with optional data source subsets. There are two main options:

  1. Import the springtime core package into new datasource subset packages.
  2. Import optional datasource subset packages into springtime. This would be my preferred option, but it requires a mechanism to register subset packages into the main tool.

Option 1 might lead to duplication and it moves away from the ideal of having a one-stop-shop for all your data workflows. This is why I would prefer option 2. To make that work, we need a mechanism to register subset packages into springtime.

Perhaps something like:

pip install springtime
springtime register springtime-phenology, springtime-stemmus-scope, springtime-rsdat

Where the last command should:

  • (pip) install the requirements of the subpackages
  • tell springtime about the additional datasets in the subpackage (perhaps through a config file?)
  • ...

Then we can make springtime, on load, search for Dataset objects in the packages specified in the config file, and add those to the list of Datasets it can work with.

@Peter9192
Copy link
Collaborator Author

Peter9192 commented Feb 21, 2023

Flake8 has a very comprehensive documentation on writing plugins. We could use something similar here.

There are several plugin frameworks for Python, e.g. Pluggy, used for pytest. But we could also use entrypoints directly, as they're part of the standard library and we might not need much more functionality.

@Peter9192 Peter9192 added the Long term Ideas/suggestions/plans for the longer term label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Long term Ideas/suggestions/plans for the longer term
Projects
None yet
Development

No branches or pull requests

1 participant