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

Make stac-validator and stac-check optional #468

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Nov 15, 2023

Description:
They have some unnecessary required dependencies that pollute downstreams. cc @pjhartzell @jkeifer

PR checklist:

  • Code is formatted (run scripts/format).
  • Code lints properly (run scripts/lint).
  • Tests pass (run scripts/test).
  • Documentation has been updated to reflect changes, if applicable.
  • Changes are added to the CHANGELOG.

@gadomski gadomski self-assigned this Nov 15, 2023
Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gadomski gadomski merged commit 36ad7cb into main Nov 17, 2023
19 checks passed
@gadomski gadomski deleted the make-stac-check-and-validate-optional branch November 17, 2023 14:10
if HAS_STAC_VALIDATOR:
from stactools.cli.commands import validate

registry.register_subcommand(validate.create_validate_command)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my only question is what happens if a user tries to run stac validate and they don't have the deps? Ideally that would result in a nice error message that tells them what to do. So maybe that would lend itself to always registering and then have the error raised within the actual call to do validation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, that's a good point. I can make a follow-on that makes the UX a bit nicer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see people writing import_optional helpers a lot. Ala https://github.com/stac-utils/xpystac/blob/main/xpystac/utils.py#L5-L10

@gadomski gadomski mentioned this pull request Nov 17, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants