Skip to content

Handling STAC extension version upgrades #448

Closed
@duckontheweb

Description

@duckontheweb

Moving here from stac-spec Discussions thread.

Now that STAC extension versions are no longer tied to the core STAC version or to each other, we may run into situations where a user is working with catalogs that implement some combination of a core spec version and extension versions that are not all supported by the same version of PySTAC.

Here are a few ideas on how to handle this, but other suggestions are welcome. It would also be good to get feedback from maintainers of downstream libraries on what would work best.

1. Separate Extension Repos

STAC extension implementations would each have their own repo that would follow its own versioning (e.g. pystac-extension-label, pystac-extension-file, etc.). This would probably also require creating a pystac-extensions-base package that would be a dependency of each extension implementation.

Pros

  • More accurately reflects the structure of the spec with extensions separate from the core spec
  • Developers can mix and match any combination of extension versions they need
  • No need to upgrade PySTAC version with each extension version update
  • Simpler PySTAC core code base

Cons

  • Means a lot more repos in stac-utils org
  • Could lead to dependency conflicts if different extension implementations are using different versions of pystac-extensions-base
  • Developers need to explicitly install each extension they want to use (or maybe we have an all-extensions extra in the pystac install that grabs all of them...)
  • Sounds like a lot of work and may delay a 1.0 release

2. Version-specific Extension Classes

Instead of a single set of extension classes (e.g. EOExtension, ItemEOExtension, AssetEOExtension), we create a set of classes for each extension version (e.g. EOExtension_1_0_0, etc.). We still have a top-level extension class (e.g. EOExtension) with an ext method that would handle parsing the extension schema URI and delegating to the right version-specific class.

Pros

  • Fewer repos to maintain
  • Developers will continue to get extension support within PySTAC without needing to install other extension-specific dependencies
  • May be able to limit the outward-facing changes if the behavior of ext stays mostly the same as it is now
  • Might be able to implement this incrementally (i.e. only for extensions that have actually undergone an upgrade)?

Cons

  • More complex extension code base within PySTAC (may need to create version-specific modules within each extension to keep the files from getting too bloated).
  • Typing may be difficult and/or confusing (e.g. calling EOExtension.ext and getting an instance of EOExtension_1_0_0 back might be non-intuitive).

3. Only Support Latest Version (Status Quo)

We continue to update the existing extension code to support each new extension version as it is released and do not provide support for multiple extension versions within the same version of PySTAC.

Pros

  • Lowest development effort
  • Simpler extension code than other 2 options

Cons

  • Does not solve the issue raised above. It would be on users to find a workaround.

cc @lossyrob @m-mohr @gadomski @jbants @matthewhanson

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingRepresents a potentially breaking change that may warrant a major version releasediscussionAn issue to capture a discussion

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions