Skip to content

Support policy for optional dependencies (contextily, geopandas, rioxarray, etc) #3456

Closed

Description

@weiji14

Opening a thread to discuss whether a formal policy should be put in place for testing optional dependencies listed under the pyproject.toml file at:

pygmt/pyproject.toml

Lines 41 to 48 in 9a12ae9

[project.optional-dependencies]
all = [
"contextily",
"geopandas",
"IPython", # 'ipython' is not the correct module name.
"pyarrow",
"rioxarray",
]

Originally posted by @weiji14 in #3420 (comment)

Thinking if we should generalize this to test minimum supported versions of all optional dependencies (contextily, geopandas, rioxarray, etc).

We should note that we currently don't set the minimum required versions for the optional dependencies.

Yeah, should we come up with a policy for this? E.g. extend SPEC 0 with a recommendation like:

  1. Support for optional package dependencies be dropped 1 year after their initial release.

For reference, xarray seems to use 12 months as the default for most dependencies - https://github.com/pydata/xarray/blob/v2024.09.0/ci/min_deps_check.py#L35. Downside with this is more maintenance effort, since we need to update the minimum pins for optional dependencies more often. We could also just state this policy, but not have an explicit pin?

@seisman suggested at #3420 (comment) the following:

I actually prefer to not set any minimum pins for optional dependencies and rely on the package manager like mamba/conda to install whatever versions that are compatible with the core dependencies.

So I guess we can do the following:

  1. Document the policy that optional dependencies are supported for 1 year only, i.e. users should use more up to date optional dependencies where possible.
  2. Do not set minimum pins on optional dependencies explicitly in pyproject.toml, but allow for breaking backwards compatibility (e.g. drop geopandas v0.x support) after 1 year.

Thoughts?

Activity

  1. added
    question
    on Sep 26, 2024
  2. seisman commented on Nov 13, 2024

    @seisman
    Member

    So I guess we can do the following:

    1. Document the policy that optional dependencies are supported for 1 year only, i.e. users should use more up to date optional dependencies where possible.
    2. Do not set minimum pins on optional dependencies explicitly in pyproject.toml, but allow for breaking backwards compatibility (e.g. drop geopandas v0.x support) after 1 year.

    Thoughts?

    Sounds good to me. For point 2, I think we still should set minimum pins if we know that old versions definitely won't work. For example, pin geopandas>=1.0 if we decide to drop geopandas v0.x.

  3. weiji14 commented on Nov 13, 2024

    @weiji14
    MemberAuthor

    Sounds good to me. For point 2, I think we still should set minimum pins if we know that old versions definitely won't work. For example, pin geopandas>=1.0 if we decide to drop geopandas v0.x.

    Ok, sounds good to me. For geopandas, the last non 1.x release is 0.14.4 (28 Apr 2024), so we could decide to pin to >=1.x on 28 Apr 2025. The other optional dependencies aren't too problematic yet I think, so we can just leave them unpinned until they cause issues.

  4. added
    maintenance
    and removed
    question
    on Nov 13, 2024
  5. added this to the 0.14.0 milestone on Nov 14, 2024
  6. added
    documentation
    and removed
    maintenance
    on Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions