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

deprecate calling implementation scripts directly #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* move argument parsing for logging options to the implementation code
* fix bug where logging options were being set incorrectly
* rename files to avoid potential naming conflicts with other packages (`logging` and `requests`)

* deprecate calling implementation scripts directly

## [0.6.0](https://github.com/crim-ca/stac-populator/tree/0.6.0) (2024-02-22)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ setup-pyessv-archive:
@cd $(PYESSV_ARCHIVE_HOME) && git pull

test-cmip6:
python $(IMP_DIR)/CMIP6_UofT/add_CMIP6.py $(STAC_HOST) $(CATALOG)
stac-populator run CMIP6_UofT $(STAC_HOST) $(CATALOG)

del-cmip6:
curl --location --request DELETE '$(STAC_HOST)/collections/CMIP6_UofT'
Expand Down
5 changes: 5 additions & 0 deletions STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import sys
from typing import Any, MutableMapping, Optional, Union
import warnings

from pystac import STACValidationError
from pystac.extensions.datacube import DatacubeExtension
Expand Down Expand Up @@ -129,6 +130,10 @@ def runner(ns: argparse.Namespace) -> int:


def main(*args: str) -> int:
warnings.warn(
"Calling implementation scripts directly is deprecated. Please use the 'stac-populator' CLI instead.",
DeprecationWarning
)
parser = argparse.ArgumentParser()
add_parser_args(parser)
ns = parser.parse_args(args or None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os.path
import sys
from typing import Any, MutableMapping, Optional
import warnings

from requests.sessions import Session

Expand Down Expand Up @@ -70,6 +71,10 @@ def runner(ns: argparse.Namespace) -> int:


def main(*args: str) -> int:
warnings.warn(
"Calling implementation scripts directly is deprecated. Please use the 'stac-populator' CLI instead.",
DeprecationWarning
)
parser = argparse.ArgumentParser()
add_parser_args(parser)
ns = parser.parse_args(args or None)
Expand Down
Loading