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

Create configuration file option #77

Merged
merged 33 commits into from
Apr 13, 2022
Merged

Create configuration file option #77

merged 33 commits into from
Apr 13, 2022

Conversation

jonhealy1
Copy link
Collaborator

@jonhealy1 jonhealy1 commented Apr 1, 2022

#76

@jonhealy1 jonhealy1 marked this pull request as ready for review April 12, 2022 15:51
@jonhealy1 jonhealy1 requested a review from gadomski April 12, 2022 15:51
.github/workflows/publish-to-pypi.yml Outdated Show resolved Hide resolved
.github/workflows/publish-to-test-pypi.yml Outdated Show resolved Hide resolved
stac-check.config.yml Outdated Show resolved Hide resolved
stac-check.config.yml Outdated Show resolved Hide resolved
stac_check/lint.py Outdated Show resolved Hide resolved
stac_check/lint.py Outdated Show resolved Hide resolved
stac_check/lint.py Outdated Show resolved Hide resolved
stac_check/lint.py Outdated Show resolved Hide resolved
Comment on lines 46 to 47
with open(default_config_file) as f:
default_config = yaml.load(f, Loader=yaml.FullLoader)
Copy link
Member

Choose a reason for hiding this comment

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

If STAC_CHECK_CONFIG isn't set, and stack-check.config.yml doesn't exist in the user's current working directory, this will error, no?

You might need to use something like pkg_resources to include the configuration file in the installed package (one example of using pkg_resources in such a way is here: https://github.com/stactools-packages/noaa-c-cap/blob/main/src/stactools/noaa_c_cap/utils.py).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call! I think it's fine now with the MANIFEST.in file. Thank you

@philvarner
Copy link
Collaborator

lgtm, but I'll defer to Pete's approval

@jonhealy1 jonhealy1 requested a review from gadomski April 13, 2022 15:58
Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

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

I fixed up the default config file to use pkg_resources, should be good to go.

@jonhealy1
Copy link
Collaborator Author

@gadomski awesome thanks

@jonhealy1 jonhealy1 merged commit 5e20c03 into main Apr 13, 2022
@jonhealy1 jonhealy1 deleted the create_config branch July 31, 2022 09:02
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.

3 participants